Math 236: Discrete Mathematics with Applications Tutorial 2: 23 February 2012 1. Determine which of the following pairs of integers are relatively prime (give reasons for your answers): (a) 14 and 42 (b) 33 and 18 (c) 45 and 108 (d) 24 and 2039, given that 2039 is a prime number (a) Note that 14 = 2 7 and 42 = 2 3 7. Thus, 2 14 and 2 42, gcd(14, 42) 2 1. Hence 14 and 42 are not relatively prime. (b) Similarly to (a.), 3 33 and 3 18. Thus, gcd(33, 18) 3 1. Hence 33 and 18 are not relatively prime. (c) Note that 45 = 3 3 5 and 108 = 2 2 3 3 3. Thus, gcd(45, 108) = 6 1. Hence, 45 and 108 are not relatively prime. (d) We are told that 2039 is a prime number. Thus, the only positive divisors of 2039 are 1 and 2039. Therefore, the only divisor of 24 which is also a divisor of 2039 is 1. Hence, gcd(24, 2039) = 1 and 24 and 2039 are relatively prime. 2. Let R be a relation dened on Z by arb if gcd(a, b) = 1. Determine, with justication, whether R is: (i) reexive, (ii) symmetric, (iii) transitive In this case, R is not reexive. We prove this by giving the following counter-example: 2 Z and gcd(2, 2) = 2. Thus, 2 R 2. Let x, y Z. To prove that R is symmetric, we assume that xry and we must show that yrx. By our assumption that xry, it follows that gcd(x, y) = 1. Thus, the greatest common divisor of x and y is 1. But this means that the greatest common divisor of y and x is 1. Hence, gcd(y, x) = 1. Thus, yrx. In this case, R is not transitive. We prove this by giving the following counter-example: 2, 3, 4 Z and 2R3 and 3R4. But, 2 R 4. 3. Use the Division Algorithm to nd the following: (a) gcd(8, 21) (b) gcd(331, 1324) (c) gcd(67942, 4209) (a) Applying the Division algorithm: 0 21 8 5 21 = 2 8 + 5 1 8 5 3 8 = 5 + 3 2 5 3 2 5 = 3 + 2 3 3 2 1 3 = 2 + 1 4 2 1 0 2 = 2 1 + 0
Thus, gcd(8, 21) = 1 (b) Applying the Division algorithm: Thus, gcd(1324, 331) = 331 (c) Applying the Division algorithm: Thus, gcd(67942, 4209) = 23 0 1324 331 0 1324 = 4 331 + 0 0 67942 4209 598 67942 = 16 4209 + 598 1 4209 598 23 4209 = 7 598 + 23 2 598 23 0 598 = 26 23 + 0 4. For each pair a, b of integers in the previous question, use the Extended Division Algorithm to nd integers s, t such that gcd(a, b) = sa + tb (a) From the previous question we get: gcd(8, 21) = 1 = 3 2 = 3 (5 3) = 2 3 5 = 2(8 5) 5 = 2 8 3 5 = 2 8 3(21 2 8) = 8 8 3 21 Therefore, s = 8 and t = 3 (b) From the previous question we get that gcd(1324, 331) = 331. Therefore, s = 0 and t = 1 (c) From the previous question we get: gcd(67942, 4209) = 23 = 4209 7 598 = 4209 7(67942 16 4209) = 7 67942 + 113 4209 Therefore, s = 7 and t = 113 5. Find, where possible, each of the following: (a) 8 1 Z 21 (b) 331 1 Z 1324 (c) 4209 1 Z 67942 (d) 337 1 Z 490256 (e) 110 1 Z 273
Hint: Make use of questions 3 and 4, where applicable (a) From (3.a) and (4.a), gcd(8, 21) = 1 = 8 8 3 21. Thus, 8 1 exists in Z 21 and 8 1 = 8. (b) From (3.b), gcd(1324, 331) = 331. Thus, 331 1 does not exist in Z 1324. (c) From (3.c), gcd(67942, 4209) = 23. Thus, 4209 1 does not exist in Z 67942. (d) Applying the Division algorithm: 0 490256 337 258 490256 = 1454 337 + 258 1 337 258 79 337 = 258 + 79 2 258 79 21 258 = 3 79 + 21 3 79 21 16 79 = 3 21 + 16 4 21 16 5 21 = 16 + 5 5 16 5 1 16 = 3 5 + 1 Thus, gcd(490256, 337) = 1. So, 337 1 exists in Z 490256. Applying the Extended Division Algorithm, Thus, 337 1 = 93105 in Z 490256. 1 = 16 3 5 = 16 3(21 16) = 3 21 + 4 16 = 3 21 + 4(79 3 21) = 4 79 15 21 = 4 79 15(258 3 79) = 15 258 + 49 79 = 15 258 + 49(337 258) = 49 337 64 258 = 49 337 64(490256 1454 337) = 64 490256 + 93105 337 6. Let a and b be relatively prime integers. Assume that a c and b c, where c is an integer. Prove that (ab) c Since a and b are relatively prime, gcd(a, b) = 1. Thus, there exist integers s and t such that Multiplying this equation by c, we get that 1 = sa + tb. (1) c = sac + tbc. (2) By the assumption that a c and b c, it follows that there exist integers u and v such that c = ua and c = vb. This allows us to rewrite equation 2 as follows: Since sv + tu Z, ab c. c = savb + tbua = ab(sv + tu).
7. If a and b are positive integers with a > b, show that gcd(a, b) = gcd(a, a b) Let d = gcd(a, b). Thus, d a and d b. Therefore, there exist integers s and t such that a = ds and b = dt. Thus, a b = ds dt = d(s t). Since s t Z, d (a b). Therefore, d is a common divisor of a and a b. All we need to show is that d the the greatest common divisor of a and a b. To do that, let p be a common divisor of a and a b. We will show that d p. Since p is a common divisor of a and a b, p a and p (a b). Therefore, there exist integers u and v such that a = pu and a b = pv. Now, b = a pv = pu pv = p(u v). 8. Hence, p b. Thus, p is a common divisor of a and b. But since d is the greatest of a and b, it follows that d p. This proves the result. common divisor (a) Give an example of positive integers p, a, and b where p ab, but p a and p b (b) Show that if p is a prime number, and a and b are positive integers such that p ab, then p a or p b (a) Consider p = 6, a = 4 and b = 3. Now, 6 (4 3) and 6 4 and 6 3. (b) Let a and b be positive integers and let p be a prime number such that p ab. Assume that p does not divide a (that is, assume that p a). We will prove that p b. By our assumption, p { }a. This implies that p is not a common factor of p and a. Since p is prime, the only positive factors of p are 1 and p. Thus the only common factor of p and a is 1. Hence, gcd(p, a) = 1 This implies that there exist integers s and t such that Multiplying the equation by b we get that 1 = sp + ta b = spb + tab Since p ab, there exists and integer u such that ab = up. Hence, b = spb + tup = p(sb + tu) Since sb + tu Z, p b and the result is proved.
9. Let m and n be relatively prime positive integers. Let f : Z m Z m be a function dened by f(x) = nx mod m. Prove that f is one-to-one. See page 88 for a denition of mod m To prove that f is one-to-one, let x, y Z m such that f(x) = f(y). We show that x = y.by dention of f, f(x) = f(y) implies that This implies that Since gcd(m, n) = 1, n 1 exists in Z m. Hence, and nx mod m = ny mod m nx ny (mod m) n 1 nx n 1 ny (mod m) x y (mod m) Therefore, m (x y). That is, x = y + mt for some t Z. Since x and y are both elements of Z m, t must equal 0. Hence, x = y and f is one-to-one. 10. Calculate each of the following: (a) φ(14), φ(15), (16), φ(17), φ(25) (b) φ(123) (c) φ(2 11 ) (d) φ(6889): Note 6889 = 83 2 and 83 is prime (e) φ(4657) (f) φ(15600) (g) φ(23328) (a) φ(14) = 6, φ(15) = 8, (16) = 8, φ(17) = 16, φ(25) = 20 (b) φ(123) = 80 (c) φ(2 11 ) = 1024 (d) φ(6889) = 6806 (e) φ(4657) = 4656 (f) φ(15600) = 3840 (g) φ(23328) = 7776 11. Estimate the number of prime numbers that are less than or equal to 999 999 π(999 999 ) 999999 ln(999 999 ) = 999998 ln(999) 12. Use Fermat's Little Theorem to answer the following question: Is 1720 prime? Hint: 2 1720 mod 1720 = 656 If 1720 where prime, then gcd(2, 1720) would be 1 and hence 2 1720 1 1 (mod 1)720 This would imply that 2 1720 2 (mod 1)720. But this is not true, since 2 1720 mod 1720 = 656.
13. Use the Square and Multiply Algorithm to determine the remainder when 15 61 is divided by 26 Note that 61 = 2 5 + 2 4 + 2 3 + 2 2 + 1. So, 15 61 = 15 25 +2 4 +2 3 +2 2 +1 = 15 25 15 24 15 23 15 22 15 1 = ( 15 2) 2 4 15 24 15 23 15 22 15 1 (17 15) 24 15 23 15 22 15 1 (mod 2)6 ( 21 2 15 ) 2 3 15 22 15 1 (mod 2)6 ( 11 2 15 ) 2 2 15 1 (mod 2)6 21 22 15 1 (mod 2)6 15 (mod 2)6 Hence, the remainder when 15 61 is divided by 26 is 15.