COMP232 - Mathematics for Computer Science Tutorial 5 Ali Moallemi moa [email protected] Iraj Hedayati h [email protected] Concordia University, Winter 2016 Ali Moallemi, Iraj Hedayati COMP232 - Mathematics for Computer Science 1/9 Table of Contents 1 1.7 Introduction to Proofs Exercise 5 Exercise 10 Exercise 17 Exercise 26 Exercise 31 Exercise 39 Exercise 40 Ali Moallemi, Iraj Hedayati COMP232 - Mathematics for Computer Science 2/9 Exercise 5 Prove that if m + n and n + p are even integers, where m, n, and p are integers, then m + p is even. What kind of proof did you use? Answer: From the book Direct proof: Suppose that m + n and n + p are even. Then m + n = 2s for some integer s and n + p = 2t for some integer t. If we add these, we get m + p + 2n = 2s + 2t. Subtracting 2n from both sides and factoring, we have m + p = 2s + 2t − 2n = 2(s + t − n). Because we have written m + p as 2 times an integer, we conclude that m + p is even. Ali Moallemi, Iraj Hedayati COMP232 - Mathematics for Computer Science 3/9 Exercise 10 Use a direct proof to show that the product of two rational numbers is rational. Answer: Direct proof: Suppose that m and n are rational numbers. Then ∃p, q (m = p p0 ∧ q 6= 0) and ∃p0 , q 0 (n = 0 ∧ q 0 6= 0) q q We can express product of m and n as: mn = p p0 pp0 × 0 = 0 q q qq Considering the fact that product of two integer numbers is also an integer number as well as if q 6= 0 and q 0 6= 0 then qq 0 6= 0, we can conclude that mn is a rational number. Ali Moallemi, Iraj Hedayati COMP232 - Mathematics for Computer Science 4/9 Exercise 17 Show that if n is an integer and n3 + 5 is odd, then n is even using a) a proof by contraposition. Answer: (From the book) Assume that n is odd, so for some integer k, n = 2k + 1. Then n3 + 5 = 2(4k 3 + 6k 2 + 3k + 3) Because n3 + 5 is two times some integer, it is even b) a proof by contradiction. Answer: (From the book) Suppose that n3 + 5 is odd and n is odd. Because n is odd and the product of two odd numbers is odd, it follows that n2 is odd and then that n3 is odd. But then 5 = (n3 + 5) − n3 would have to be even because it is the difference of two odd numbers. Therefore, the supposition that n3 + 5 and n were both odd is wrong Ali Moallemi, Iraj Hedayati COMP232 - Mathematics for Computer Science 5/9 Exercise 26 Prove that if n is a positive integer, then n is even if and only if 7n + 4 is even. Remarks p: n is even q: 7n + 4 is even p↔q Answer: p → q: First, assume that n is even, so that n = 2k for some integer k. Then 7n + 4 = 7(2k) + 4 = 14k + 4 = 2(7k + 2). Hence, 7n + 4 is even. (The method was direct proof) q → p: To prove the converse, suppose that n is odd, so that n = 2k + 1 for some integer k. Then 7n + 4 = 14k + 9 = 2(7k + 4) + 1, so 7n + 4 is odd. (The method was contraposition) Hence, n is even if and only if 7n + 4 is even Ali Moallemi, Iraj Hedayati COMP232 - Mathematics for Computer Science 6/9 Exercise 31 Show that these statements about the integer x are equivalent: (i) 3x + 2 is even (ii) x + 5 is odd (iii) x2 is even Answer: We prove that all these are equivalent to x being even. If x is even, then x = 2k for some integer k. Therefore 3x + 2 = 3 × 2k + 2 = 6k + 2 = 2(3k + 1), which is even Similarly, x + 5 = 2k + 5 = 2k + 4 + 1 = 2(k + 2) + 1, so x + 5 is odd; and x2 = (2k)2 = 2(2k 2 ), so x2 is even. For the converses, we will use a proof by contraposition. So assume that x is not even; thus x is odd and we can write x = 2k + 1 for some integer k. Then 3x + 2 = 3(2k + 1) + 2 = 6k + 5 = 2(3k + 2) + 1, which is odd (i.e., not even). Similarly, x + 5 = 2k + 1 + 5 = 2(k + 3), so x + 5 is even (i.e., not odd). and x2 = (2k + 1)2 = 4k 2 + 4k + 1 = 2(2k 2 + 2k) + 1 concludes x2 is odd. Ali Moallemi, Iraj Hedayati COMP232 - Mathematics for Computer Science 7/9 Exercise 39 Prove that at least one of the real numbers a1 , a2 , . . . , an is greater than or equal to the average of these numbers. What kind of proof did you use? Answer:(From the book) We will give a proof by contradiction. Suppose that a1 , a2 , . . . , an are all less than A, where A is the average of these numbers. Then a1 + a2 + . . . + an < nA. Dividing both sides by n shows that A = (a1 + a2 + . . . + an )/n < A, which is a contradiction Ali Moallemi, Iraj Hedayati COMP232 - Mathematics for Computer Science 8/9 Exercise 40 Use Exercise 39 to show that if the first 10 positive integers are placed around a circle, in any order, there exist three integers in consecutive locations around the circle that have a sum greater than or equal to 17. Answer: Let each a1 , a2 , . . . , a10 be one of the first 10 positive integers in any order and A1 = a1 + a2 + a3 A2 = a2 + a3 + a4 A3 = a3 + a4 + a5 ... A10 = a10 + a1 + a2 . Then, 10 Σ10 i=1 Ai = 3Σi=1 ai = 3 × 55 = 165 The average of Ai -s would be 165 10 = 16.5. Using Exercise 39, some Ai ≥ 16.5. Considering the fact that all ai -s are integer, Ai -s should be also integer. Thus we can conclude that some Ai ≥ 17 Ali Moallemi, Iraj Hedayati COMP232 - Mathematics for Computer Science 9/9
© Copyright 2025 Paperzz