Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
CSCI 2824 Spring 2013: Assignment # 4 Due Date: Friday, Feb 22, 2013 Problem 1 (30 points) Evaluate the following expressions (try not to use a calculator :-) Show your working or write a one/two line justification. 1. 1000! mod 10. 2. 2100 mod 100. 3. 340000 mod 16. 4. 2257! mod 256. Solution 1. 1000! mod 10 = 0. Reason: 1000! = 10 × ..... 2. 2100 mod 100 = (1024)10 mod 100 = (2410 ) mod 100 = 5765 mod 100 = 765 mod 100 = 76. 3. 340000 mod 16 = (34 )10000 mod 16 = 8110000 mod 16 = 110000 mod 16 = 1. 4. 2257! mod 256 = 0. Reason: 256 = 28 divides 2257! . Problem 2 (80 points) We have below the statements and attempted proofs of theorems. For each of these (a) is the theorem valid? (b) is the proof valid, if not point out the flaw in the proof? and (c) write down a correct proof if the theorem is valid but the proof invalid. Your proof will be judged for clarity and correctness. Writing lengthy, overly complicated proofs will result in points being deducted. Thm 1: For every integer n, if n is odd, then n2 leaves a remainder of 1 modulo 4. Proof: We check the result for n = 1, 3, 5, 7, 9. Their squares 1, 9, 25, 49, 81 all leave a remainder of 1 modulo 4. Therefore, the theorem looks like it is true. Solution: Theorem is VALID. Proof is INVALID since it is a proof by example. Proof (fixed): Let n be an odd number. We can write n = 2k + 1 for some k ∈ N. Therefore, n2 = (2k + 1)2 = 4k 2 + 4k + 1 = 4l + 1 for l = k 2 + k. We conclude that n2 mod 4 = 1. (QED) Thm 2: For every natural number n, if n is even, then its cube is divisible by 8. Proof: Let n be any given even number. We can write n = 2j for some natural number j. Therefore, n3 = 8j 3 is divisible by 8. Solution: Theorem is VALID. Proof is VALID. Nothing more needs to be done for this problem. Thm 3: If two natural numbers m, n both leave a remainder of 1 when divided by 4, then m − n is divisible by 4. Proof: Let m, n be such that m mod 4 = n mod 4 = 1. Then m = 4j + 1 for some j ∈ N and similarly for n. Therefore (m − n) = (4j + 1) − (4j + 1) = 0, which is divisible by 4. Solution: Theorem is VALID. Proof is INVALID. The letter j is reused in the proof. 1 Proof (fixed): Let m, n be such that m mod 4 = n mod 4 = 1. Then m = 4j + 1 for some j ∈ N and similarly let n = 4k + 1 for some k ∈ N. Therefore (m − n) = (4j + 1) − (4k + 1) = 4(j − k), which is divisible by 4. Thm 4: For any two natural numbers p, q if both p, q are prime then pq + 1 is also prime. Proof: Take any two prime numbers p, q. Normally pq is not prime, obviously because it is divisible by both p and q. But take m = pq + 1. It leaves a remainder of 1 when divided by p and 1 when divided by q. So it has to be prime. Solution: Theorem is INVALID. Take p = 5 and q = 3, we have pq + 1 = 16 is not prime. Proof is INVALID. The last line of the proof “So it has to be prime” does not follow from the last but one line. Just because a number leaves a remainder of 1 with two primes does not make it prime. The example above illustrates. Thm 5: For any prime number p, (p!) + 1 is prime. Proof: Let p be any prime number and let n = p! + 1. We have that for all prime numbers k ranging from 2 to p, n mod k = 1. Therefore, n does not have prime factors between 2 and p. Therefore, n is prime. Solution: Theorem is INVALID. Take p = 5, we have p! + 1 = 121 is composite. Proof is INVALID. The last line does not follow from the last but one line. Just because a number p! + 1 does not have prime factors between 2 and p, we cannot conclude that p! + 1 is prime. The counterexample above illustrates this. Thm 5: For all integers p, q, r, if p2 + q 2 + r2 = 0 then p = q = r = 0. Proof: Let p = q = r = 0. We have p2 + q 2 + r2 = 0 + 0 + 0 = 0. CANCELLED for this assignment. Thm 6: For all integers p, q, if pq = 1 then p = q = 1. Proof: Let p, q be any given integers such that pq = 1. Clearly, p 6= 0 and q 6= 0. We split cases on p. Case -1: p = 1. We immediately have q = 1 since pq = 1. Case -2: p > 1. In this case, we cannot have pq = 1 since q = p1 is not an integer. Therefore, Case-1 is the only case possible and gives us p = q = 1. Solution: The theorem is INVALID. We omit p = q = −1. The proof is INVALID. The case split does not consider all cases. Thm 7: For any natural number n ≥ 4, n2 − 3n + 2 is a composite number. Proof: Let n be any given natural number. We can write m = n2 − 3n + 2 into two factors (n − 2) × (n − 1). This, at once, shows that m cannot be prime. Solution: The theorem is VALID. The proof is INVALID. The proof shows that m = (n − 2) × (n − 1) but it does not show that (n − 2) 6= 1 and (n − 1) 6= 1. Therefore, m is not necessarily a composite number. Proof (fixed): Let n be any given natural number such that n ≥ 4. We can factorize m = n2 − 3n + 2 as m = (n − 2) × (n − 1). Since n ≥ 4, we have n − 2 ≥ 2 and n − 1 ≥ 3. Therefore, combining these facts we have n−2 6= 1 and n−1 6= 1. The factorization shows that m is composite. (QED). 2 Thm 8: For all integers x, y, z and natural numbers p, xp + y p 6= z p . Proof: This is precisely the statement of Fermat’s last theorem that follows from a proof of the modularity theorem for so-called semi-stable elliptic curves proposed by Andrew Wiles in collaboration with Richard Taylor. Solution: Theorem is INVALID. It fails to hold for p = 2 (Pythagorean triples) or x = y = z = 0. These cases must be ruled out before the theorem can be said to hold. Proof is INVALID. It is a proof by authority of a statement that is not that of Fermat’s last theorem. Problem 3 (40 points) Write down the converse and contrapositive for each of the statements of the theorems in problem 2 that are implications. If a theorem’s statement is not an implication, indicate it in your answer. Solution: 1. Converse: For every integer n, if n2 leaves a remainder of 1 modulo 4 then n is odd. Contrapositive For every integer n, if n2 mod 4 6= 1 then n is even. 2. Converse: For every natural number n, If n3 is divisible by 8 then n is even. Contra: For every natural number n, If n3 is not divisible by 8 then n is odd. 3. Converse: For every natural number m, n, If m − n is divisible by 4 then both m, n leave a remainder of 1 modulo 4. Contra: For every natural number m, n, If m − n is not divisible by 4 then m mod 4 6= 1 or n mod 4 6= 1. 4. Converse: For any two natural numbers p, q if pq + 1 is prime then both p and q are prime. Contra: For any two natural numbers p, q if pq + 1 is not prime then p is not prime OR q is not prime. 5. Converse: For any natural number p, If p! + 1 is prime then p is prime. Contra: For any natural number p, If p! + 1 is not prime then p is not prime. 6. Converse: For all integers p, q, if p = q = 1 then pq = 1 Contra: For all integers p, q, if p 6= 1 or q 6= 1 then pq 6= 1. 7. Converse: For all natural numbers n, If n2 − 3n + 2 is a composite number then n ≥ 4. Contrapositive: For all natural numbers n, If n2 − 3n + 2 is not a composite number then n < 4. 8. Not an implication. Problem 4 (50 points) Prove the following results using induction. Write down the form of induction (weak/strong) and clearly state the base case/induction hypothesis. 1. For every natural number n, if n ≥ 5 then n! mod 5 = 0. 3 Proof. Proof is by strong induction on n. Base Case: n = 5. We have n! mod 5 = 120 mod 5 = 0. Ind. Hyp. If for all 5 ≤ m ≤ n, m! mod 5 = 0 then (n + 1)! mod 5 = 0. Proof: We have (n + 1)! mod 5 = n! × (n + 1) mod 5 = ((n! mod 5) × (n + 1 mod 5)) mod 5. But by induction hypothesis, we have n! mod 5 = 0. Therefore, (n + 1)! mod 5 = 0. (QED). Note: The problem above can also be solved using weak induction since we are simply using the induction hypothesis on n when proving for n + 1. 2. Let Fn be the nth Fibonacci number. For every natural number n, F0 + F1 + F2 + · · · + Fn = Fn+2 − 1. Proof. Proof is by weak induction on n. Base Case: n = 0. We have F0 = 1 = F2 − 1 = 2 − 1. Therefore base case is verified. Ind. Hyp. For all n ∈ N, If F0 + · · · + Fn = Fn+2 − 1 then F0 + · · · + Fn+1 = Fn+3 − 1. Proof: We can write F0 + · · · + Fn+1 = = = = F0 + · · · + Fn + Fn+1 (Fn+2 − 1) + Fn+1 (∵ induction hypothesis on n) Fn+1 + Fn+2 − 1 Fn+3 − 1 3. For every natural number n, F02 + F12 + · · · + Fn2 = Fn Fn+1 . Proof. Proof is by strong induction on n. Base Case: n = 0. We have F02 = 1 = F0 F1 = 1 × 1. Therefore base case is verified. 2 =F F 2 2 Ind. Hyp. For all n ∈ N, If for all 0 ≤ m ≤ n, F02 + · · · + Fm m m+1 then F0 + · · · + Fn+1 = Fn+1 Fn+2 . Proof: We can write 2 F02 + · · · + Fn+1 = = = = 2 F02 + · · · + Fn2 + Fn+1 2 (∵ induction hypothesis on n) Fn Fn+1 + Fn+1 Fn+1 (Fn + Fn+1 ) Fn+1 Fn+2 4. For every natural number n ≥ 1, we have 1 1 1 n(n+1) = n − n+1 ). Pn 1 j=1 j(j+1) = 1− 1 n+1 . (Hint: You can write Proof. Proof is by weak induction on n. Base Case: n = 1. We have LHS = 21 = 1 − 21 = RHS. This is verified. P Pn+1 1 1 1 Ind. Hyp. For all n ∈ N, If nj=1 j(j+1) = 1 − n+1 then j=1 j(j+1) = 1 − 4 1 n+2 Proof: We can write Pn+1 1 j=1 j(j+1) = = = = = Pn 1 1 1 1 1 1 j=1 j(j+1) + (n+1)(n+2) 1 1 − n+1 + (n+1)(n+2) (∵ 1 n+2−1 − n+1 ( n+2 ) 1 n+1 − n+1 n+2 1 − n+2 5 induction hypothesis for n)