CmSc 175 Discrete Mathematics Lesson 08. Problems on Proofs with sample solutions Direct proof, Proof by Contraposition Choose and apply a method of proof (direct proof, proof by contraposition) to prove the following statements: 1. The sum of any two even integers is even . 2. The sum of any two odd integers is even. 3. The sum of an even and an odd integer is odd. 4. The product of any two odd integers is odd 5. For all integers n, n2 is even if and only if n is even. Note: if and only if means: a) if n2 is even then n is even, b) if n is even then n2 is even 6. For all integers k, k3 is odd if and only if k is odd 7. For all integers n, if n is even then (n-1)(n+1) is odd 8. For all integers n, if (n+1)(n-1) is odd then n is even 9. The square of any integer can be written in one of the following forms: 4k or 4k+1 10. Let n be an odd integer. Then n3 + 2n2 is also odd. 11. Prove that for all integers n, n2 – n is even Hint: use direct proof, consider two cases: n being even and n being odd 12. Prove by direct proof the statement: For all integers m and n, if n – m is even, then n2 – m2 is also even. Definition of even integers: x, even(x) multiple of 2(x), i.e. p, x = 2p x, multiple of 2(x) even(x) multiple of 2(x), i.e. p, x = 2p Definition of odd integers x, odd(x) p, x = 2p – 1 x, ( p, x = 2p – 1) odd(x) 2p: representation of an even integer 2p – 1: representation of an odd integer 1 Sample solutions 1. The sum of any two even integers is even . Let A and B be two arbitrary chosen even integers (1) x, even(x) multiple of 2(x), i.e. p, integer(p) & x = 2p (2) even(A) given in the problem (3) even(B) given in the problem (4) p, integer(p) such that A = 2p by (1), (2) and MP (5) q, integer(q) such that B = 2q by (1), (3) and MP (6) S = A + B = 2p + 2q = 2(p+q) (7) x, multiple of 2(x) even(x) (8) multiple_of_2(S) (9) even(S) by (4), (5), and basic algebra by definition of even numbers by (6) by (7), (8) and MP Shorter version: Let A and B be two even integers. By the definition of even integers, A = 2p, B = 2q, p and q some integers A + B = 2p + 2q = 2(p + q) A + B has the representation of an even integer, therefore A + B is even. 2. The sum of any two odd integers is even. Let A and B be two odd numbers (1) x, odd(x) p, x = 2p – 1 (2) odd(A) given in the problem (3) odd(B) given in the problem (4) p, such that A = 2p–1 by (1), (2) and MP (5) q, such that B = 2q–1 by (1), (3) and MP (6) S = A + B = 2p + 2q –2 = 2(p+q –1) basic algebra (7) x, multiple_of_2(x) even(x) by definition (8) multiple_of_2(S) by (6) (9) even(S) by (7), (8) and MP 2 Shorter version: Let A and B be two odd integers. By the definition of odd integers, A = 2p – 1, B = 2q – 1, p and q some integers A + B = 2p + 2q –2 = 2(p + q –1) A + B has the representation of an even integer, therefore A + B is even. 3. The sum of an even and an odd integer is odd. Let A be an even number, and B be an odd numbers (1) x, even(x) multiple of 2(x), i.e. p, x = 2p (2) even(A) (3) p, such that A = 2p given in the problem by (1), (2) and MP (4) x, odd(x) p, integer(p) & x = 2p – 1 by definition (5) odd(B) (6) q, such that B = 2q – 1 given in the problem by (4), (5) and MP (7) S = A + B = 2p + 2q –1 = 2(p+q) –1 basic algebra (8) The sum of two integers is an integer basic algebra (9) x, x = 2k+1 odd(x) by definition (10) S = 2k + 1, where k = p+q by (7) (11) odd(S) by (9), (10) and MP Shorter version: Let A be an even integer, and B be an odd integer. By the definition of even integers, A = 2p, p some integer By the definition of odd integers, B = 2q – 1 q some integer A + B = 2p + 2q –1 = 2(p + q) –1 A + B has the representation of an odd integer, therefore A + B is odd. 3