MATH CSE20 Final Exam Review Sheet Exam REC GYM Monday, 12/9 from 3:00 pm to 5:59 pm. Textbook sections: Unit BF Sections 1-2, Unit Lo Sections 1-2, Unit NT Sections 1-2, Unit SF Sections 1-2, Unit EO Sections 1-2, Unit IS Section 1 (1) All questions from Homeworks 1-8. (2) Verify the following logical equivalences in two ways: using truth-tables and using algebraic manipulation. (a) pq^ „ qq _ p ” p Solution: pq^ „ qq _ p ” 0 _ p “ p Note: the original version of the question was different. The LHS was written as pp^ „ qq _ p. Notice that this statement is also equivalent to p, as demonstrated by the following truth table: p q pp^ „ qq _ p 0 0 0 0 1 0 1 0 1 1 1 1 Algebraically, we can also prove this identity: pp^ „ qq _ p Comm. ” p _ pp^ „ qq Absorption ” p (b) „ pp„ p ^ qq _ p„ p^ „ qqq _ pp ^ qq ” p. Solution: „ pp„ p ^ qq _ p„ p^ „ qqq _ pp ^ qq ” p„ p„ p ^ qq^ „ p„ p^ „ qqq _ pp ^ qq ” ppp_ „ qq ^ pp _ qqq _ pp ^ qq ” pp _ p„ q ^ qqq _ pp ^ qq ” pp _ 0q _ pp ^ qq ” p _ pp ^ qq Now let’s look at the truth table: p q p _ pp ^ qq 0 0 0 0 1 0 1 0 1 1 1 1 Note that the last column has exactly the same truth values as the first so p_pp^qq ” p. (3) 2 (a) Show that the following statement forms are all logically equivalent: p Ñ pq _ rq pp^ „ qq Ñ r pp^ „ rq Ñ q Solution: We use a truth-table p q r p Ñ pq _ rq pp^ „ qq Ñ r pp^ „ rq Ñ q 0 0 0 1 1 1 0 0 1 1 1 1 0 1 0 1 1 1 0 1 1 1 1 1 1 0 0 0 0 0 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 Since all three columns agree, the statement forms are logically equivalent. (b) Use the logical equivalences established above to rewrite the following sentence (in words) in two different ways. (Assume that n represents a fixed integer.) If n is prime, then n is odd or n is 2. Solution: We decompose the statement using variables as follows: p = “n is prime”; q = “n is odd”; r = “n is 2”. Then by part (a), equivalent ways of stating the sentence use the form pp^ „ qq Ñ r or pp^ „ rq Ñ q ‚ If n is prime and not odd, then it is 2. ‚ If n is prime and not 2, then it is odd. (4) Design a circuit for the following input/ output table (Boolean function): p 0 0 0 0 1 1 1 1 q 0 0 1 1 0 0 1 1 r Output 0 0 1 0 0 0 1 0 0 1 1 1 0 0 1 1 Solution sketch: First, we write the function using the standard Boolean connectives (and, or, not). Then, each of these can be realized as a logic gate. To find a Boolean formula with this input/ output table, we can look for patters or use DNF or CNF. ‚ Pattern: note that the first half of the rows output 0 so to get output 1 we must have p be true. Moreover, the last four rows look the like the truth table of implication q Ñ r. Putting this together, we get p ^ p„ q _ rq since q Ñ r ” p„ q _ rq 3 ‚ Normal form: CNF has clauses for each row with output 0 and DNF has clauses for each row with output 1. Since this table has more 0 rows than 1 rows, the DNF will be shorter so we’ll use it. Informally, the DNF clause for each row with output 1 is the conjunction of variable settings that determine the row. In this case, we describe rows 5,6,8: pp^ „ q^ „ rq _ pp^ „ q ^ rq _ pp ^ q ^ rq Either way, the circuit can now be drawn by choosing appropriate gates for each of the Boolean connectives. (5) Convert the following integers from hexadecimal to decimal and binary notations. (a) A2BC16 ‚ Decimal: 10 ¨ 163 ` 2 ¨ 162 ` 11 ¨ 16 ` 12 “ 40960 ` 512 ` 176 ` 12 “ 41660 ‚ Binary: expand each hex letter to four bits 1010001010111100 (b) 39EB16 ‚ Decimal: 3 ¨ 163 ` 9 ¨ 162 ` 14 ¨ 16 ` 11 “ 12288 ` 2304 ` 224 ` 11 “ 14827 ‚ Binary: expand each hex letter to four bits 0011100111101011 (6) Use 8-bit representations and two’s complement to compute the following sums. (a) p´6q ` p´73q (b) 123 ` p´94q Solution: Recall that the n-bit 2s complement of x is 2n ´ x. We can also compute its bit representation by flipping bits and adding 1 to the representation of x. (a) 610 “ 1102 so with 8-bits, 00000110. Flipping bits and adding 1, we represent ´6 as 11111010. Similarly, 7310 “ 64 ` 8 ` 1 “ 10010012 so 01001001 Flipping bits and adding 1, we represent ´73 as 10110111. Now we add: 11111010 `10110111 10110001 To check the computation, let’s convert back to decimal: 101100012 “ ´27 ` 25 ` 24 ` 20 “ ´128 ` 32 ` 16 ` 1 “ ´79 X (b) 12310 “ 64 ` 32 ` 16 ` 8 ` 2 ` 1 “ 011110112 and the two’s complement of 94 is 28 ´ 94 “ 162 “ 128 ` 32 ` 2 “ 10100010. Now we add: 01111011 `10100010 00011101 4 Converting to check our work: 1 ` 4 ` 8 ` 16 “ 29 X (7) Translate the following sentences to formal notation (using predicate symbols and Boolean connectives). Which of these sentences are true; which are false? Briefly justify your answers. (a) The square of each real number is 2. @x P Rpx2 “ 2q (b) Some real numbers have square 2. false Dx P Rpx2 “ 2q true (c) The number x has square 2, for some real number x. Dx P Rpx2 “ 2q (d) If x is a real number, then x2 “ 2. true @x P Rpx2 “ 2q (e) Some real number has square 2. false Dx P Rpx2 “ 2q true (f) There is at least one real number whose square is 2. Dx P Rpx2 “ 2q true (8) Which of the following statements are true and which are false? Briefly justify your answers. (a) @x P Z` , Dy P Z` px “ y ` 1q (b) @x P Z, Dy P Zpx “ y ` 1q (c) Dx P R, @y P R, px “ y ` 1q (d) @x P R` Dy P R` pxy “ 1q. Solution: We’ll translate to words and then evaluate the truth or falsity of the statements. The successor of a number is one plus that number. (a) @x P Z` , Dy P Z` px “ y ` 1q “Every positive integer is the successor of a positive integer.” This is false by the counterexample x “ 1, since 1 is the successor only of 0 and 0 is not a positive integer. (b) @x P Z, Dy P Zpx “ y ` 1q “Every integer is the successor of some integer.” This is true and we prove it by generalization from a generic integer: let x P Z . We WTS there is some integer for which x is the successor, so an example will do. Consider y “ x ´ 1. Then y is an integer because Z is closed under subtraction. Moreover, y ` 1 “ px ´ 1q ` 1 “ x so x is the successor of y, as required. 5 (c) Dx P R, @y P R, px “ y ` 1q “There is a real number which is the successor of all reals.” This is false. We will prove its negation: @x P RDy P Rpx ‰ y ` 1q. To prove this, consider an arbitrary real number x. We WTS there is some y for which x is not the successor of y. An example is enough: consider y “ x. Then y`1 “ x`1 ‰ x so x is not the successor of y. (d) @x P R` Dy P R` pxy “ 1q. “Every positive real number is the reciprocal of some positive real number.” This is true, and we prove it by generalization from a generic positive real number. Let x be a positive real. We WTS there is a positive real y such that xy “ 1. To do this, we need only find an example y. So consider y “ x1 . This is a real number (because x ‰ 0) and real numbers are closed under division by nonzeros. Moreover, xy “ x x1 “ 1, as required. (9) (CSE20 Exam Sp’ 13) For each of the following statements is it true or false? Briefly justify your answers. (a) The words “necessary” and “sufficient” mean the same thing. False - they give us converse implications. (b) The power set of a finite set always has more elements than the set itself. True - the power set of a set with n elements has 2n elements and 2n ą n. ř (c) 3i“0 2i “ 14 ř False - 3i“0 2i “ 20 ` 21 ` 22 ` 23 “ 1 ` 2 ` 4 ` 8 “ 15 ‰ 14. (d) Every antisymmetric relation is not symmetric. False - consider the relation xRy if and only if x “ y on S “ N. Then R is both symmetric and antisymmetric. (e) Every transitive binary relation is reflexive. False - consider the empty relation on the set S “ t1u. Then it’s transitive (because the implications in the definition of transitivity are vacuously true) but it’s not reflexive (because „ 1R1). (10) (CSE 20 Exam Sp’ 13) Consider the proposition p p _ q _ rq ^ p p _ q _ rq ^ p p _ q _ rq ^ pp _ q _ rq ^ pp _ q _ rq (a) Is this proposition in CNF or DNF or neither? (b) Fill in the truth-table for this proposition. p q T T T T T F T F F T F T F F F F CNF Hint: Don’t use a step-by-step truth table. r output T T F F T F F F T T F T T F F F 6 The CNF clauses correspond to rows in the table with output 0. In this case, rows 1, 1, 0 and 1, 0, 1 and 1, 0, 0 and 0, 0, 1 and 0, 0, 0 (11) (CSE 20 Exam Sp’ 13) (a) Convert 11011 from two’s complement binary to decimal. Solution: We flip the bits and add 1 to get to unsigned binary 001002 ` 1 “ 001012 “ 5 So the original two’s complement number was ´5. Alternatively, we can use the definition of 5-bit two’s complement : 25 ´ p24 ` 23 ` 21 ` 20 q “ 32 ´ 16 ´ 8 ´ 2 ´ 1 “ 5 so 11011 has as its negative the number 5; so it itself represents ´5. Yet another option is to use the formula for conversion directly: ´24 ` 23 ` 21 ` 20 “ ´16 ` 8 ` 2 ` 1 “ ´5 (b) What’s the largest number (in decimal) that can be represented using two hexadecimal symbols: 0x ? Solution: The largest number is 0xF F which has decimal value 15¨16`15 “ 162 ´1 “ 255 (12) Write the negations of each of the following statements. Bring the negation “as far in” as possible. (a) p ^ pq Ñ rq (b) @xDyP pxq Solution: (a) „ pp ^ pq Ñ rqq “„ p_ „ pq Ñ rq “„ p _ pq^ „ rq (b) „ @xDyP pxq “ Dx „ DyP pxq “ Dx@y „ P pxq (13) Compute 20132013 %3 Solution: We can “bring the mod in” and compute p2013%3q2013 %3 “ 02 013%3 “ 0%3 “ 0. (14) Use the Euclidean algorithm to hand calculate the greatest common divisors of each of the following pairs of integers 7 (a) 1188 and 385 1188 “ 3p385q ` 33 385 “ 11p33q ` 22 33 “ 1p22q ` 11 22 “ 2p11q ` 0 Thus, gcdp1188, 385q “ 11. (b) 509 and 1177. 1177 “ 2p509q ` 159 509 “ 3p159q ` 32 159 “ 5p32q ` 3 32 “ 10p3q ` 2 3 “ 1p2q ` 1 Thus, gcdp509, 1177q “ 1. (15) For each of the following statements, prove it if it is true and find a counterexample if it is false. Assume all sets are subsets of a universal set U . (a) For all sets A, B, C, A ´ pB ´ Cq “ pA ´ Bq ´ C (b) For all sets A, B if Ac Ď B then A Y B “ U . (c) For all sets A, B, if A Ď B then PpAq Ď PpBq. Solution: (a) For all sets A, B, C, A ´ pB ´ Cq “ pA ´ Bq ´ C. False: consider a counter example A “ t1, 2, 3u, B “ t1u, C “ t1, 2u. Then LHS “ A ´ pB ´ Cq “ t1, 2, 3u ´ pt1, 2u ´ t2uq “ t1, 2, 3u ´ t1u “ t2, 3u RHS “ pA ´ Bq ´ C “ pt1, 2, 3u ´ t1uq ´ t1, 2u “ t2, 3u ´ t1, 2u “ t3u. LHS ‰ RHS. (b) For all sets A, B if Ac Ď B then A Y B “ U . True: consider arbitrary sets A, B. We WTS that if Ac Ď B then AYB “ U . Towards a direct proof, assume Ac Ď B. It remains to show that A Y B “ U . Namely, we need to show that every element in the universe is either in A or in B (or both). (c) For all sets A, B, if A Ď B then PpAq Ď PpBq. True: consider arbitrary sets A, B. We WTS that if A Ď B then PpAq Ď PpBq. Towards a direct proof, assume A Ď B. We now work to show PpAq Ď PpBq. By definition of subset, consider an arbitrary element X P PpAq and need to show that X P PpBq. By definition of power set, X Ď A. So every element in X is an element of A. But, A Ď B so every element in X is an element of B as well. Thus, X Ď B and hence X P PpBq, as required. (16) Consider the set S “ ta, b, c, du. Define a relation R on S that has each of the following combination of properties. 8 Solution: Many examples are possible. Here are a few. (a) Reflexive, symmetric, transitive (i.e. an equivalence relation) R, the equivalence relation associated with the partition tta, bu, tcu, tduu As a set of pairs, R is tpa, aq, pb, bq, pc, cq, pd, dq, pa, bq, pb, aqu (b) Reflexive, anti-symmetric, transitive (i.e. a partial order) tpa, aq, pb, bq, pc, cq, pd, dq, pa, bq, pa, cq, pa, dqu (c) Functional tpa, aq, pb, aq, pc, dq, pd, cqu (d) Symmetric but not transitive. tpa, bq, pb, aqu (17) Suppose a1 , a2 , . . . is a sequence of integers defined recursively by a1 “ 1 a2 “ 3 ak “ ak´2 ` 2ak´1 for integers k ě 3 Prove that an is odd for all integers n ě 1. Solution: We proceed by induction on n. ‚ (Base case, n “ 1) WTS a1 is odd. – By definition, a1 “ 1. This is an odd number (we can write it as 2 ¨ 0 ` 1 and 0 P Z), as required. ‚ (Induction step) Let n ą 1 be an integer. We assume (as the induction hypothesis), that for each integer k between 1 and n ´ 1 (inclusive), that ak is odd. – Case 1 (n “ 2): By definition a2 “ 3, an odd number because 3 “ 2 ¨ 1 ` 1 and 1 P Z. – Case 2 (n ą 2): By definition an “ an´2 ` 2an´1 By the induction hypothesis, each of an´2 and an´1 is odd. That is, there are integers k2 , k1 such that an´2 “ 2k2 ` 1 an´1 “ 2k1 ` 1. Plugging in: an “ p2k2 ` 1q ` 2p2k1 ` 1q “ 2pk2 ` 2k1 ` 1q ` 1. Since Z is closed under addition and multiplication, k2 ` 2k1 ` 1 P Z and we have shown that an “ 2C ` 1 for C “ k2 ` 2k1 ` 1 P Z. Hence, it’s odd. (18) Suppose a1 , a2 , . . . is a sequence of integers defined recursively by a1 “ 1 a2 “ 3 ak “ ak´2 ` ak´1 for integers k ě 3 9 Prove that an ď ` 7 ˘n 4 for all integers n ě 1. Solution: We proceed by induction on n. ‚ (Base case, n “ 1) WTS a1 ď 47 . – LHS “ a1 “ 1 by definition. RHS “ 74 “ 1 43 ą 1 “ LHS, as required. ‚ (Induction step) Let n ą 1 be an integer. We assume (as the induction hypothesis), k that for each integer k between 1 and n ´ 1 (inclusive), that ak ď 74 . 2 1 – Case 1 (n “ 2): LHS “ a2 “ 3 by definition. RHS “ 74 “ 49 “ 3 16 ą3“ 16 LHS, as required. – Case 2 (n ą 2): By definition an “ an´2 ` an´1 By the induction hypothesis, each of an´2 and an´1 is bounded by the appropriate power of 74 . Plugging in: an “ an´2 ` an´1 by Ind Hyp Notice that ď 72 4 “ 49 16 7 n´2 7 n´1 ` 4 4 factoring “ ˆ ˙ 7 n´2 7 7 n´2 1` “ ¨ 3. 4 4 4 ą 3. Thus, an “ an´2 ` an´1 ď f rac74n´2 ¨ 3 ă 7 n´2 7 2 7 n “ , 4 4 4 as required. (19) Prove by induction that for any integer n ě 0 and any real number except 1, n ÿ i“0 ri “ rn`1 ´ 1 r´1 (This is the geometric sequence formula.) Solution: We proceed by induction on ř n. n`1 ‚ (Base case, n “ 0) WTS @r P R‰1 ni“0 ri “ r r´1´1 . – Let r be other than 1. ř a real number 1`1 – WTS 1i“0 ri “ r r´1´1 – LHS “ r0 ` r1 “ 1 ` r. 2 ´1 factoring pr`1qpr´1q – RHS “ rr´1 “ “ r ` 1 “ LHS X. r´1 ‚ (Induction step) Let n ą 0 be an integer. We assume (as the induction hypothesis), that for each integer k between 1 and n ´ 1 (inclusive), that (for every non-one real number), the identity holds. – Let r be a real number other than 1. 10 – We WTS that LHS “ řn n ÿ i“0 ri “ ri “ i“0 n´1 ÿ rn`1 ´1 . r´1 ri ` rn i“0 n prn ´ 1q ` rn pr ´ 1q by ind hyp r ´ 1 “ ` rn “ r´1 r´1 n n`1 n n`1 r ´1`r ´r r ´1 “ “ r´1 r´1 (20) (CSE20 Exam Sp’12) Consider the following identity for any positive integer n: npn ´ 1qpn ` 1q . 3 ř ś (a) Write the left-hand-side of the identity using or notation (you need to decide which one is appropriate). (b) Prove the identity using induction on n. Solution: note- the original posted version of thisřquestion ś had a typo (a) Write the left-hand-side of the identity using or notation (you need to decide which one is appropriate). 1 ˆ 2 ` 2 ˆ 3 ` ¨ ¨ ¨ ` pn ´ 1q ˆ n “ n ÿ pi ´ 1q ˆ i. i“2 (b) Prove the identity using induction on n. Solution: We proceed by induction on n. ‚ (Base case, n “ 2) WTS 1 ˆ 2 “ 2p2´1qp2`1q 3 – LHS “ 2. – RHS “ 2¨1¨3 “ 2 “ LHS X. 3 ‚ (Induction step) Let n ą 2 be an integer. We assume (as the induction hypothesis), that for each integer k between 1 and n ´ 1 (inclusive), that 1 ˆ 2 ` 2 ˆ 3 ` ¨ ¨ ¨ ` pk ´ 1q ˆ k “ kpk ´ 1qpk ` 1q . 3 We WTS that 1 ˆ 2 ` 2 ˆ 3 ` ¨ ¨ ¨ ` pn ´ 1q ˆ n “ npn ´ 1qpn ` 1q . 3 LHS “ 1 ˆ 2 ` 2 ˆ 3 ` ¨ ¨ ¨ ` pn ´ 2q ˆ n ` pn ´ 1q ˆ n pn ´ 1qrpn ´ 1q ´ 1srpn ´ 1q ` 1s ` pn ´ 1q ˆ n 3 pn ´ 1qpn ´ 2qn pn ´ 1qpn ´ 2qn ` 3npn ´ 1q “ ` pn ´ 1qn “ 3 3 npn ´ 1qpn ` 1q factoring npn ´ 1qpn ´ 2 ` 3q “ “ “ RHSX 3 3 Ind Hyp with k “ n ´ 1 “ (21) (CSE20 Exam Sp’12) Prove by induction that any postage of at least 8 cents can be obtained using 3 cents and 5 cents stamps. 11 Solution: Formally we are working towards the statement @n P Ně8 Da P NDb P Npn “ 3a ` 5bq, where the variable a counts the (possibly zero) number of 3 cent stamps and the variable b counts the (possibly zero) number of 5 cent stamps. We proceed by induction on n ě 8. ‚ (Base case, n “ 8) WTS Da P NDb P Np8 “ 3a ` 5bq. – One example is enough to prove an existential statement so it’s enough to choose appropriate values of a, b: consider a “ 1 “ b. Then 8 “ 3`5 “ 3a`5b, as required. ‚ (Induction step) Let n ą 8 be an integer. We assume (as the induction hypothesis), that for each integer k between 1 and n ´ 1 (inclusive), that Dak P NDbk P Npk “ 3a ` 5bq (where we renamed the variables to remember that different choices work for different k values). We WTS that Da P NDb P Npk “ 3a ` 5bq By the induction hypothesis (with k “ n ´ 1), we assume that there are positive numbers an´1 and bn´1 such that n ´ 1 “ 3an´1 ` 5bn´1 . Notice that we can express 1 “ 2 ¨ 3 ` p´1q5 or 1 “ 2p5q ` p´3q3. So, if an´1 ě 3 then we can add 1 to the postage by removing three 3-cent stamps and adding two 5-cent stamps. Also, if bn´1 ě 1 then we can add 1 to the postage by removing one 5-cent stamps and adding two 3-cent stamps. So, we split into cases based on these possibilities. – Case 1 – assume an´1 ě 3: In this case, we choose an “ an´1 ´ 3 bn “ bn´1 ` 2. Then these are both natural numbers (by the case assumption). Moreover, 3an ` 5bn “ 3pan´1 ´ 3q ` 5pbn´1 ` 2q “ 3an´1 ´ 9 ` 5bn´1 ` 10 “ p3an´1 ` 5bn´1 q ` 1 Ind Hyp “ pn ´ 1q ` 1 “ nX – Case 2 – assume an´1 ă 3 and bn´1 ě 1: In this case, we choose an “ an´1 ` 2 bn “ bn´1 ´ 1. Then these are both natural numbers (by the case assumption). Moreover, 3an ` 5bn “ 3pan´1 ` 2q ` 5pbn´1 ´ 1q “ 3an´1 ` 6 ` 5bn´1 ´ 5 “ p3an´1 ` 5bn´1 q ` 1 Ind Hyp “ pn ´ 1q ` 1 “ nX 12 – Case 3 – assume we’re in neither of the other cases: That means that an´1 ă 3 and bn´1 ă 1. By definition of an´1 and bn´1 , we see that n ´ 1 “ 3an´1 ` 5bn´1 ă 3 ¨ 3 ` 5 ¨ 1 “ 9 ` 5 “ 14. So, we need to find examples of postage allocation for the case n ´ 1 ă 14, or 9 ă n ă 15. ˚ n “ 9: Can choose a “ 3, b “ 0 so 9 “ 3 ¨ 3 ` 0 ¨ 5 X ˚ n “ 10: Can choose a “ 0, b “ 2 so 10 “ 0 ¨ 3 ` 2 ¨ 5 X ˚ n “ 11: Can choose a “ 2, b “ 1 so 11 “ 2 ¨ 3 ` 1 ¨ 5 X ˚ n “ 12: Can choose a “ 4, b “ 0 so 12 “ 4 ¨ 3 ` 0 ¨ 5 X ˚ n “ 13: Can choose a “ 3, b “ 0 so 13 “ 1 ¨ 3 ` 2 ¨ 5 X ˚ n “ 14: Can choose a “ 3, b “ 0 so 14 “ 3 ¨ 3 ` 0 ¨ 5 X (22) Prove by induction (on n) that, for every positive integer n and every positive integer b n´1 ÿ ` ˘ pb ´ 1q ¨ bi “ bn ´ 1. i“0 Translate this fact into a general observation about base-b numbers. Solution: Let b P N` be fixed. ř Proof by induction on integers n ě 1. ‚ (Base case n “ 1: WTS 0i“0 ppb ´ 1q ¨ bi q “ b1 ´ 1. – LHS “ pb ´ 1qb0 “ pb ´ 1q1 “ b ´ 1 – RHS “ b1 ´ 1 “ b ´ 1 “ LHSX ‚ (Induction step) Let n ą 1 be an integer. – The induction hypothesis is that for all integers k between 1 and n ´ 1 (inclusive), k´1 ÿ` ˘ pb ´ 1q ¨ bi “ bk ´ 1. i“0 – Consider the summation for n: n´1 ÿ` ÿ` ˘ n´2 ˘ ` ˘ pb ´ 1q ¨ bi “ pb ´ 1q ¨ bi ` pb ´ 1q ¨ bn´1 i“0 i“0 Ind Hyp “ ` ˘ bn´1 ´ 1. ` pb ´ 1q ¨ bn´1 “ bn´1 ´ 1 ` bbn´1 ´ bn´1 “ bn ´ 1X (23) (CSE 20 Exam Sp’ 13) For each of the following statements, write down what the assumption would be in a proof of the statement by contradiction.You do NOT need to prove the statements. Solution: The assumption in a proof by contradiction is the negation of the entire statement. (a) For any integer n, if n2 is even then n is even. Negation: There is an integer n for which n2 is even AND n is not even. Alternatively: There is a non-even integer whose square is even. (b) For each nonzero real number a, there is some real number b such that ab “ 1. Negation: There is a nonzero real number a such that for all real numbers b, ab ‰ 1. 13 (24) Prove the following statements. Make sure to state which proof strategy you are using. (a) There are distinct integers m and n such that m1 ` n1 is an integer. This is an existential statement so an example would prove it to be true. Consider m “ ´1 and n “ 1. These are integers and unequal. Moreover 1 1 1 1 ` “ ` “ ´1 ` 1 “ 0 P Z. m n ´1 1 (b) If n is any even integer then p´1qn “ 1. This is a universal statement: @n P Zpn even Ñ p´1qn “ 1q. so we’ll use generalization from a generic particular. Let n P Z. Assume (in a direct proof of the implication), that n is even. We WTS p´1qn “ 1. By definition of even, there is an integer k such that n “ 2k. Then ` ˘k p´1qn “ p´1q2k “ p´1q2 “ 1k “ 1.X (c) For any rational numbers r and s, 2r ` 3s is rational. This is a universal statement so we’ll use generalization from a generic particular. Let r, s P Q. We WTS 2r ` 3s P Q. By definition of rational, there are a, b, m, n P Z with b ‰ 0 and n ‰ 0 such that a m r“ s“ . b n Plugging this in: a m 2a 3m 2an ` 3mb 2r ` 3s “ 2 ` 3 “ ` “ . b n b n bn The numerator and denominator are both in Z because Z is closed under addition and multiplication. Moreover, the denominator is nonzero because it is a product of nonzero integers. Thus, 2r ` 3s can be expressed as a ratio of integers where the denominator is nonzero; it is rational. X (d) For all integers a, b, c if a|b and a|c then a|pb ` cq. This is a universal statement so we’ll use generalization from a generic particular. Let a, b, c P Z and work towards proving an implication: if a|b and a|c then a|pb ` cq. In a direct proof, we assume that a|b and a|c. We WTS that a|pb ` cq. By definition of divisibility, there are integers j, k such that b “ ak c “ aj. Adding these two equations: b ` c “ ak ` aj “ apk ` jq “ a` where ` P Z because Z is closed under addition. Thus, a|pb ` cq. X (e) For any integer n, npn2 ´ 1qpn ` 2q is divisible by 4. This is a universal statement but it talks about divisibility so cases will be useful. We recall that the set of integers can be partitioned based on remainder mod 4. Let n be an integer. We are in one of four cases: 14 ‚ Case 1 (n%4 “ 0): Then 2 npn ´ 1qpn ` 2q %4 “ rn%4srpn2 ´ 1q%4srpn ` 2q%4s%4 “ 0rpn2 ´ 1q%4srpn ` 2q%4s%4 “ 0%4 “ 0. ‚ Case 2 (n%4 “ 1): Then npn2 ´ 1qpn ` 2q %4 “ rn%4srpn2 ´ 1q%4srpn ` 2q%4s%4 “ 1r0%4sr3%4s%4 “ 0%4 “ 0. ‚ Case 3 (n%4 “ 2): Then npn2 ´ 1qpn ` 2q %4 “ rn%4srpn2 ´ 1q%4srpn ` 2q%4s%4 “ 2r3%4sr4%4s%4 “ 0%4 “ 0. ‚ Case 4 (n%4 “ 3): Then npn2 ´ 1qpn ` 2q %4 “ rn%4srpn2 ´ 1q%4srpn ` 2q%4s%4 “ 3r8%4sr5%4s%4 “ 0%4 “ 0. Since the equality holds in all cases, it is true for every value of n. X (f) For all real numbers x and y, if x is irrational and y is rational then x´y is irrational. By generalizaiton, let x, y P R. Assume, towards a contradiction, that x is irrational, and that y is rational, and that x ´ y is rational. WTS this leads to a contradiction. By definition of rational, there are integers a, b, m, n with b, n ‰ 0 such that a m x“ x´y “ . b n Solving for y, we get an ´ mb a m “ . y “ x ´ px ´ yq “ ´ b n bn This is a fraction whose numerator and denominator are both integers (because integers are closed under products and differences). Moreover, the denominator is a product of nonzeros so it’s not zero. Thus, y P Q. But, we assumed that y is irrational, a contradiction. (g) The reciprocal of any irrational number is irrational. This was done in class.