SOLUTIONS TO HOMEWORK 2 - MATH 170, SUMMER SESSION I ...

167 downloads 35 Views 123KB Size Report
(1) (Exercise 11, Page 107) Which of the following is the correct UPC for Progresso ... But the check digit here is 2, and 2 + 2 mod 10 = 4 = 0. So, this is not a ...

SOLUTIONS TO HOMEWORK 2 - MATH 170, SUMMER SESSION I (2012)

(1) (Exercise 11, Page 107) Which of the following is the correct UPC for Progresso minestrone soup? Show why the other numbers are not valid UPC’s. 0 41196 01012 1 0 52010 00121 2 0 05055 00505 3 Note: UPC stands for Universal Product Code, which is basically the product bar codes we had been discussing in lectures. Solution : For the first one, without the check digit, 3 · 0 + 4 + 3 · 1 + 1 + 3 · 9 + 6 + 3 · 0 + 1 + 3 · 0 + 1 + 3 · 2 mod 10 = 4 + 3 + 1 + 27 + 6 + 1 + 1 + 6 mod 10 = 49 mod 10 = 9. Clearly the check digit, 1, adds up to 9 to give 0 mod 10. Hence, this is a UPC indeed. For the second one, without the check digit, 3 · 0 + 5 + 3 · 2 + 0 + 3 · 1 + 0 + 3 · 0 + 0 + 3 · 1 + 2 + 3 · 1 mod 10 = 5 + 6 + 3 + 3 + 2 + 3 mod 10 = 22 mod 10 = 2. But the check digit here is 2, and 2 + 2 mod 10 = 4 6= 0. So, this is not a UPC. For the third one, without the check digit, 3 · 0 + 0 + 3 · 5 + 0 + 3 · 5 + 5 + 3 · 0 + 0 + 3 · 5 + 0 + 3 · 5 mod 10 = 15 + 15 + 5 + 15 + 15 mod 10 = 5

mod 10.

But the check digit is 3, and 5 + 3 mod 10 = 8 6= 0 So, this is not a UPC.

(2) (Exercise 13, Page 107) The following is the UPC for Hellman’s 8 oz. Real Mayonnaise. Find the missing digit. 0 48001 26 04 2 1

2

SOLUTIONS TO HOMEWORK 2 - MATH 170, SUMMER SESSION I (2012)

Solution : Let us call this missing digit x. Then, without the check digit, 3 · 0 + 4 + 3 · 8 + 0 + 3 · 0 + 1 + 3 · 2 + 6 + 3x + 0 + 3 · 4 mod 10 = 4 + 24 + 1 + 6 + 6 + 3x + 12 mod 10 = 53 + 3x mod 10 = 3 + 3x mod 10. Now, we must have that, 3 + 3x + 2 mod 10 = 0, i.e., 5 + 3x mod 10 = 0. This is possible only if x = 5 which gives us the missing digit.

(3) A bank identification number is a 9 digit number that occurs in the lower left hand corner of bank checks. Let the digits be n1 , n2 , n3 , n4 , n5 , n6 , n7 , n8 , n9 . For a 9 digit number to be a valid bank identification number, it must satisfy 7n1 + 3n2 + 9n3 + 7n4 + 3n5 + 9n6 + 7n7 + 3n8 + 9n9 ≡ 0

mod 10.

(Exercise 21, Page 108) Determine the check digits (i.e. last digits) of the following bank codes: 3 1 0 6 1 4 8 3 0 2 5 7 1 1 0 8 Solution : Let us call the check digit c. In the first code, we need, 7 · 3 + 3 · 1 + 9 · 0 + 7 · 6 + 3 · 1 + 9 · 4 + 7 · 8 + 3 · 3 + 9c ≡ 0 =⇒ 21 + 3 + 0 + 42 + 3 + 36 + 56 + 9 + 9c ≡ 0 =⇒ 0 + 9c ≡ 0 mod 10.

mod 10. mod 10.

So, the digit c needed to make 9c ≡ 0 mod 10 is 0. So, in the first code, the check digit is 0. In the second code, we need, 7 · 0 + 3 · 2 + 9 · 5 + 7 · 7 + 3 · 1 + 9 · 1 + 7 · 0 + 3 · 8 + 9c ≡ 0 mod 10. =⇒ 0 + 6 + 45 + 49 + 3 + 9 + 0 + 24 + 9c ≡ 0 mod 10. =⇒ 6 + 9c ≡ 0 mod 10. Now, the digit c needed to make 6 + 9c ≡ 0 mod 10 is 6. So, in the second code, the check digit is 6. (4) Show that the following statements are true: (a) 547 ≡ 6 × 17 mod 23. Solution : By Fermat’s Little Theorem, 523−1 ≡ 1 mod 23. That is, 522 ≡ 1 mod 23. We can now square both sides to get, 544 ≡ 1 mod 23. Multiplying both sides by 53 , we get, 544+3 ≡ 53 mod 23. That is, 547 ≡ 125 mod 23. Now, 125 = 115 + 10 = 3 × 23 + 10. So, 125 mod 23 is 10. Therefore, 547 mod 23 = 10.

