Math/CS 467, Midterm 1 Practice Fall 2020, John Lesieutre • Write Your

Math/CS 467, Midterm 1 Practice Fall 2020, John Lesieutre • Write Your

Name: Math/CS 467, Midterm 1 Practice Fall 2020, John Lesieutre • Write your name on the exam. • You may consult the textbook, your notes, and my slides during the exam. However, you may not consult other references on the internet. • No calculators or other aids are allowed. • Justifications or proofs are required for all problems except where indicated otherwise. • If you aren’t sure how to do a problem, don’t leave it blank! I will give you a point or two if you define some of the terms appearing in the problem. • If you need more space, continue on the back of the page. Mark your work clearly. • You have 50 minutes to complete the exam. • Good luck! 1 Problem 1. The Euclidean algorithm makes it possible to check whether two numbers have a common divisor. a) Give an example of another algorithm in this class where computing the gcd is necessary. Before using the base-b pseudoprime test p, you had better check that gcd(b; p) = 1. b) Use the Euclidean algorithm to compute gcd(117; 221). 221 = 1 ∗ 117 + 104117 = 1 ∗ 104 + 13104 = 8 ∗ 13 + 0 The gcd is 13. Problem 2. Suppose you wish to use the Diffie-Hellman algorithm to agree on a secret private key shared with me. We must first agree on a prime p and primitive root g. Let’s use p = 7 and g = 3. a) Now you pick an integer x. Let’s say you choose x = 68. You then receive “4” from me. What do you need to compute to find the shared key? (You do not need to work out the actual number in this problem.) You need to compute 468 (mod 7). b) Compute the shared key. (Now I want the number.) Do not use a computer or calculator, and show all your work. 41 ≡ 1 (mod 7) 42 ≡ 2 (mod 7) 44 ≡ 4 (mod 7) 48 ≡ 2 (mod 7) 416 ≡ 4 (mod 7) 432 ≡ 2 (mod 7) 464 ≡ 4 (mod 7) Then 468 ≡ 464 · 44 ≡ 4 · 4 ≡ 2 (mod 7): Problem 3. Let φ denote the Euler φ function, the number of positive integers less than n which are coprime to n. a) The Euler φ function plays an improtant role in several places. Give an example of an algorithm in this class where computing φ(n) was necessary. There are a few. It’s a step in using RSA, for example. Once you have n, you find d and e to be inverse mod φ(n). 2 b) Compute φ(200). For this, we have a formula, once we know the prime factorization of 200. 200 = 4 × 50 = 22 × 2 × 52 = 23 × 52: Then φ(200) = (2 − 1)22 · (5 − 1)51 = 80. Problem 4. Consider the number n = 123456789123. a) Suppose you wanted a fast-and-probably-accurate idea about whether this number is prime. How would you check? (Tell me precisely what you would compute, but you do not need to actually do the arithmetic.) I’d go with a base-2 pseudoprime test. Compute 2123456789123−1 and check whether it’s 1 mod 123456789123. The exponential could be computed fairly painlessly using our fast exponentiation algorithm. b) Suppose you want to be completely sure whether or not this number is prime. How would you check? (Again tell me precisely what needs to be computed, but do not compute it.) pAt this point, our best option is probably just trial division. Check each number up to 123456789123 as a possible factor. If none of them work, it’s prime. Problem 5. Prove that no perfect number is of the form N = paqb, where p and q are odd primes. This is lifted straight from a homework assignment, as is my solution. The factors are: Row P 2 a pa+1−1 1 p p ··· p p−1 2 a pa+1−1 q · 1 q · p q · p ··· q · p q · p−1 ··· b b b 2 b a b pa+1−1 q · 1 q · p q · p ··· q · p q · p−1 The sum of each row can be evaluated using the formula for a geometric series. The sum of all the row sums is also geometric, giving us a total of: pa+1 − 1 qb+1 − 1 p − 1 q − 1 3 This sum of factors includes N itself, so for it to be a perfect number we get: pa+1 − 1 qb+1 − 1 2N = p − 1 q − 1 pa+1 − 1 qb+1 − 1 2paqb = p − 1 q − 1 2paqb(p − 1)(q − 1) = (pa+1 − 1)(qb+1 − 1) 2pa+1qb+1 − 2pa+1qb − 2paqb+1 + 2paqb = pa+1qb+1 − pa+1 − qb+1 + 1 pa+1qb+1 − 2pa+1qb − 2paqb+1 + 2paqb + pa+1 + qb+1 − 1 = 0 paqb(pq − 2p − 2q + 2) + (pa+1 + qb+1 − 1) = 0 The thing in the rightmost parentheses is definitely positive, since pa+1 and qb+1 are both at least 1. On the other hand, we can assume q ≥ 5 and p ≥ 3. Then pq − 2p − 2q + 2 = q(p − 2) − 2p + 2 ≥ 5(p − 2) − 2p + 2 = 3p − 8 ≥ 1: So the other term is also positive. No way we’re getting 0, so there are no odd perfect numbers of this form. Problem 6. Use Garner’s algorithm to find a solution to the following system of congru- ences: a ≡ 1 (mod 3) ≡ 2 (mod 4) ≡ 3 (mod 5) We have m1 = 3; m2 = 4; m3 = 5: and a1 = 1; a2 = 2; a3 = 3: The first step in Garner’s algorithm is to find cij that make cijmi ≡ 1 (mod mj). We can use c12 = 3 c13 = 2 c23 = 4: 4 Then we use the formula: v1 = a1 (mod m1) = 1 (mod 3) = 1 v2 = (a2 − v1)c12 (mod m2) = (2 − 1)3 (mod 4) = 3 (mod 4) = 3 v3 = ((a3 − v1)c13 − v2)c23 (mod m3) = ((3 − 1)2 − 3)4 (mod 5) = 4: Then a = v3m2m1 + v2m1 + v1 = (4)(4)(3) + (3)(3) + 1 = 58: Problem 7. Prove that 25 is not the fourth power of any rational number. 4 p 4 4 4 Suppose that q = 25, where p and q are coprime. Then p = 25q . This means that p is a multiple of 5, and according to Euclid’s lemma, that means that p is a multiple of 5. So we can write p = 5k. Then (5k)4 = 25q4, so 25k4 = q4. This shows that q is a multiple of 5. But then p and q aren’t coprime, a contradiction. 5.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    5 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us