Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

EXAMPLES FROM SECTION ON 06/05/2013

NANEH APKARIAN

1. Chinese Remainder Theorem


The algorithm for solving systems of modular congruences comes from the proof of the Chinese
Remainder Theorem, and requires using the Berlekamp algorithm. Let n1 , n2 , ..., nk be relatively
prime numbers, define N = n1 n2 ...nk , and suppose we are given the set of simultaneous congruences:

x ≡ a1 (mod n1 )
x ≡ a2 (mod n2 )
..
.
x ≡ ak (mod nk )

For every 1 ≤ i ≤ k, we will use Berlekamp on (ni , nNi ) to construct xi , pi such that
 
N N
xi + pi ni = gcd ni , =1
ni ni
xi N
Once we have ei = ni for all i, we can find a value for x:

k k
X X ai xi N
x= ai e i =
ni
i=1 i=1

All possible solutions x will be congruent modulo N .


N
Now, we can be a bit clever. Define Ni = ni , noting that gcd(Ni , ni ) = 1. Then

xi Ni + pi ni = gcd(Ni , ni ) ⇒ xi Ni ≡ 1 (mod ni )

So we’re really looking for a bunch of inverses. When we have those, we see that
X
x≡ ai xi Ni (mod N ).

1.1. Problems.
(1) Find an integer x for which x ≡ 1 (mod 13) and x ≡ 11 (mod 23)
(2) Jessica breeds rabbits. She’s not sure exactly how many she has today, but as she was
moving them about this morning, she noticed some things. When she fed them, in groups
of 5, she had 4 left over. When she bathed them, in groups of 8, she had a group of 6 left
over. She took them outside to romp in groups of 9, but then the last group consisted of
only 8. She’s positive that there are fewer than 250 rabbits - but how many does she have?
1
2 NANEH APKARIAN

1.2. Solutions.
(1) (Using the first method and the Euclidean Algorithm) Note that N = 13 · 23 = 299, so
all possible solutions will be congruent mod 299. Since 13, 23 are relatively prime, they
have gcd -1, and so we can use the CRT to construct a solution x. Note that in this case
N/n1 = n2 and vice versa, so that we can set up and solve the equations
x1 · 23 + p1 · 13 = 1 x2 · 13 + p2 · 23 = 1
Getting x1 = 4 and x2 = 16, we then have the candidate solution
2
X ai xi N
x= = a1 x1 n2 + a2 x2 n1 = 1 · 4 · 23 + 11 · 16 · 13 = 2380
ni
i=1
Now we mod out by N to see that all solutions
x ≡ 287 (mod 299).

(2) This word problem corresponds to the system:


x≡4 (mod 5)
x≡6 (mod 8)
x≡8 (mod 9)
Then we have N = 360, and define the values
N
i ni Ni = ni ai
1 5 72 4
2 8 45 6
3 9 40 8
So now we want to find xi so that xi Ni ≡ 1 (mod ni ).
x1 · 72 ≡ x1 · 2 ≡ 1 (mod 5) ⇒ x1 = 3
x2 · 45 ≡ x2 · 5 ≡ 1 (mod 8) ⇒ x2 = 5
x3 · 40 ≡ x3 · 4 ≡ 1 (mod 9) ⇒ x3 = 7
And conclude that all solutions
X3
x≡ ai xi Ni (mod N )
i=1
= 4 · 72 · 3 + 6 · 45 · 5 + 8 · 40 · 7
≡ 134 (mod 360).
So Jessica has 134 rabbits.
EXAMPLES FROM SECTION ON 06/05/2013 3

2. Quadratic Residues and Primality


2.1. Problems. The sample problems from the lecture notes:

(1) Give the complete list of quadratic residues modulo 37.


(2) Find all solutions to the quadratic equation
x2 + 12x + 40 = 0 (mod 37)

11

(3) Calculate the Legendre symbol 31 .

(4) Does the equation x2 ≡ 11 have a solution modulo 31? Explain.


