Math 5248 Lec 2 Exam 1 Solutions RSA: (82)(96)=7872. We want the inverse of 1243 mod 7872. 7872=(6)(1243)+414 1243=(3)(414)+1 Then 1=1243-(3)(414)=1243-3(7872-6*1243)=19*1243-3*7872., so the Mult Inv of 1243 mod 7872 is 19. Then using the method in the book and working mod 8051, 3^19=(3^18)*3=(9^9)*3=(9^8)*27=(81^4)*27=(6561^2)*27≡[(-1490)^2]*27=2220100*27≡6075*27 ≡ 164025≡3005. So the answer is x = 3005. You can check that 3005^1243 mod 8051=3. N mod 11: Note that 10 ≡(-1) mod 11; hence 10^k ≡(-1)^k mod 11, which equals plus one if k is even and minus one if k is odd. So N mod 11=(∑𝑛𝑘=0 𝑎𝑘 10𝑘 ) mod 11 ≡∑𝑛𝑘=0(𝑎𝑘 10𝑘 𝑚𝑜𝑑 11) =∑𝑛𝑘=0 𝑎𝑘 (10𝑘 𝑚𝑜𝑑 11)=∑𝑛𝑘=0 𝑎𝑘 ((−1𝑘 )𝑚𝑜𝑑 11) ≡ (∑𝑛𝑘=0 𝑎𝑘 (−1)𝑘 )𝑚𝑜𝑑11, which is the desired result. Probability: The probability is C(9,1)*(1/9)*(8/9)^8=9*(1/9)*(8/9)^8=(8/9)^8 ≈ 0.389744 AFFINE: 3a+b≡1 and 7a+b≡3 (mod 26, of course). Subtracting, we get 4a≡2 mod 26. You get full credit if you solve for a by guessing and checking, but here is a systematic approach, which you should understand for future use: 4a≡2 mod 26 means 4a-2=26q, for some integer q. It is not legitimate to divide the congruence 4a≡2 mod 26 by 2, but we can take the ordinary equation 4a-2=26q and divide by 2 to get 2a-1=13q. This means that 2a≡1 mod 13. Now the multiplicative inverse of 2 mod 13 is 7, so multiplying both sides of 2a≡1 mod 13 by 7 we get a≡7 mod 13; that is a=7+13q. If q is even, this yields a≡7 mod 26, while if q is odd, this gives a≡20 mod 26. So the congruence 4a≡2 mod 26 has exactly two solutions, namely a ≡7 and a≡20. If a=7, then b=6. If a=20, then b=19 So there are two possibilities, a=7,b=6, and a=20,b=19. Vigenere: I think the best way to attack this cipher is to look at slices. If we assume the key length is 2, then y(0) is 000000 and y(1) is 101111. Then it is overwhelmingly likely that k0 = 1 and k1 = 0, and so the original text would be 111011111111. Since this is clearly a reasonable answer, it gets full credit. Other answers were evaluated according to their reasonableness.