This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CS 182 – Fall 2009 Name: Prof. Ananth Grama MIDTERM #2 This is an open book, open notes exam. However, you are not allowed to share any material with anyone else during the exam. Any evidence of academic dishonesty will be dealt with strictly in accordance with existing rules at Purdue University. The exam consists of 7 questions on the following 7 pages. Each question is worth 10 points. Problem Maximum Score 1 10 2 10 3 10 4 10 5 10 6 10 7 10 Total 70 PROBLEM 1 A pseudorandom numbers generator is using the following linear congruence x n +1 = 29 x n mod 13 . a. (6 pts) If the first generated number is x 1 = 4, what is the seed x ? Observe that this is asking for the solution to: 4 ≡ 29 x mod 13 Since we can apply the modulo at any time, this problem is the same as: 4 ≡ 3 x mod 13 (since 29 ≡ 3 mod 13) Also, observe that 3 · 3 ≡ 1 mod 13. Furthermore, 3 · 3 · 4 ≡ 1 · 4 ≡ 4 mod 13. Thus, if we can find the inverse of 3 (mod13), we can multiply that by 4 and get the solution. To find the inverse, we apply the Euclidean GCD algorithm to write the GCD (which is 1) as a linear combination of 3 and 13: 13 = 4 · 3 + 1 13 4 · 3 = 1 This means the inverse of 3 (mod13) is 4 ≡ 9 mod 13. We can confirm this, because 3 · 9 = 27 ≡ 1 mod 13. Also, we now have 31 mod 13....
View
Full Document
 Spring '08
 Staff
 Statistics, Prime number, Fermat

Click to edit the document details