Introduction To Discrete Math Due: Monday Oct. 15, 2012. 11:59pm Assignment 2 Instructor: Mohamed Omar Math 6a For all problems on assignments, you are allowed to use the textbook, class notes, and other book references. All problems must be written on your own, though you may collaborate on problem solving for all but the No collaboration problems. The internet can be used for reference material on course subjects, but should not be used to search for or obtain solutions. 1. (No Collaboration) (a) Solve the congruence equation 19x 3 (mod 32). (b) Compute 1905 189 mod 2741 using at most 12 multiplications and at most 12 modular arithmetic reductions. Solution (a) We first find all integral solutions to the Diophantine equation 19x + 32y = 3. By the usual method (ie. the Euclidean algorithm) we see that solutions have the form x = 15 + 32k, y = 9 19k for integers k. It follows that the solutions to the congruence relation are x = 15 + 32k for integers k. 19x 3 (mod 32) (b) Note that 2 = 2 7 2 6 3. Solving the congruence relation we see that in Z 2741, 1905 1 = 200. We now have 1905 189 1905 27 +2 6 3 1905x 1 (mod 2741), (mod 2741) 1905 27 1905 26 200 2 200 (mod 2741). We can compute the first two factors by squaring 1905 seven times (reducing modulo 2741 each time). Similarly, the third factor requires one instance of multiplication. Multiplying the four factors together then brings us up to eleven multiplications. 2. (No Collaboration) Alice wants to send a secret message to Bob using RSA. Bob creates the public key (n, e) = (37 89, 17). If C = 1516, what is M? 1
Solution First we will find d. This can be done by solving the congruence relation 17d 1 (mod 36 88). Our usual technique shows that d = 1277 works. We now know that C d = 1516 1277 M (mod 37 89). We will first compute 1516 1277 (mod 37) ( 1) 1277 (mod 37) 1 (mod 37) and 1516 1277 (mod 89) 3 45 (mod 89), by Euler s theorem and the fact that 1277 = 45 (mod 88). Observing that 45 = 2 5 + 2 4 3 and 3 30 (mod 89), we can readily verify that 3 45 86 (mod 89). We now search for 0 x < 89 37 such that x 1 (mod 37) x 86 (mod 89). By the Chinese remainder theorem, it will follow that M = x. Such an x must satisfy x = 37y 1 for some integer y, and so whence 37y 1 86 (mod 89), 37y 89k = 87 for some integer k. By the usual arguments, it follows that y = 12 87 + 89l for some integer l for instance, y = 24 works. But then M = x = 887. 3. (a) Find all possible values of e, with 2 e 30, for which (61 97, e) is a valid public key for RSA encryption. (b) Bob shouldn t publish too much information! During the RSA algorithm, Bob accidentally publishes φ(n). Show that, using n and φ(n) alone, an adversary (such as Eve L.) can determine p and q. Solution (a) A given 2 e 30 is suitable iff gcd(e, 60 96) = 1. Now the prime factors of 60, 96 are 2, 3 and 5, so we see that such an e is suitable iff 2, 3, 5e. 2
(b) We have so we know that φ(n) = (p 1)(q 1) = pq (p + q) + 1 = n + 1 (p + q), p 2 = p(p + q) pq = p(n + 1 φ(n)) n and p can be recovered by the quadratic formula. We then have q = n p. 4. Determine all integers n for which n 8017 + n 975 + n 86 + 1 is divisible by 91. Solution Observe that 91 = 13 7; as 13 and 7 are prime, we see (reducing exponents modulo 12 and 6, respectively) that if and only if if and only if n 8017 + n 975 + n 86 + 1 0 (mod 91) n 8017 + n 975 + n 86 + 1 0 (mod 7) 0 (mod 13) n 3 + n 2 + n 1 + 1 = (n 2 + 1)(n + 1) 0 (mod 7) 0 (mod 13). Now trial and error verifies that and (n 2 + 1)(n + 1) 0 (mod 7) n 6 (mod 7) (n 2 + 1)(n + 1) 0 (mod 13) n 8 (mod 13) or n 12 (mod 13). Applying the methods with which we are now thoroughly familiar, together with the Chinese remainder theorem, we see that all the desired n have the form for nonnegative integers k. n = 34 + 91k or n = 90 + 91k 5. In this problem, we present a method for certifying an integer is prime. Suppose n 2 is a positive integer, and a is an integer in the set {1, 2,..., n 1} such that gcd(a, n) = 1. The order of a with respect to n, denoted ord n (a), is the smallest positive integer d such that a d 1 mod n. In this problem, we will investigate properties of the order function. (a) Determine ord 7 (2), ord 7 (3), ord 7 (4), ord 7 (5), ord 7 (6). (b) Show that if b is a positive integer then a b 1 mod n if and only if ord n (a) b. Conclude that ord n (a) φ(n). 3
(c) Suppose n is prime, and d φ(n). How many integers in {1, 2,..., n 1} are there whose order is exactly d? You may use without proof that if m is a positive integer, then φ(d) = m. d m Solution (a) By part (b), we know that ord 7 (a) is one of 2, 3, 6 for each of the a given. Finding the exact value then involves a minimal amount of calculation, and reveals: ord 7 (2) = 3 ord 7 (3) = 6 ord 7 (4) = 3 ord 7 (5) = 6 ord 7 (6) = 2. (b) One direction is straightforward: if b = kord n (a) then a b (mod n) (a ordn(a) ) k (mod n) 1 (mod n). Conversely, suppose a b (mod n) but ord n (a)b, so for some positive k, 0 < r < ord n (a), b = kord n (a) + r. But we then have a r 0 (mod n), contradicting the definition of ord n (a). The conclusion follows by Euler s theorem. (c) For each positive integer d which divides φ(n), let O d be the number of positive integers < n of order d. We will show that O d = φ(d) for each such d. This will be achieved by showing that O d φ(d) and then (see hint) appealing to the fact φ(d) = φ(n) = n 1 = O d. d φ(n) d φ(n) The last equality follows from part (b). Towards this end, suppose there is some a < n such that ord n (a) = d (if not, the inequality is immediate). It is then readily verified that the integers a, a 2,, a d 1 are (pairwise) distinct modulo n and for each index 1 k d 1, ord n (a k ) = d gcd(k, d) = 1, (a k ) d 1 (mod n). On the other hand, recall that as n is prime, there are at most d solutions to the equation x d 1 (mod n) modulo n. Thus, every b < n such that ord n (b) = d must appear in the list above, and so we see that O d = φ(d). We have actually shown that for every d φ(n), O d = 0 or O d = φ(d); in particular, O d φ(d), and the result follows. 4
6. Use the Chinese Remainder Theorem to find quick answers to the following questions: (a) How many positive integer multiples of 13 have their last ten digits being 9876543210, in that order? (b) A positive integer n is square-free if there is no prime number p such that p 2 n. Prove or disprove: There is a sequence of 1, 000, 000 consecutive positive integers, none of which is square free. Solution (a) Infinitely many. By the Chinese remainder theorem, there is a positive integer x such that 13x 0 (mod 13) x 9876543210 (mod 10 10 ), and then for each n, x + 13 10 10 n is a positive integer multiple of 13 with 9876543210 as its last ten digits. (b) This is true. Let p 1,, p 10 6 be a sequence of distinct prime numbers and use the Chinese remainder theorem to find x > 0 such that x 1 (mod p 2 1) x 2 (mod p 2 2). x 10 6 (mod p 2 10 6 ). Then x + 1, x + 2,, x + 10 6 is a sequence of positive integers which are not square free. 5