Math 350 – Practice Exam 1 – Solutions

advertisement
C Roettger
Spring 2013
Math 350 – Practice Exam 1 – Solutions
Problem 1 Convert 2013 to binary and 1010001012 to decimal notation.
For 2013, I use the top-down method. The nonzero multiples are always 1, no
need to write these. The exponents indicate where the digits go.
2013
989
477
221
93
29
13
5
1
=
=
=
=
=
=
=
=
=
210 + 989
29 + 477
28 + 221
27 + 93
26 + 29
24 + 13
23 + 5
22 + 1
20 + 0
So 201310 = 11111011101. Easy check:
2013 + 35 = 2048 = 211
(try adding 35 = 1000112 to the answer). Now binary to decimal:
28
26
22
+ 20
= 256
= 64
=
4
=
1
325
Problem 2 a) Find integers s, t such that
120s + 63t = gcd(120, 63)
b) Find the inverse of 32 modulo 43.
a) The extended Euclidean algorithm gives
s
t 120s + 63t
1
0
120
0
1
63
1 −1
57
−1
2
6
10 −19
3
(the next remainder is zero, so the gcd(120, 63) = 3 and
10 · 120 − 19 · 63 = 3.
b) The very same Euclidean algorithm gives
s
t 43s + 32t
1
0
43
0
1
32
1 −1
11
−2
3
10
3 −4
1
so the inverse of 32 modulo 43 is 43 − 4 = 39 (we could also use −4 or any other
integer congruent to −4 modulo 43, but the standardized system of representatives for congruence classes modulo 43 is of course 0, . . . , 42).
Problem 3 Find an integer x < 120 such that
x≡4
(mod 8)
x≡2
(mod 3)
x≡1
(mod 5)
The Chinese Remainder Theorem (proof of it, rather) says compute M1 = 3·5 =
15, M2 = 8 · 5 = 40, and M3 = 8 · 3 = 24. Then 15 · 7 ∼
= 1 (mod 8), 40 · 1 ∼
=1
∼
(mod 3) and 24 · 4 = 1pmod5. We put
x = 4 · 15 · 7 + 2 · 40 + 1 · 24 · 4 = 420 + 80 + 96 = 596.
We can change this modulo 120 and still keep all the congruences above valid.
So the answer is x = 596 mod 120 = 116.
Problem 4 How many solutions does the congruence 12x ≡ 20 have modulo
40?
Either you remember that we had a theorem giving the number of solutions as
gcd(12, 40) = 4.
Or you play it safe, reproduce a bit of the proof of that theorem: First, divide
by the gcd(12, 20) = 4 to get the equivalent congruence 3x ≡ 5 (mod 10). This
has exactly one solution modulo 10 because gcd(3, 10) = 1 (it is x ≡ 5 (mod 10)
but we don’t need that). There are 4 values of x modulo 40 that match this
condition.
Problem 5 Why is 21000 − 1 not a prime? Find a short proof (NOT trial
division).
Use the factorization a2 − 1 = (a − 1)(a + 1) to get
21000 − 1 = (2500 − 1)(2500 + 1).
Similarly, you can show that 2n − 1 is not a prime unless n is a prime itself.
Problem 6 a) Explain why any number with base 16-representation n =
(a1 a2 . . . ak )16 satisfies
n ≡ a1 + a2 + · · · + ak
2
(mod 15)
b) I wrote a number in base 16, n = A 46201B16 and unfortunately smudged
the second digit. But I know that n is a multiple of 15. What was the missing
digit?
a) For any power of 16,
16k ≡ 1k = 1
(mod 15)
and therefore
n=
s
X
k=0
ak 16k ≡
s
X
ak 1k =
k=0
s
X
ak
(mod 15)
k=0
b) Using part a),
n ≡ A + a6 + 4 + 6 + 2 + 1 + B = 34 + a6
(mod 15)
so n ≡ 0 (mod 15) implies a6 = 11 (written B in base 16).
Problem 7 Let fn be the n-th Fibonacci number (so f0 = f1 = 1, fn+2 =
fn+1 + fn ).
Prove by induction that gcd(fn+1 , fn ) = 1 for all n ≥ 1, and that the Euclidean
Algorithm finds this gcd in exactly n − 1 steps.
Base step – n = 1 is obviously true.
Induction step – assume the claim is true for one value of n. We substitute n + 1
for n, so the claim is about gcd(fn+2 , fn+1 ). The Euclidean Algorithm says
fn+2 = qfn+1 + r
and because of
fn+1 < fn+2 < 2fn+1
(this is quite obvious, but would have to be shown by another little proof by
induction, if you insist), we get q = 1 and therefore r = fn . Then the Euclidean
algorithm will continue and compute in n − 1 steps
gcd(fn+1 , fn ) = 1
This is part of the computation of gcd(fn+2 , fn+1 ), so it proves that the new
gcd is indeed 1. The total number of steps turns out to be n, as claimed.
3
Download