Docsity

Cryptography - Midterm Exam with Solution | MATH 116, Exams of Mathematics

Toggle sidebar
bg1
Math 116
Last Midterm Examination
April Fools’ Day, 2010
11:10AM–12:30 PM, 3109 Etcheverry Hall
Please put away all books, calculators, and other portable electronic devices—anything with
an ON/OFF switch. You may refer to a single 2-sided sheet of notes. For numerical ques-
tions, show your work but do not worry about simplifying answers. For proofs, write your
arguments in complete sentences that explain what you are doing. Remember that your
paper becomes your only representative after the exam is over.
All five problems were worth 6 points. The mean was 14.1, the median 14. The standard deviation was 9.2.
1. Let F=Fpn, where pis an odd prime number and na positive integer.
a. Show that (a+b)p=ap+bpfor all a, b ∈F.
The binomial theorem yields (a+b)p=
p
X
i=0 p
iaibp−i. We need to see that the intermediate terms p
iaibp−i
with 1 ≤i≤p−1 are all 0. In F,p= 0, and it is enough to know that p
iis a multiple of p. We have
p! = p
ii!(p−i)!. Here, pdivides the left-hand side of the equation, so it divides one of the three integers
p
i,i!, (p−i)!. It doesn’t divide the second or three of these integers, so it must divide the first.
b. Let ζ∈F∗be a qth root of 1, where qis an odd prime number different from p. Set
G=
q−1
X
i=1 i
qζi.
Prove that we have Gp=p
qG.
This is a computation that we did in class. By part (a), Gpis the sum of the pth powers of the terms
defining G. Since the Legendre symbols i
qare ±1, they’re their own pth powers. Hence Gp=
q−1
X
i=1 i
qζpi.
Setting j=pi, we have Gp=
q−1
X
j=1 jp−1
qζj. Since jp−1
q=p
qj
q, the desired result follows.
2. a. A fair coin is tossed 2ntimes. What is the probability that exactly nheads come up? Write this
probability as a rational number in lowest terms when n= 6.
For my dime, the probability is 2n
n/2n. When n= 6, we get 231/1024 = 0.2255859375 for this expression.
b. Determine whether 1234 is a square modulo 12345 = 3 ·5·823.
The number 1234 is the product of 2 and 617. Because 12345 ≡1 mod 8, we have 2
12345= 1. Hence
1234
12345=617
12345, which may be rewritten 12345
617 by quadratic reciprocity because 12345 ≡1 mod 4.
1
pf3

Partial preview of the text

Download Cryptography - Midterm Exam with Solution | MATH 116 and more Exams Mathematics in PDF only on Docsity!

Math 116 Last Midterm Examination

April Fools’ Day, 2010

11:10AM–12:30 PM, 3109 Etcheverry Hall

Please put away all books, calculators, and other portable electronic devices—anything with an ON/OFF switch. You may refer to a single 2-sided sheet of notes. For numerical ques- tions, show your work but do not worry about simplifying answers. For proofs, write your arguments in complete sentences that explain what you are doing. Remember that your paper becomes your only representative after the exam is over.

All five problems were worth 6 points. The mean was 14.1, the median 14. The standard deviation was 9.2.

  1. Let F = Fpn , where p is an odd prime number and n a positive integer.

a. Show that (a + b)p^ = ap^ + bp^ for all a, b ∈ F.

The binomial theorem yields (a+b)p^ =

∑^ p

i=

p i

aibp−i. We need to see that the intermediate terms

p i

aibp−i

with 1 ≤ i ≤ p − 1 are all 0. In F, p = 0, and it is enough to know that

p i

is a multiple of p. We have

p! =

p i