SOLUTIONS TO HOMEWORK 2 - MATH 170, SUMMER SESSION I (2012)

3

Next, 6 × 17 = 102 = 92 + 10 = 23 × 4 + 10 and so, 6 × 17 mod 23 = 10. Thus, 547 ≡ 6 × 17 mod 23. (b) 42 × 33 ≡ 251 mod 13. Solution : By Fermat’s Little Theorem, 213−1 ≡ 1 mod 13, that is, 212 ≡ 1 mod 13. Taking a power of 4, 248 ≡ 1 mod 13. So, multiplying by 23 = 8 on both sides, 251 ≡ 8 mod 13. That is, 251 mod 13 = 8. Next, 42 × 33 mod 13 = 16 × 33 mod 13 = (13 + 3) × (26 + 7) mod 13 = 3 × 7 mod 13 = 21 mod 13 = 8. Thus, 42 × 33 ≡ 251 mod 13. (5) Carefully look at the following mathematical reasoning. Write down what is wrong with it. I believe that 6832 ≡ 1 mod 17. This is because, Fermat’s theorem says that if p is prime, ap−1 ≡ 1 mod p, and since 17 is a prime with 17 − 1 = 16, we must have, 6816 ≡ 1 mod 17. Taking a power of 2 on both sides of the congruence, we get, 6832 ≡ 1 mod 17. After you have answered what is the mistake above, write down the correct number between 0 and 16 that is 6832 mod 17. Solution : Fermat’s little theorem says that if p is prime and a is an integer N OT DIV ISIBLEBY p, then, ap−1 ≡ 1 mod p. Although, 17 is prime here, 68 is indeed divisible by 17 (17 × 4 = 68), and so Fermat’s Little Theorem does not apply here. The correct answer should be 6832 mod 17 = 0. This is because, as 17 divides 68, 17 will divide any power of 68, and so, 17 divides 6832 . (6) Prove the following statements using the principle of induction: (a) 1 + 3 + 5 + ... + (2n − 1) = n2 , for all natural numbers n. Solution : The statement S(n) is “1 + 3 + 5 + ... + (2n − 1) = n2 ”. Step 1: We check if this is true for n = 1. The left hand side is just 1, and the right hand side is 12 and hence is 1. So, S(1) is true. Step 2: We assume S(m) is true. That is, we assume, 1+3+...+(2m−1) = m2 . Step 3: Now we need to prove that S(m + 1) is true. That is, we need

4

SOLUTIONS TO HOMEWORK 2 - MATH 170, SUMMER SESSION I (2012)

to prove that 1 + 3 + ... + (2(m + 1) − 1) = (m + 1)2 . The left hand side is 1+3+...+(2m+1) = 1+3+5+...+(2m−1)+(2m+1) = m2 +2m+1 (from Step 2). But, m2 +2m+1 = (m+1)2 . Therefore, 1+3+...+(2(m+1)−1) = (m+1)2 , which completes our induction steps. Hence, by induction, the statement 1 + 3 + 5 + ... + (2n − 1) = n2 is true for all natural numbers n. (b) 32n−1 + 2n+1 is divisible by 7, for all natural numbers n. Solution : The statement S(n) is “32n−1 + 2n+1 is divisible by 7”. Step 1: We check if this is true for n = 1. 32×1−1 + 21+1 = 3 + 22 = 3 + 4 = 7, which of course is divisible by 7. So, S(1) is true. Step 2: We assume S(m) is true. That is, we assume, 32m−1 + 2m+1 is divisible by 7. So, there is an integer k for which, 32m−1 + 2m+1 = 7k. Then, 2m+1 = 7k − 32m−1 . Step 3: Now we need to prove that S(m + 1) is true. That is, we need to prove that 32(m+1)−1 + 2(m+1)+1 is divisible by 7. Now, 32(m+1)−1 + 2(m+1)+1 = 32m+1 + 2m+1 · 2 = 32m+1 + (7k − 32m−1 ) · 2, (from Step 2) = 14k + 32m+1 − 2 · 32m−1 , = 14k + 32m−1+2 − 2 · 32m−1 , = 14k + 32m−1 (32 − 2) = 14k + 32m−1 · 7, which, of course, is divisible by 7. This completes our induction steps. Hence, by induction, 32n−1 + 2n+1 is divisible by 7, for all natural numbers n. (c) Let Fn denote the nth Fibonacci number (so, F1 = 1, F2 = 1, F3 = 2, F4 = 3 and so on). Show that F12 + F22 + ... + Fn2 = Fn · Fn+1 , for all natural numbers n. Solution : The statement S(n) is “F12 + F22 + ... + Fn2 = Fn · Fn+1 ”. Step 1: We check if this is true for n = 1. The left hand side F12 , which is just 1, and the right hand side is F1 · F2 = 1 · 1 = 1. So, S(1) is true.

