Solutions for Practice problems on proofs Definition: (even) An integer n Z is even if and only if n = 2m for some number m Z. Definition: (odd) An integer n Z is odd if and only if n = 2m + 1 for some number m Z. Definition: (perfect square) A number n N is a perfect square if and only if n = m 2 for some m N. Definition: (power of 5) A number n N is a power of 5 if and only if n = 5 k for some k N. 1. (a) n, m Z If m and n are odd integers, then m + n is even. Proof: We use a direct proof. Let m, n be odd integers, i.e. m = 2k + 1 and n = 2k + 1 for some integers k, k. Then m+n = 2k +1+2k +1 = 2(k +k +1). Since k, k are integers, so is k + k + 1, which means m + n = 2c for some integer c. Therefore m + n is even. (b) n, m Z If the product of n and m is odd, then both m, n are odd. Proof: We prove the contrapositive of the statement, i.e., we prove that if either m or n is an even integer then the product nm is even. Let m be even (The case in which n is even is identical). That is m = 2c for some integer c. Then mn = 2cn. Since c and n are integers, so is cn, which implies mn is even. Therefore, n, m Z If the product of n and m is odd, then both m, n are odd. (c) n, m N If n and m are powers of 5 then n + m is not a power of 5. For the proof of this statement, we take the following lemma for granted Lemma 1: ( k N)5 k = 2c + 1 for some integer c, i.e. every power of 5 is odd. (One can prove this statement by induction. We leave the proof as an exercise.) Remark : In the exam, we will clearly specify what statements you can take for granted in your proofs. A general rule is that you can assume any fact you saw in high school. Of course the exception is that you cannot take for granted the statement you are asked to prove. Proof of (c): We use a direct proof: Let n and m be powers of 5, it follows from the lemma that n and m are odd integers. By part 1
(a), this implies n + m is even. Since every power of 5 is odd, n + m cannot be a power of 5. Therefore, n, m N If n and m are powers of 5 then n + m is not a power of 5. (d) For all natural numbers n > 0, If n is a perfect square, then n + 1 is not a perfect square. (Note that there was a typo in the original statement of this problem. The statement claims that the implication is true for every natural number n. This is not true because for n = 0, both n and n + 1 are perfect squares.) We take the following lemma for granted. Lemma 2: a, b N, If a 2 > b 2 then a > b. (Ex: Give a proof by contrapositive of this statement.) Proof of (d): We give a direct proof of this implication. Let n > 0 be a perfect square. That is n = m 2 for some m N. Since n + 1 > n, we have n + 1 > n (by lemma 2). i.e., n + 1 > m. Now, consider (m + 1) 2 = m 2 + 2m + 1. Since n > 0, and n = m 2, m must be greater than 0. Which implies (m 2 +2m+1) > (m 2 +1), i.e. (m 2 +2m+1) > (n+1). Written differently, we have (m+1) 2 > n+1, it follows (by lemma 2) that We have shown that m + 1 > n + 1. m + 1 > n + 1 > m. Since m is an integer, n + 1 is not an integer. This tells us that n + 1 is not a perfect square. Therefore, For all natural numbers n > 0, If n is a perfect square, then n + 1 is not a perfect square. (e) n N If n has a rational square root, then the square root of n is in fact a natural number. (You may assume that if a doesn t divide b then a 2 doesn t divide b 2.) Here by square root, we are referring to the non-negative square root. Proof : We give a proof by contradiction. Assume that statement (e) is not true. That is, assume that there is a natural number n such that n is a rational number but not a natural number. By our assumption n = p/q for some natural numbers p and q > 0. Also, n is not a natural number, which implies q doesn t divide p. Since q doesn t divide p, q 2 doesn t divide p 2. This implies n = p 2 /q 2 is not a natural number. This is a contradiction. Which tells us that our assumption was false. Therefore, n N If n has a rational square root, then the square root of n is in fact a natural number. 2
2. (a) Proof: We give a proof by induction. We prove the statement ( n N)P (n) where P (n) is the statement: 1 2 + 2 2 +... n 2 = n(n + 1)(2n + 1)/. Base case: We first look at the base case P (0). Note that in P (0), the left hand side is the empty sum 0, and the right hand side is 0(0 + 1)(2 0 + 1)/ = 0. So, the base case holds. Inductive step: Now we argue that the inductive step is valid. We prove the implication P (k) P (k + 1) for any k using a direct proof. Let k N and assume that P (k) holds, that is, assume that 1 2 + 2 2 +... k 2 = k(k + 1)(2k + 1)/. Consider the sum 1 2 + 2 2 +... k 2 + (k + 1) 2. The sum of the first k terms is k(k + 1)(2k + 1)/ by the induction hypothesis. So, we have 1 2 + 2 2 +... k 2 + (k + 1) 2 = k(k + 1)(2k + 1)/ + (k + 1) 2. k(k+1)(2k+1)/+(k+1) 2 = (k + 1)(2k 2 + 7k + ) k(k + 1)(2k + 1) + (k + 1)2 = (k + 1)(k + 2)(2k + 3). This shows that 1 2 + 2 2 +... k 2 + (k + 1) 2 = (k+1)(k+2)(2k+3), that is P (k + 1) is true. This completes the inductive step. It follows by induction that n N 1 2 + 2 2 +... n 2 = n(n + 1)(2n + 1)/. (b) Proof : We give a proof by induction. We prove the statement ( n 5)P (n) where P (n) is the statement: 2 n > n 2 Base case: We first look at the base case P (5). Note that 2 5 = 32 and 5 2 = 25. Therefore, 2 5 > 5 2. So, the base case holds. Inductive step: Now we argue that the inductive step is valid. We prove the implication P (k) P (k + 1) for any k 5 using a direct proof. Let k 5 and assume that P (k) holds, that is, assume that 2 k > k 2. 2 k+1 = 2 2 k > 2 k 2. The final inequality follows from the induction hypothesis. Now, Since k > 4, we have k 2 > 4 k > 2k + k > 2k + 1. Therefore, 2 k 2 > k 2 + 2k + 1, i.e., 2 k 2 > (k + 1) 2. Which implies, 2 k+1 = 2 2 k > 2 k 2 > (k + 1) 2. That is P (k + 1) is true. This completes the induction step. Therefore by induction n > 4 2 n > n 2. = (k + 1)(k(2k + 1) + (k + 1)) 3
(c) Proof : We give a proof by induction. We prove the statement ( n 3)P (n) where P (n) is the statement: n 2 7n + 12 0. Base case: We first look at the base case P (3). Note that 5 2 7 5 + 12 = 2 > 0. So, the base case holds. Inductive step : Now we argue that the inductive step is valid. We prove the implication P (k) P (k + 1) for any k 3 using a direct proof. Let k 3 and assume that P (k) holds, that is, assume that k 2 7k + 12 0. Consider (k + 1) 2 7(k + 1) + 12. (k + 1) 2 7(k + 1) + 12 = k 2 + 2k + 1 7k 7 + 12 = k 2 5k + = (k 2 7k + 12) + (2k ). By the induction hypothesis (k 2 7k + 12) 0 and since k 3, the second term (2k ) is also non-negative. Thus, (k + 1) 2 7(k + 1) + 12 0 which is P (k + 1). This completes the inductive step. Therefore, n 3 n 2 7n + 12 is non-negative. (d) Which amounts of money can be formed using just two dollar and five dollar bills? Prove your answers using induction. Solution: 2 dollars can be formed, 1 and 3 dollars cannot be formed, and all amounts greater than 3 can be formed. Let s prove the final statement via induction. Lemma 3: ( n 4) n can be expressed as a combination of 2 and 5 dollar bills. Proof of Lemma 3: The proof is by induction. Let P (n) be the statement n = a 2 + b 5 for some a, b N. We want to prove ( n 4)P (n) Base case: We need to argue that P (4) is true. 4 can be written as 2 2 + 0 5. Therefore, P (4) is true. Inductive step: In the induction step we prove that P (k) P (k + 1) holds for any k 4 using a direct proof. Assume that for some k 4, P (k) is true. That is assume k can be written as k = a 2 + b 5 for some a, b N. We now show that P (k + 1) is true using the induction hypothesis. We do so by considering 2 cases: Case 1: b = 0. That is k = a 2 + 0 5. Now, k + 1 = a 2 + 1. So, k + 1 = (a 2) 2 + 4 + 1 = (a 2) 2 + 1 5. Therefore k + 1 can be written as a 2 + b 5 where a = (a 2) and b = 1. Since, k 4 and k = a 2, a must greater than or equal to 2, which implies that (a 2) 0. Thus, a, b are both natural numbers. Therefore, P (k + 1) is true. Case 2: b 1. Now, k + 1 = a 2 + b 5 + 1 (by the induction hypothesis.) 4
So, k + 1 = a 2 + (b 1) 5 + 5 + 1 = a 2 + (b 1) 5 + = (a+3) 2+(b 1) 5. Therefore k+1 can be written as a 2+b 5 where a = (a + 3) and b = (b 1). Since, b 1 and a N, we have b and a are natural numbers. Which implie P (k + 1). Since in both cases P (k + 1) holds, we have that ( k 4)P (k) P (k + 1). This completes the induction step. Therefore, by induction all amounts greater than 3 can be formed as a combination of 2 and 5 dollar bills. (e) Proof : The proof is by strong induction. Let P (n) be the statement: If n is of the form 4k+1 for some integer k, then the second player has a winning strategy; othewise the first player has a winning strategy. We show that ( n 1) P (n). Our base case is P (1). As we argued above, then the first player has a winning strategy, which is consistent with the fact that 1 can be written as 1 = 4 0 + 1. For the strong induction step, we assume that P (m) holds for all integers m in the range 1 m n, and we want to argue that P (n + 1) holds. Let us call the first player for the game with n + 1 sticks Alice, and the second player Bob. We consider four cases. i. Case n+1 is of the form 4k. If Alice picks 3 sticks, Bob then sees 4(k 1) + 1 sticks, so Alice has a winning strategy, consistent with our conjecture P (n + 1). ii. Case n + 1 is of the form 4k + 1. Since n 1, we know that n + 1 5. Alice can then chose to remove 1, 2, or 3 sticks. If she removes one stick, the remaining number of sticks is n = 4k. By the strong induction hypothesis, the player who plays first at this point has a winning strategy. That player is Bob, so Bob has a winning strategy. Similarly, if Alice removes two sticks, the remaining number is 4(k 1) + 3. Again, Bob has a winning strategy, by the same reasoning. Similarly, if Alice removes 3 sticks, Bob has a winning strategy. So, however Alice moves, Bob has a winning strategy for the subsequent rounds. So, Bob has a winning strategy. This proves our conjecture P (n + 1) in this case. iii. Case n + 1 is of the form n + 1 = 4k + 2. If Alice removes 1 stick, Bob is left with 4k + 1, so Alice has a winning strategy, consistent with our conjecture P (n + 1). iv. Case n + 1 is of the form 4k + 3. If Alice picks 2 sticks, Bob is left with 4k +1 sticks, so Alice has a winning strategy, consistent with P (n + 1). So in any case, P (n + 1) holds, so by strong induction we concluce that P (n) holds for all integers n 1. 3. The key observation is that the square of a natural number can be written as a product of an even number of (not necessarily distinct) primes. The quantity on the left hand side is a product of an odd number of primes, while the quantity on the right hand side is a product of an even number of primes. Since every number has a unique prime factorization, the equality cannot hold. This is a contradiction. 5