(5) Find the value of the Jacobi symbol J(5, 21).
(6) Find the value of the Jacobi symbol J(17, 866731).
(7) Compute the following:
(a) gcd(24, 601)
(b) J(24, 601)
(c) 24300 (mod 601)
What does this tell you about the primality of 601?

2.2. Solutions.
(1) We need only calculate the squares of {1, ..., 18 = 36/2} to come up with all quadratic
residues.

x 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 35 36
x2 mod 37 1 4 9 16 25 36 12 27 7 26 10 33 21 11 3 34 30 28 28 30 ... 4 1

(2) We begin by completing the square:


x2 + 12x + 40 = (x + 6)2 + 4
Let y = x + 6, and we have the equation
y 2 = −4 ≡ 33 (mod 37)
From our table in (1), we see that 33 is a quadratic residue, with roots 12, 25. This gives
y = 12, 25 ⇒ x = 6, 19

(3) There are a few ways of calculating the Legendre symbol. Note that 11, 31 are both primes,
so   
11 (31−1)/2 15 1 if 11 ∈ QR[31]
= 11 = 11 mod 31 =
31 −1 if 11 ∈ / QR[31]
So we can calculate the modular exponentiation, or establish if 11 ∈ QR[31]. Or, note that
  
11 31
= (−1)(11−1)(31−1)/4 = (−1)10·30/4 = (−1)5·15 = −1.
31 11

(4) This is asking 11 ∈ QR[31]? Since we know the Legendre symbol, we know the answer is
no.
4 NANEH APKARIAN

(5) Using the definition of the Jacobi symbol, we can say


  
5 5
J(5, 21) =
3 7
The small Legendre symbols are relatively easy to check via finding QR[3] and QR[7], and
we get   
5 5
J(5, 21) = = (−1)(−1) = 1.
3 7
But we can also use the iterative process to find the answer. That is:
J(5, 21) = J(21 (mod 5), 5)(−1)20·4/4
= J(1, 5)
=1

(6) Here we want to use the iterative method - since we’re unsure how to factor 866731.
J(17, 866731) = (866731 (mod 17), 17)(−1)866730·16/4
= J(3, 17)
= J(17 (mod 3), 3)(−1)2·16/4
(∗) = J(2, 3)
 
2
=J , 3 (−1)8/8
2
= J(1, 3)(−1)
= −1
Note that at (∗), we could also reasonably establish QR[3] and check for 2. Either works.
(7) Note how all of the following involve 24 and 601.
(a) We can easily factor 24 = 23 · 3. Since 601 is odd, it cannot share any power of 2 with
24, and also 601 is not divisible by 3. So, gcd(24, 601) = 1.
(b) We don’t know about the primality of 601, so we use the iterative process:
J(24, 601) = J(12, 601)(−1)(361200/8) = J(12, 601)
= J(6, 601)(−1)(361200/8) = J(6, 601)
= J(3, 601)(−1)(361200/8) = J(3, 601)
= J(601(mod 3), 3)(−1)(600)(2)/4
= J(1, 3)
=1

(c) Note that


24300 (mod 601) = 24(601−1)/2
And that
24300 (mod 601) ≡ 2900 · 3300 (mod 601) = ... ≡ 1 (mod 601)
Now we note that 601 has not failed any primality tests. While not deterministic, this gives
an indication that 601 might be prime.
EXAMPLES FROM SECTION ON 06/05/2013 5

3. Primitive Roots and Cyclotomic Polynomials


Professor Garsia posted some nice notes on this subject on the course website, take a look at
them for more detailed information than was presented on the slides.

(1) Find C18 (x).


(2) Is 4 a primitive root modulo 19?
(3) What is φ(18)?
(4) Here are the successive powers of 3 modulo 17:
k: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
3k : 3 9 10 13 5 15 11 16 14 8 7 4 12 2 6 1
(a) Which of these powers are also primitive roots modulo 29?
(b) Use the table to solve the equation:
13x ≡ 14 (mod 17)
(c) Use the table to solve the equation:
5x ≡ 2 (mod 17)

You might also like