SOLUTIONS TO HOMEWORK 2 - MATH 170, SUMMER SESSION I (2012)

5

2 = Step 2: We assume S(m) is true. That is, we assume, F12 + F22 + ... + Fm Fm · Fm+1 .

Step 3: Now we need to prove that S(m + 1) is true. That is, we need 2 to prove that F12 + F22 + ... + Fm+1 = Fm+1 · Fm+2 . The left hand side is 2 2 2 2 2 F1 + F2 + ... + Fm + Fm+1 = Fm · Fm+1 + Fm+1 = Fm+1 (Fm + Fm+1 ). Now, because Fn is the nth Fibonacci number, Fm + Fm+1 = Fm+2 . Therefore, 2 F12 + F22 + ... + Fm+1 = Fm+1 · Fm+2 , which completes our induction steps. Hence, by induction, the statement F12 + F22 + ... + Fn2 = Fn · Fn+1 is true for all natural numbers n. (7) Prove the following statements using the method of contradiction: (a) The negative of an irrational number is irrational. Solution : Let x be an irrational number. Assume that −x is rational. So, we can write −x as pq where p, q are integers with q 6= 0. Thus, −x =

p q

=⇒ x = −

p −p = . q q

Since −p and q are still integers, with q 6= 0, x is a rational number, which is a contradiction. Hence, the negative of an irrational number is irrational. (b) There are no even primes that are bigger than 2. Solution : Suppose there are even primes bigger than 2. Let p be one such prime. Since p is even, this means that we can write p = 2k for some natural number k > 1. But, this implies that both 2 and k divide p, which is a contradiction, since p is prime. Hence, there are no even primes that are bigger than 2. (c)



6 is irrational. √ Solution : Assume 6 is rational. Then we can write, √ p 6= , q where p and q are integers that have no common factors, and q 6= 0. Squaring both sides, p2 , q2 6q 2 = p2 . 6=

6

SOLUTIONS TO HOMEWORK 2 - MATH 170, SUMMER SESSION I (2012)

Thus, 6 divides p2 . This means that both 2 and 3 divide p2 . Now, from what we did in class, 2 divides p2 means 2 divides p and 3 divides p2 means 3 divides p. That is, both 2 and 3 divide p, which gives us that 6 divides p. So, we can write p = 6k, for some k. Then, plugging this in the previous equation we get, 6q 2 = (6k)2 = 36k 2 , =⇒ q 2 = 6k 2 .

So, 6 divides q 2 . By the same reasoning as before, this means that 6 divides q. Therefore √ p and q have a common factor 6, which is a contradiction. Therefore, 6 is irrational. (d)

√ 2 + 3 is irrational. √ √ Solution : Assume 2 + 3 is rational. Then we can write,





2+



p 3= , q

where p and q are integers that have no common factors, and q 6= 0. Squaring both sides, √ √ √ √ p2 ( 2 + 3 · ( 2 + 3) = 2 , q √ p2 =⇒ 2 + 3 + 2 6 = 2 , q √ 2 2 =⇒ 5q + 2q 6 = p2 , √ p2 − 5q 2 =⇒ 6 = . 2q 2 The right hand side above is clearly a rational number, with the numerator and denominator both being integers and √ the denominator being non-zero. Therefore, the above expression shows that 6 is a rational number, which is a contradiction by what we proved in part (c) of this problem. (8) Let A and B be two sets. Draw Venn diagrams and shade the regions for the following set expressions:

SOLUTIONS TO HOMEWORK 2 - MATH 170, SUMMER SESSION I (2012)

(a) (A − B)c . Solution : The shaded area is the required region.

(b) (A4B) − A. Solution : The area shaded in dark grey is the required region.

7