Math 470 Answers to Exam 1 Sample Problems September 27, 2011

advertisement
Math 470
Answers to Exam 1 Sample Problems
September 27, 2011
1. Use the Euclidean Algorithm to find gcd(1333, 1591) and to find one solution of 1333x + 1591y =
gcd(1333, 1591) with x, y ∈ Z.
Solution: First we apply the Euclidean algorithm:
1591 = 1333 + 258,
1333 = 5 · 258 + 43,
258 = 6 · 43 + 0.
Therefore, gcd(1333, 1591) = 43 .
Now to find x and y, such that 1333x + 1591y = 43, we back-substitute using the equations above:
43 = 1333 − 5 · 258
= 1333 − 5 · (1591 − 1333)
= 6 · 1333 − 5 · 1591.
So x = 6 and y = −5 .
2. Find all solutions to the equation 3x − 10y = 5 with x, y ∈ Z.
Solution: [Note: We can find initial solutions x = x0 and y = y0 of this equation using the methods
from problem 1 (i.e., the Euclidean Algorithm). But we are not expressly told to use the E.A., and
the numbers are small, so a brute force search ought to suffice.]
Quick trial and error finds that x0 = 5 and y0 = 1 are solutions of the equation 3x − 10y = 5. Since
the gcd(3, 10) = 1, we know that all solutions are
x = 5 + 10k, y = 1 + 3k, k ∈ Z.
3. Find all congruence classes of solutions of the following congruences in the given modulus.
(a) 7x ≡ 20 (mod 62).
(b) 6x ≡ 3 (mod 32).
(c) 4x ≡ 6 (mod 10).
Solution: (a) Since gcd(7, 62) = 1, we know there will be a unique solution of this congruence. Since
7 · 9 = 63 = 62 + 1, we see that 7−1 ≡ 9 (mod 62). We multiply both sides of the congruence by 9:
9 · 7x ≡ 9 · 20
(mod 62).
So x ≡ 180 ≡ 56 (mod 62) .
(b) We check that gcd(6, 32) = 2. Since 2 - 3, we know that this congruence has no solutions .
(c) We check that gcd(4, 10) = 2. Now 2 | 6, so we can divide through by 2 and reduce to solving the
congruence
2x ≡ 3 (mod 5).
Trial and error yields that x ≡ 4 (mod 5) is a solution. Changing this back to congruence classes
modulo 10 yields
x ≡ 4 (mod 10) and x ≡ 9 (mod 10) .
4. What are the multiplicative inverses of 3, 5, 7, 9, and 15, modulo 26.
Solution: For each number a above, we need to find x such that ax ≡ 1 (mod 26). Trial and error
yields
3x ≡ 1
(mod 26) ⇒ 3−1 ≡ 9
5x ≡ 1
(mod 26) ⇒ 5−1 ≡ 21
(mod 26),
7x ≡ 1
(mod 26) ⇒ 7−1 ≡ 15
(mod 26),
9x ≡ 1
(mod 26) ⇒ 9−1 ≡ 3
15x ≡ 1
(mod 26) ⇒ 15−1 ≡ 7
(mod 26),
(mod 26),
(mod 26).
1 −2
modulo 17.
9 7
Solution: First we invert the matrix over the real numbers, and find
−1 7
2
1 −2
25
25 .
=
9
1
9 7
− 25
25
5. Invert the matrix
1
So we need to find 25
(mod 17), and since 25 ≡ 8 (mod 17), this is that same thing as finding
1
(mod
17).
A
little
work
on the calculator yields 18 ≡ 15 (mod 17). Therefore,
8
−1 3 13
1 −2
7 · 15 2 · 15
(mod 17).
≡
≡
1 15
9 7
−9 · 15 1 · 15
6. We use the following
A B C D
00 01 02 03
P Q R
S
15 16 17 18
alphabet:
E
F
04 05
T U
19 20
G
06
V
21
H
07
W
22
I
08
X
23
J
09
Y
24
K
10
Z
25
L
11
.
26
M
12
,
27
N
13
;
28
O
14
(a) Using the affine cipher x 7→ 15x + 22 (mod 29), encrypt the plaintext message HELP into its
ciphertext.
(b) Someone has sent you the message ELF using the encryption key in part (a). What did they say?
Solution: (a) The message HELP corresponds to 07 04 11 15. We encrypt these using the given affine
cipher, and obtain 11 24 13 15. So the ciphertext is LYNP .
(b) If y ≡ 15x + 22 (mod 29), then we see that x ≡ 15−1 (y − 22) (mod 29). Since 15−1 ≡ 2 (mod 29),
we have x ≡ 2y − 44 ≡ 2y + 14 (mod 29). Therefore the decryption function is
y 7→ 2y + 14
(mod 29).
Since ELF corresponds to 04 11 05, we can decrypt this to 22 07 24, which is WHY .
7. (a) Show that 2 is a primitive root modulo 11.
(b) Find a primitive root of 17.
Solution: (a) We check that
21 ≡ 2
5
2 ≡ 10
(mod 11),
(mod 11),
22 ≡ 4
6
2 ≡9
9
2 ≡6
(mod 11),
(mod 11),
(mod 11),
23 ≡ 8
7
(mod 11),
2 ≡7
(mod 11),
10
(mod 11).
2
≡1
24 ≡ 5
8
2 ≡3
(mod 11),
(mod 11),
Since every residue class modulo 11 is congruent to a power of 2 modulo 11, we conclude that 2 is a
primitive root modulo 11. (Also, the data above implies that ord11 (2) = 10, which provides another
reason.)
(b) The first number to check is 2, but 28 ≡ 1 (mod 17), so we look elsewhere. Howver, 3 is a
primitive root modulo 17, which you can check in a manner similar to part (a).
8. What are φ(16), φ(20), φ(31), and φ(36), where φ(n) is Euler’s φ-function?
Solution:
φ(16) = φ(24 ) = 24 − 23 = 8 ,
φ(20) = φ(4)φ(5) = 2 · 4 = 8 ,
φ(31) = 31 − 1 = 30 ,
φ(36) = φ(4)φ(9) = 2 · (9 − 3) = 12 .
9. Given that 881 is prime, use Fermat’s Little Theorem to simplify 101882 (mod 881).
Solution: Fermat’s Little Theorem implies that 101880 ≡ 1 (mod 881). Therefore,
101882 = 101880 · 1012 ≡ 1 · 1012 ≡ 10201 ≡ 510
(mod 881).
10. You receive the following ciphertext. You know it was encoded using a Vigenè€re cipher, and you know
that the key is a recognizable word or words.
PIRHEETGSTPIRHEETGSTPIRHEETGSTPIRHEETGSTPIRHEETGST
(a) What is a likely key length for this cipher? Explain.
(b) You learn that the plaintext message consists of a two-letter word, one of whose letters is ‘a’,
repeated over and over. What is the message and what is the key? (Do you want to revise your
answer in (a)?)
Solution: (a) We look for the key length by shifting the ciphertext and checking for how many letters
coincide. Since the ciphertext is periodic with period 10, we get every letter coincides, so we conclude
the key is likely of length ten .
(b) We are given that the plaintext is a two letter word of the form ‘A ’ or ‘ A’. The ciphertext
consists of the string ‘PIRHEETGST’ repeated over and over. Since A corresponds to 0 in our alphabet,
we can determine part of the key:
plaintext = A
=⇒ key = P
R
E
T
S
or
plaintext =
A =⇒ key =
I
H
E
G
T.
Now there are two ways to proceed at this point. One is to check possible plaintext words and see
if they lead to a meaningful key. For example, if we are in the first case, then the second letter of
the key would likely be A, E, I, O, U or Y, since the key is supposed to be a recognizable English
word. These would correspond to the words AI, AE, AA, AU, AO, or AK. None of these look like
words (Scrabble afficionados may disagree), so we move to the second case. Here the possible words
are FA, HA, LA, MA, NA, PA, TA, YA, so we try them out to see. If the word is FA, then the key
must be KIMHZEOGNT. Since that is not a recognizable word, we move on. If the word is HA, then
the key must be IIKHXEMGLT. Nope, so we move on to LA, in which case the key would have to be
EIGHTEIGHT. So we conclude that the plaintext is LA , that the key is in fact EIGHT , and that
the answer in (a) ought to be five .
On the other hand there is an easier way than brute force search. The wording of the problem indicates
that the key may not be of length ten. Since the key is repeated over and over as we encrypt, it might
be the case that the key length is a divisor of ten, so 1, 2, or 5. It’s not 1, since then the letter A
would always encrypt to the same thing. It’s not 2, since then length of the repeated ciphertext would
be 2 and not 10. So maybe the length of the key is 5. Under that assumption, we can go back to our
analysis of the key and see that it is either PTRSE or EIGHT. Thus the key must be EIGHT , the
plaintext is then LA , and the key length is five .
Download