Professional Documents
Culture Documents
Discrete Mathematics With Graph Theory 2nd Edition
Discrete Mathematics With Graph Theory 2nd Edition
g P Saas saat Here is another demonstration of how to analyze complex compound state- ‘ments with truth tables. Suppose we want the truth table for p > ~(q Vp) [ave |=Gvp [p> Gv p) | 7 F F e T F F T Fr | T F Tr 1 Although the answer is presented as a single truth table, the procedure is to con- struct appropriate columns one by one until the answer is reached. Here, columns Land 2 are used to form column 3—g V p. Then column 4 follows from column. 3 and, finally, columns I and 4 are used to construct column 5, using the truth table for an implication in Fig 1.3 a When three statements p, q, and r are involved, eight rows are required in a truth table since it is necessary to consider the two possible truth values for r for each of the four possible truth values of p and q.1.3 Truth Tables 19 PROBLEM 10. Construct a truth table for (p vq) + [((>p) Ar) > @ An] Solution. Pla |r [=p[ Gear [a ar | (Gpan @arn| pve tilr|rtle| Tr r T T\|T\FlF| F F Tr T tlelr|r| F F T T Ti|Fl|F| F| F F T T Flr|t/r] 7 Tr r r F\rlel| F F r r FIF)r) ry} or F F F Flele[r| ef E Tr F (pv g) & (ap) Ar) > @ An) WIAA Of course, it is only necessary to construct an entire truth table if a complete analysis of a certain compound statement is desired. We do not need to construct all 32 rows of a truth table to do the next problem. PROBLEM 11. Find the truth value of [p> Gan) va9l A Ie) & GAN where p,q. r, and s are all true while ¢ is false. Solution. We evaluate the expression step by step. showing just the relevant row of the truth table, Plalr[s|ft]—-rlq@aCrn] @AGmvs T\T T\TIFLF F T P= lq ACV SIRs Arlen GAT) r rir r PS WGA CV OIAICH © GATI T ‘The truth value is true. !20 Chapter 1 Yes, There Are Proofs! EXAMPLE 13 1.3.1 DEFINITIONS [ZR CUS A notion that will be important in later sections is that of logical equivalence. Formally, statements A and ‘B are logically equivalent if they have identical truth tables. PROBLEM 12. Show that “A: p > (-g)” and “B: =(p Aq)” are logically equivalent Solution, We simply observe that the final columns of the two truth tables are identical, =q [p> Ca] P| 4 [pAqg[=(PAq) F F rlr| 7 F |r T TIF| F Tr F r PIT) F Tr ri 7 Flel e | or 1 In Section 1.1, we defined the contrapositive of the statement “p — q” as the statement “(=g) —> (—p).” In Theorem 1.2.1, we proved that these implications are logically equivalent without actually introducing the terminology. Here is how to establish the same result using truth tables. pla|p> P [4 1-4 [ =P | Ca > Gry TT T T\T Fo T rlel| F r|F F F Flr] 7 a r T | FLF r Tr a A compound statement that is always true, regardless of the truth values assigned to its variables, is a tautology. A compound statement that is always false is a contradiction Show that “(p Ag) > (p vq)" is a tautology, while “(4p) Ag) (pv (=@))” is a contradiction ‘The truth table for p <> g appears in Fig 1.5. From this, we see immediately that two statements A and 8 are logically equivalent precisely when the statement A & Bisa tautology. 13. [p @ [PAG | PVG | Ag) > PVG) tir] r |r T rlr| F | T r F\T| F | T Tr FleF[ ele r ‘The final columa shows that (p Ag) > (p vq) is true for all values of p and q, so this statement is a tautology.1.4 The Algebra of Propositions 241 The final column shows that ((—p) Aq) A (p ¥ (=q)) is false for all values of p and q, so this statement is a contradiction. iy The symbol [BB] means that an answer can be found in the Back of the Book. 1. Construct a truth table for each of the following com- pound statements, (@) [BB] p 0 (=a) v p) ©) (Pagv(P) >a © PAG PoP (@) [BB] (> (pv Cay (pvr) (©) (p> >"> (Pager (a) If p > q is false, determine the truth value of (PAG) V (AP) > 9). (b) Is it possible to answer 2(a) if p + q is true instead of false? Why or why not? 2. [BB] Determine the truth value for Gacy re(cavgl when p,q.” and s are all true. 4. Repeat Exercise 3 in the case where p,q, rand s are all false 5. (a) Show that q > (p — q) is a tautology. (b) Show that [pg] l(—p) v (-9)] is a contradiction 6. (a) [BB] Show that [(p + q) 5 > > (p>) is a tautology. (b) [BB] Explain in plain English why the answer to 6(a) makes sense 1.4 THE ALGEBRA OF PROPOSITIONS 7. Show that the statement [Pv (an) > OV Us > (nv p)) view > rl is neither a tautology nor a contradiction 8. Given thatthe compound statement A isa contradiction, establish each of the following. (a) [BB] If B is any statement, A+‘ is a tautology () IF isa tautology, B+ A is a contradiction, 9. (a) Show that the statement p — (q — r) is not log cally equivalent to the statement (p — q) —r () What can you conclude from 9a) about th compound statement [p > (g > 1)) # lp > gory? 10. If p and g are statements, then the compound statement PY. q (oficn called the exclusive or) is defined to be true if and only if exactly one of p, @ is trues that is, ther p is true or q is true, but not both p and q are true (a) [BB] Construct a truth table for p vg (b) Construct a truth table for (p v (=p) Aq) V4. (c) [BB] Show that (p v q) > (p vq) is a tautology. (@) Show that p Yq is logically equivalent 10 a(p + 4). In Section 1.3, we discussed the notion of logical equivalence and noted that two statements A and B are logically equivalent precisely when the statement A <> ‘B is a tautology. More informally, when statements A and B are logically equivalent, we often think of statement ‘B as just a rewording of statement A. Clearly then, it is of22. Chapter 1 Yes, There Are Proofs! interest to be able to determine in an efficient manner when two statements are logically equivalent and when they are not. Truth tables will do this job for us, but, as you may already have noticed, they can become cumbersome rather easily. Another approach is first to gather together some of the fundamental examples of logically equivalent statements and then to analyze more complicated situations by showing how they reduce to these basic examples. Henceforth, we shall write A <> B to denote the fact that A and B are logically equivalent. The word “proposition” is a synonym for “(mathematical) statement.” Just as there are rules for addition and multiplication of real numbers—commutativity and associativity, for instance—there are properties of A and V which are helpful in recognizing that a given compound statement is logically equivalent to another, often more simple, one. Some Basic Logical Equivalences 1, Idempotenee: (vr) = P Gi) (PAP) = P 2. Commutativity: (i) (pvq) = vp) (i) (Ag) => GAP) Associativity: ® (Pvgvn = (wvayvn) Gi) (PA AT) => (PAW@AN) 4, Distributivity: @ WV @Ar) = (Ya Airvr) Gi) (PAV N) = (PAY (PAN) 5. Double Negation: = (=p) —> p 6, De Morgan’s Laws: @ > (pvg) = (op) Aa) Gi) (pg) => (Pv a) Property 6 was discussed in a less formal manner in Section 1.1 It is clear that any two tautologies are logically equivalent and that any two contradictions are logically equivalent. Letting 1 denote a tautology and 0 a con- tradiction, we can add the following properties to our list 2 @ pv) ad (i) (PAL) => p 8 @) (pv0) => p Gi) (PA) = 0 9 @) (pv (ap) = 1 (i) (D Ap) — 01.4 The Algebra of Propositions 23 10. @-1 0 01 We can also add three more properties to our list. A. (p>) = (9) > (=P) 12. (peg) ==> (P>gAqg> Pl 13. (p> gq) => Ip)val Property 11 simply restates the fact, proven in Theorem 1.2.1, that a statement and its contrapositive are logically equivalent. The definition of “<>” gives Prop- erty 12 immediately. Property 13 shows that any implication is logically equiva- Tent to a statement which does not use the symbol —> Given the statement p —> q, show that its converse, q > p, and its inverse, (sp) > (=9)], are logically equivalent. Show that [-(p = q)] <=> [(p A (m9) vq A (py). PROBLEM 14. Show that (sp) + (p + q) is a tautology. Solution. Using Property 13, we have Up) > (p> Q)] = Up) > rp) vQ)1 = (ep) v CPV gl <= pvicp)val = [pv Cplvg = 1vq 1 ' In the exercises, we ask you to verify all the properties of logical equivalence which we have stated. Some are absurdly simple. For example, to see that (p V P) <> p, we need only observe that p and pv p have the same truth tables: PIPYP T| 7 FILE Others require more work. To verify the second distributive property, for example, ‘we would construct two truth tables.24 Chapter1 Yes, There Are Proofs! PRM ‘Si PAG [PAT[@A j)rj\tr PROBLEM 15, Express the statement (=(p V q)) V (=p) Aq) in simplest possible form Solution, De Morgan’s first law says that > (p Vg) <=3 (4p) A (79). Thus CI vav (ep) Ag = Kp) Aa) v (=p) AD. mamas messanssls F A in r ie 1 F Saat since adjoining the same term to statements which have the same truth tables will produce statements with the same truth values. Using distributivity, the right side of (*) is (ip) 4 (av (mp) Ag = (op) Arg v gl = [pall = > so the given statement is logically equivalent simply to sp. ' In the solution to Problem 15, we said “adjoining the same term to statements, which have the same truth tables will produce statements with the same truth values.” Make this claim into a formal assertion and verify it. In Problems 14 and 15 we used, in a sneaky way, a very important principle of logic, which we now state as a theorem. The fact that we didn’t really think about this at the time tells us that the theorem is easily understandable and quite painless to apply in practice. Suppose A and B are logically equivalent statements involving variables, Pi. P2.-++ + Pn. Suppose that C), C2,... ,y are statements. If, in A and B, we replace py by C), pp by C2 and so on until we replace p, by Gy, then the resulting statements will still be logically equivalent Explain how Theorem 1.4.1 was used in Problem 15. PROBLEM 16. Show that [eva vq yr) A(py ny) = sip) A(4)). Solution. The left hand side is logically equivalent to (ev gv qv Male vagy (pyr)1.4 The Algebra of Propositions 25 by distributivity. Associativity and idempotence, however, say that pvay(qviry)) = [pv @av@v cr) = [pviqv ayn] S PV GVM = Kevavcnh while we also have (ovavievnl = [av p—v@Pvnl = [qv ipvipyr)) = [gv (py pvr] = avipvnl = Mav pvr] = [var Hence our expression is logically equivalent to MPV av ory) APY QV rl = Uevayy (or) Aryl <= [pv g) V0] —> pvg Finally, with the help of double negation and one of the laws of De Morgan, we obtain PYG = 7 (PVQ) + Ip) Aah 1 The next problem illustrates clearly why employing the basic logical equiva lences discussed in this section is often more efficient than working simply with truth tables. PROBLEM 17. Show that [5 > (sp) Aq)ar)] => =[(pv(m GAr))As} Solution. bs > (Gp) AQ AN] = [oN Vp) Ag ANI = [9 Vp) A aryl = [9 vO V ig ary SS AGA DVO Wan SS MPV Og AN) AS). ' A primary application of the work in this section is reducing statements to logically equivalent simpler forms. There are times, however, when a different type of logically equivalent statement is required,26 Chapter 1 Yes, There Are Proofs! ESR NONMM L-ct n> | be an integer. A compound statement based on variables x1,.x2, EXAMPLE 18 EXAMPLE 19 is said to be in disjunctive normal form if it looks like (ait Naz A+ Ain) V (424 A.a22 Av Adan) VV dnt And Ao A inn) where, for each i and j, 1 [Ay VEACY)I for any statements x and y. This follows from x => (KAT) > bACYV (Fy) > [AY VIKA (Hy) PROBLEM 20. Express p —> (g Ar) in disjunctive normal form Solution. Method 1: We construct a truth table. [p> Gary 7 | | ssn TRIS sass Now focus attention on the rows for which the statement is true—each of these will contribute a minterm to our answer. For example, in row 1, p, q, and rare all T, so p Aq Ar agrees with the T in the last column. In row 4, p is F, while q and r are both 7. This gives the minterm (=p) Ag Ar. In this way, weCOs 1.4 The Algebra of Propositions 27 obtain DWAGADV HP) AGANY p) AGA) VUGP) AG) AVP) AQ) Ar)) Method 2: We have > @anl Sip) v@ ar SUMP) ADY (CP) ACA Vv @ ATI SMP AGA ¥ (OP) AGA) VP) Aa) AN) VSP ACIACN) V (PAGAN Y (oP) AGANI SUP AGAN ¥ CP) AGA) V (PACD AN Vp) AA) AGN) ¥ (PAGAN omitting the second occurrence of (=p) Ag Ar at the last step. We leave it to you to decide for yourself which method you prefer. 1 Disjunctive normal form is useful in applications of logic to computer science, particularly in the construction of designs for logic circuits 14, This is just a restatement of Property 11, writing p instead of q and q instead of p. 15. This could be done with truth tables. Alternatively, we note that ap og) SS p> MAG PI = AP) V9) Ag) PD = GP) vav Oa) v py) <= PAC) v @ Ap) 16, The claim is that if A <=> B, then (AVC) <=> (B ve) for any other statement €. Since A <=> B, A and B have the same truth tables. Establishing (A v @) <= (B v €) requires four rows of a truth table. The last two columns establish our claim. A similar argument shows that if A &> B, then (AAB) <> (BAC) for any statement © 17. In applying the distributive property, we are using =p, +g and q in place of p,q and r. Also, when applying Property 7, we use +p instead of p.28 Chapter 1 Yes, There Are Proofs! EXERCISES The symbol [BB] means that an answer can be found in the Back of the Book 1. Verify cach of the 13 properties of logical equivae lence which appear in this section (BB; 1,35,7.9, 11,13) ‘Simplify each of the following statements (a) [BB] (pg) v (=p) vg) ©) VN) > [GV Cr) > (oP) > 1 © lp avq>nlawr—s 3. Using truth tables, verify the following absorption prop- erties (a) [BB] (pv (pq) — p ©) (PAYG) = Pp 4. Using the properties in the text together with the absorp- tion properties given in Exercise 3, establish each of the following logical equivalences. 5. Prove that the statements (p A (>g)) > q and (p A ( (op) a4] OL > (PACr) © Feo gl = [po al @) [BB] “ip = MV (PACIN => ©) (p> @ ay (rv al OMPACD)AC@PACDV GACH = paca normal form. (@) [BB] pag (b) [BB] (p. 4g) v OP) vg) © pq @ D> gaqan Find out what you can about Augustus De Morgan and write a paragraph or two about him, in good English, of course! > al leo 9, 1.5 Locica. ARGUMENTS PERM sae Proving a theorem in mathematics involves drawing a conclusion from some given information. The steps required in the proof generally consist of showing that if certain statements are true, then the truth of other statements must follow. Taken in its entirety, the proof of a theorem demonstrates that if an initial collection of statements—called premises or hypotheses—are all true, then the conclusion of the theorem is also true. Different methods of proof were discussed informally in Section 1.2. Now we relate these ideas to some of the more formal concepts introduced in Sections 13 and 1.4. First, we define what is meant by a valid argument. ‘An argument is a finite collection of statements Ay, A2, ... ,An called premises (or hypotheses) followed by a statement B called the conclusion. Such an argument is valid if, whenever Ay, Az, ....An are all true, then B is also true,1.5 Logical Arguments 29 It is often convenient to write an elementary argument in column form, like this ol PROBLEM 21. Show that the argument pomq rq =p is valid. Solution, We construct a truth table. Observe that row 4—marked with the star (+)—is the only row where the premises p> 74.1 > q, rare all marked T. In this row, the conclusion —p is also T. ‘Thus the argument is valid. In Problem 21, we were a bit fortunate because there was only one row where all the premises were marked T. In general, in order to assert that an argument is valid when there are several rows with all premises marked T,, it is necessary to check that the conclusion is also T’ in every such row. Arguments can be shown to be valid without the construction of a truth table, For example, here is an alternative way to solve Problem 21. Assume that all premises are true, In particular, this means that r is true. Since r + q is also true, ¢ must also be true. Thus ~g is false and, because p > (=g) is true, p is false. Thus —p is true as desired, PROBLEM 22. Determine whether or not the following argument is valid. If I like biology, then I will study it _Either I study biology or I fail the course. Tf fail the course, then T do not like biology.30 Chapter 1 Yes, There Are Proofs! fren eeMoco Solution. Let p be “I like biology,” q be “I study biology,” and r be “I fail the course.” In symbols, the argument we are to check becomes pra qr =e This can be analyzed by a truth table. PIE P= Tar Pa t[r|r| 7 tT /F FO ls T\T\F) tT) rT |r] or fs ThE r| FUT |FI F [riz] 7 |r |r re altel eae e[rie| ro) fr] or fe Flejt) ro jr |r rls elr|e| TilLeir}] 7 ‘The rows marked » are those in which the premises are true. In row 1, the premises, are true, but the conclusion is F, The argument is not valid. 1 The theorem which follows relates the idea of a valid argument to the notions introduced in Sections 1.3 and 1.4. An argument with premises Ay, A2,... ,An and conclusion B is valid precisely when the compound statement Ay A Az A-+ A An > B is a tautology. Surely, this is not hard to understand. In order for the implication Ay A Az A Ady —> B to be a tautology, it must be the case that whenever Ay AA2A:--*AAy is true, then B is also true. But Ay A Az A+++ A Ay is true precisely when each of Aj, Az... .Ay is true, So the result follows from our definition of a valid argument. In the same spirit as Theorem 1.4.1, we have the following important substi- tution theorem. {Substitution} Assume that an argument with premises Ay, Aa, .... An and con- clusion B is valid, and that all these statements involve variables p1, p2,...- + Pm- If pi, p2.-.+ + Pm are replaced by statements C), C2,..., Gm, the resulting argu- ‘ment is still valid, Rules of Inference Because of Theorem 1.5.3, some very simple valid arguments which regularly arise in practice are given special names. Here is a list of some of the most common rules of inference.1.5 Logical Arguments 34 1. Modus ponens: 2. Modus tollens: p> q 4. Chain rule: 5. Resolution: =p Vr avon) PYG Verify modus tollens, We illustrate how the rules of inference can be applied. PROBLEM 23. Show that the following argument is valid. (pv q) > (sA0) Ls) v GN) > In val PVDF FQ Solution. One of the laws of De Morgan and the principle of double negation— see Section 1.4—tell us that F8) V (>) Se LO) AGO => AD, Property 13 of logical equivalence as given in Section 1.4 says that (—r)Vvq <=> (r > q). Thus the given argument can be rewritten as (pvg > an GAD>0>9) @VO>0> 9). ‘The chain rule now tells us that our argument is valid. ' If a truth table were used to answer Problem 23, how many rows would be required? Sometimes, rules of inference need to be combined.32 Chapter 1 Yes, There Are Proofs! EOE PROBLEM 24. Determine the validity of the following argument. If I study, then I will pass If I do not go to a movie, then | will study, I failed. Therefore, I went toa movie. Solution. Let p,q and r be the statements p:“L study.” qs “I pass.” “1 go to a movie.” The given argument is pq Cn p 74 first two premises imply the truth of (=r) > q by the chain rule. Since (Gr) > q and =g imply (=r) by modus tollens, the validity of the argument follows by the principle of double negation: ~ (=r) <=> r. 1 18, While this can be shown with a truth table, we prefer an argument by words. Since —g is true, q is false. Since p — q is true, p must also be false. Hence =p is true and we are done. 19. There are five variables, each of which could be T or F, so we would need 25 = 32 rows. EXERCISES The symbol [BB] means that an answer can be found in the Back of the Book. You are encouraged 10 use the result of any exercise in this set 10 assist with the solution of any other. 1, Determine whether or not each of the following argu- @ pa ments is valid (@) [BB] p> qr) —4_ por (b) [BB] p> avi roa © Poa 4 r>P vr) > (pas) s> vay 2. Verify that each of the five rules of inference given in this section is a valid argument, 3. Verify that each of the following arguments is valid, (@) [BB] por qor @vay>r(b) por hos (PAD SOAS) © py4a Gp)vr Gnvs avs @ pvicaan =(pAs) aGAGV GM) 4, Test the validity of each of the following arguments, (@) [BB] pq Cn ved) 5 pvig) (vs) vn Crvevs) pedys) @vn>@vn © — pyca) (vs > (pvr Gnvevs) __ pets) @vn> vn (b) [BB] (@) (pag vrl> @arasy Usp). al = (FY 0) [pv (=) vr @ As) (page lqGanyvsl 5, Determine the validity of each of the following argu- ments. If the argument is one of those listed in the text, name it (@) [BB] If 1 stay up late at night, then I will be tired in the morning. I stayed up late last night “Tam tired this moming. (b) [BB] If I stay up late at night, then 1 will be tired in the morning. Lam tired this morning. Tstayed up Tate last night, (©) If 1 stay up late at night, then I will be tired in the morning. Lam not tired this morning, T did not stay up Tate Tast night. 1.5 Logical Arguments 33 (@ IF 1 stay up late at night, then I will be tired in the morning. T did not stay up late last night Tam not tired this morning. (© (BB) Either 1 wear a red tie or wear blue socks. 1Lam wearing pink socks. Tam wearing a red We () Either 1 weara red tie or wear blue socks Lam wearing blue socks. Tam not wearing a red te (g) (BB] 161 work hard, then I eam lots of money. If 1 eam lots of money, then I pay high “TFT pay High taxes, then T have worked hard, (h) If | work hard, then I eam lots of money. If T earn lots of money, then I pay high taxes. “TPT work hard, then T pay high axes. @) If work hard, then I eam lots of money, If I earn lots of money. then I pay high taxes. TIFT do not work hard, then T do not pay high taxes, (If L like mathematies, hen I will study. 1 will not study. ther I like mathematics or ike football. T Tike Football (&) Either I study or Like football If Tike football, then I lke mathemati TFT don’t study, then T like mathematics. () [BB] If 1 fike mathematics, then I will study. Either I don’t study or I pass mathematics, If T don't graduate, then I didn’t pass mathematics TFT graduate, then T sided (am) If ike mathematics, then I will study Either I don’t study of I pass mathematics. If T don't graduate, then I didn't pass mathematics TFT like mathematics, then Twill graduate 6. [BB] Given the premises p > (ar) and rv q, either write down a valid conclusion which involves p and 4 only and is not a tautology or show that no such conclusion is possible. 7. [BB] Repeat Exercise 6 with the premises (=p) + r and rv q.34 Chapter 1 Yes, There Are Proofs! 8. (a) [BB] Explain why two premises p and q can always, be replaced by the single premise p Aq and vice versa, (b) Using 8(@), verify that the following argument is valid, pag por sang Gaar 9. Let m be an integer greater than 1. Show that the fol lowing argument is valid. pain) ran) Px > dn te) _ GAGA AG PM AR DA @n > Ta) [Hint Exercise 8(@).] 45-10, {BB} What language is being used when we say “modus ;ponens” or “modus tollens"? Translate these expressions into English and explain. REVIEW EXERCISES FOR CHAPTER 1 1. State, with a reason, whether each of the following state iments is true or false. (a) Ifa and b are integers with a—b > O-and b—a > 0, then a #5, (b) If a and b are integers with a—b > Oand b—a > 0, then a $b, 2, Write down the negation of each of the following state- ments in clear and concise English. (@) Either x is not a real number or x > 5. (b) There exists a real number x such that n> x for every integer (©) If-x, y,£ are positive integers, hen x3 + y3 4 23 (@) If a graph has n vertices and n+ 1 edges, then its chromatic number is at most 3 3. Write down the converse and contrapositive of each of the following implications. (a) If a and b are integers, then ab is an integer (b) If x is an even integer, then x? is an even integer. (©) Every planar graph can be colored with at most four colors. 4, Rewrite each of the following statements using the quan- tifiers “for all” and “there exists” as appropriate (a) Not all countable sets are finite (b) 1 is the smallest positive integer. 5. (a) Determine whether or not the following implication is true, ‘x is a positive odd integer > x +2 isa positive odd integer.” (b) Repeat (a) with + replaced by «. 6. Let n be an imeger. Prove that nis odd if and only if nis odd. 7. With a proof by contradiction, show that there exists no largest negative rational number. 8. Construct a truth table forthe compound statement [p 0 (> AN Wa) vr 9. Determine the truth value of [p Vg + (=r) As) = (ran, where p, gy rs and t are all true 10. Two compound statements A and B have the property that A + B is logically equivalent to B + A, What ccan you conclude about A and ‘B? U1. (@) Suppose A, B, and © are compound statements such that A <=> ‘Band Bo e=5 C. Explain why A <= ©. (b) Give a proof of Property 11 which uses the result of Property 13 12. Establish the logical equivalence [(p > q) > r] <=> [WVN ACG ACH 13, Express (pV g) Ar) V (pV 4) Ap) in disjunctive normal form.