1 2 3 4 5 6 7 8 ∑ - UC Davis Mathematics

MAT 115A SSI 2016 Final Examination
July 28
Name:
Instructions: The exam starts at 2:10 and ends at 3:50. You can’t use any notes. You can use your
calculators.
Show all your work unless asked otherwise.
1
2
3
4
5
6
7
8
P
Problem 1. a. (5 points) State the Fundamental Theorem of Arithmetic.
(Extra credit) (8 points) Given a prime number p, find the exponent α of p in the prime factorization
b.2 p
.
of
p
Problem 2. a. (5 points) The binary representation of an n-bit integer N is given by
N = 2α1 + 2α2 + . . . + 2αs ,
where α1 > α2 > . . . > αs ≥ 0. Express n in terms of α’s. (Without proof.)
b. (10 points) Given an integer N , we want to perform an algorithm that will give us the sequence
{α1 , . . . , αs }. We do it as follows:
while N>0:
alpha = 0
while 2^(alpha+1) <= N:
alpha += 1
N = N - 2^(alpha)
list.append(alpha)
return list
That is, we find the largest α such that 2α ≤ N , subtract 2α from N , and put α in our list. We do that
until N = 0.
Estimate (with proof) the number of integer operations required to perform that algorithm (express
your estimate in terms of α’s).
c. (5 points) Prove that the complexity of the above algorithm is O(n2 ).
d. (5 points) Is the above algorithm efficient for calculating the binary representation of a number N ?
Explain your reasoning.
Problem 3. a. (10 points) Consider a complete system of residues {r1 , r2 , . . . rn } modulo n and a
complete system of residues {s1 , s2 , . . . sm } modulo m, where n and m are relatively prime.
Prove that {mri + nsj | 1 ≤ i ≤ n, 1 ≤ j ≤ m} is a complete system of residues modulo nm.
b. (Extra credit) (10 points) Consider a reduced system of residues {r1 , r2 , . . . rφ(n) } modulo n and a
reduced system of residues {s1 , s2 , . . . sφ(m) } modulo m, where n and m are relatively prime.
Is {mri + nsj | 1 ≤ i ≤ φ(n), 1 ≤ j ≤ φ(m)} a reduced system of residues modulo nm?
Problem 4. a. (10 points) Solve the linear congruency 258x ≡ 6 (mod 345).
b. (10 points) Solve the following system of congruences:


x ≡ 4 (mod 5)
x ≡ 2 (mod 3)


x ≡ 3 (mod 7)
Problem 5. a. (5 points) Write a definition of the Euler Phi-function φ(n).
b. (5 points) Write a definition of an inverse of an integer a modulo n. In what case does the inverse
exist?
c. (5 points) How do we find an inverse of a modulo n using the Euler Phi-function?
b. (7 points) Prove that for any n > 2, φ(n) is even.
(Hint: you can either use the definition or the formula for φ(n).)
Problem 6. (10 points) Perform Miller’s Test base 3 for an integer n = 73. (Use Fast Modular
Exponentiation where needed.) Is that test sufficient to show that 73 is prime?
Problem 7. a. (8 points) Given a key (n, e) of an RSA cryptosystem, describe encryption function
E(P ) and decryption function D(C). (Without proof.)
b. (Extra Credit) (7 points) Alice wants to send a secret message P to Bob using RSA cryptosystem.
First, she encrypts P into ciphertext C1 using the key (n, e1 ) that Bob gave her. Shortly after that, Bob
decides to change his key to (n, e2 ), and Alice, just to be safe, encrypts P into C2 using the key (n, e2 ).
Assuming that (e1 , e2 ) = 1 and (P, n) = 1, show that Eve can get the initial message P once she knows
C1 , C2 , e1 , e2 and n.
Problem 8. (?) Draw something!
Have a nice break! :)