i!(p − i)!. Here, p divides the left-hand side of the equation, so it divides one of the three integers ( p i

, i!, (p − i)!. It doesn’t divide the second or three of these integers, so it must divide the first.

b. Let ζ ∈ F ∗^ be a qth root of 1, where q is an odd prime number different from p. Set

G =

q∑− 1

i=

i q

ζi.

Prove that we have Gp^ =

p q

G.

This is a computation that we did in class. By part (a), Gp^ is the sum of the pth powers of the terms

defining G. Since the Legendre symbols

i q

are ±1, they’re their own pth powers. Hence Gp^ =

q∑− 1

i=

i q

ζpi.

Setting j = pi, we have Gp^ =

q∑− 1

j=

jp−^1 q

ζj^. Since

jp−^1 q

p q

j q

, the desired result follows.

  1. a. A fair coin is tossed 2n times. What is the probability that exactly n heads come up? Write this probability as a rational number in lowest terms when n = 6.

For my dime, the probability is

2 n n

/ 2 n. When n = 6, we get 231/1024 = 0.2255859375 for this expression.

b. Determine whether 1234 is a square modulo 12345 = 3 · 5 · 823.

The number 1234 is the product of 2 and 617. Because 12345 ≡ 1 mod 8, we have

= 1. Hence ( 1234 12345

, which may be rewritten

by quadratic reciprocity because 12345 ≡ 1 mod 4.

Since 12345 ≡ 5 mod 1234, we get 12345 ≡ 5 mod 617. Hence

. Again by quadratic

reciprocity, the latter symbol may be rewritten

. Since 617 ≡ 2 mod 5 and 2 is not a square mod 5,

we get finally that

is −1. Thus 1234 is not a square mod 12345. Of course, if it turned out that

we have

= +1, we wouldn’t be able to conclude directly that 1234 is a square: we’d have to look

separately mod 3, 5 and 823. Notice, however, that 1234 is 1 mod 3 and thus a square mod 3. Similarly, it’s 4 mod 5 and thus a square mod 5. Hence the problem is equivalent to deciding whether 1234 is a square mod the prime 823. We have 1234 ≡ 411 = 3 · 137 mod 823, and one can certainly do the problem this way without referring to Jacobi symbols.

  1. Let p be the prime number 251; note that p − 1 = 2 · 53. Suppose that g is the primitive root 6 mod p, and that h = 7 mod p. Let x be the discrete logarithm logg (h).

a. Use the Legendre symbol to find x mod 2.

The point is that x is a number mod 250 that we can determine by doing three computations mod 5 and one computation mod 2. (This is the Pohlig–Hellman business.) The question of whether or not x is even is

the question of whether h is a square mod p. Now

= −(−1) = +1. Hence x

is even.

b. Using the equation g^150 = h^50 and the result of part (a), find the value of x mod 10.

The given equation tells us that 50x ≡ 150 mod 250, i.e., that x is 3 mod 5. Hence x must be either 3 or 8 mod 10; from (a), we get that it’s 8 mod 10.

The actual value of the discrete log, which is 248 by the way, could now be found by doing two more computations mod 5.

  1. As in the previous problem, let p = 251 and let g = 6 mod p.

a. What are the quantities logg (2) + logg (3) and logg (2) + 3 logg (5)?

The first quantity is log 6 (6), which is 1! The second quantity is logg (250) = logg (p−1); this is (p−1)/2 = 125

because g(p−1)/^2 = −1 whenever g is a generator (or, more generally, whenever g is replaced by a non-square).

As you can see, we’re trying to do a baby version of index calculus in this problem: we want to get three equations for the three unknowns log(2), log(3) and log(5). In part (a), we get two equations without breaking a sweat, and now the aim is to get a third equation. You can imagine that the data in part (b) would come after some calculation....

b. Given the values g^5 = 246 and g^10 = 25 mod p, and using the result of (a), find the logarithms logg (2), logg (3) and logg (5).

The second value gives 2 logg (5) = 10, so logg (5) is either 5 or 5 + (p − 1)/2 = 130. The first value shows you that logg (246) = 5, so that logg (5) is not 5. Hence logg (5) = 130. Thus logg (2) = 125 − 390 = 235 and logg (3) = 1 − 235 = 16. (The logs are calculated mod p − 1.)

  1. a. Find an expression for the probability P that 100 random integers between 1 and 5,000 are all different.

The number P is the product

∏^99

i=

(1 − i/5000). This is a birthday paradox product analogous to the product

in the displayed formulas at the top of page 228 of the textbook. According to sage, we have P ≈ 0 .369.