Math 373/578, Spring 2013 due: Thursday, February 7, 2013
Homework 2 Solutions (fixed)
Section 1.4
Written problems
[1] (5 pts) p53, Problem 1.27
Without using the fact that every integer has a unique factorization into primes, prove that if gcd(a,b) = 1 and if
€
a|bc , then
€
a|c .
proof: Let
€
a,b,c ∈ Z . Suppose
€
gcd(a,b) =1 and
€
a|bc .
Since
€
gcd(a,b) =1, then
€
∃u,v ∈ Z such that
€
au + bv =1. (1)
Since
€
a|bc , then
€
∃d ∈ Z such that
€
ad = bc . (2)
Multiplying both sides of (2) by v:
€
adv = avc . (3)
Rearranging (1):
€
bv =1−au and substituting into (3):
€
adv = (1−au)c ⇒ adv = c − cau ⇒ adv + cau = c ⇒ a(dv + cu) = c
Since
€
d,c ,u,v ∈ Z , then
€
dv + cu ∈ Z , so
€
a|c .
Section 1.5
Computational problems
[2] (5 pts) p53, Problem 1.30
For each of the following primes p and numbers a, compute
€
a−1(mod p) in two different ways.
(a)
€
p = 47, a =11
(1) >> [d,u,v]=gcd(11,47)
d = so,
€
11−1 ≡ −17≡ 30(mod 47)
1
u =
-17
v =
4
(2) >> powermod(11,45,47)
ans =
30
Math 373/578, Spring 2013 due: Thursday, February 7, 2013
(b)
€
p = 587, a = 345
(1) >> [d,u,v]=gcd(345,587)
d = so,
€
345−1 ≡114(mod 587)
1
u =
114
v =
-67
(2) >> powermod(345,585,587)
ans =
114
(c)
€
p =104801, a = 78467
(1) >> [d,u,v]=gcd(78467,104801)
d = so,
€
78467−1 ≡1763(mod104801)
1
u =
1763
v =
-1320
(2) >> powermod(78467,104799,104801)
ans =
1763
[3] (5 pts) p53, Problem 1.32, parts (a), (b), & (c)
Recall that g is a primitive root modulo p if the powers of g give all the nonzero elements of
€
Fp .
(a) For which of the following primes is 2 a primitive root modulo p?
Math 373/578, Spring 2013 due: Thursday, February 7, 2013
(i)
€
p = 7
>> X=[]; for x=1:6; y=powermod(2,x,7); X=[X,y];end
>> X
X =
2 4 1 2 4 1 so 2 is not a primitive root mod7
(ii)
€
p =13
>> X=[]; for x=1:12; y=powermod(2,x,13); X=[X,y];end
>> X
X =
Columns 1 through 9
2 4 8 3 6 12 11 9 5
Columns 10 through 12
10 7 1 so 2 is a primitive root mod13
(iii)
€
p =19
>> X=[]; for x=1:18; y=powermod(2,x,19); X=[X,y];end
>> X
X = so 2 is a primitive root mod19
Columns 1 through 9
2 4 8 16 13 7 14 9 18
Columns 10 through 18
17 15 11 3 6 12 5 10 1
(iv)
€
p = 23
>> X=[]; for x=1:22; y=powermod(2,x,23); X=[X,y];end
>> X
Math 373/578, Spring 2013 due: Thursday, February 7, 2013
X =
Columns 1 through 9
2 4 8 16 9 18 13 3 6
Columns 10 through 18
12 1 2 4 8 16 9 18 13
Columns 19 through 22
3 6 12 1 so 2 is not a primitive root mod23
(b) For which of the following primes is 3 a primitive root modulo p?
(i)
€
p = 5
>> X=[]; for x=1:4; y=powermod(3,x,5); X=[X,y];end
>> X
X =
3 4 2 1 so 3 is a primitive root mod5
(ii)
€
p = 7
>> X=[]; for x=1:6; y=powermod(3,x,7); X=[X,y];end
>> X
X =
3 2 6 4 5 1 so 3 is a primitive root mod7
(iii)
€
p =11
>> X=[]; for x=1:10; y=powermod(3,x,11); X=[X,y];end
>> X so 3 is not a primitive root mod11
X =
3 9 5 4 1 3 9 5 4 1 1
Math 373/578, Spring 2013 due: Thursday, February 7, 2013
(iv)
€
p =17
>> X=[]; for x=1:16; y=powermod(3,x,17); X=[X,y];end
>> X
X =
Columns 1 through 12
3 9 10 13 5 15 11 16 14 8 7 4
Columns 13 through 16
12 2 6 1 so 3 is a primitive root mod17
(c) Find a primitive root for each of the following primes.
(i)
€
p = 23
>> X=[]; for x=1:22; y=powermod(5,x,23); X=[X,y];end
>> X
X = so 5 is a primitive root mod23
Columns 1 through 12
5 2 10 4 20 8 17 16 11 9 22 18
Columns 13 through 22
21 13 19 3 15 6 7 12 14 1
(ii)
€
p = 29
>> X=[]; for x=1:28; y=powermod(2,x,29); X=[X,y];end
>> X
X = so 2 is a primitive root mod29
Columns 1 through 12
2 4 8 16 3 6 12 24 19 9 18 7
Columns 13 through 24
14 28 27 25 21 13 26 23 17 5 10 20
Columns 25 through 28
11 22 15 1
Math 373/578, Spring 2013 due: Thursday, February 7, 2013
(iii)
€
p = 41
>> X=[]; for x=1:40; y=powermod(7,x,41); X=[X,y];end
>> X
X =
Columns 1 through 12
7 8 15 23 38 20 17 37 13 9 22 31
Columns 13 through 24
12 2 14 16 30 5 35 40 34 33 26 18
Columns 25 through 36
3 21 24 4 28 32 19 10 29 39 27 25
Columns 37 through 40
11 36 6 1 so 7 is a primitive root mod41
(iv)
€
p = 43
>> X=[]; for x=1:42; y=powermod(3,x,43); X=[X,y];end
>> X
X =
Columns 1 through 12
3 9 27 38 28 41 37 25 32 10 30 4
Columns 13 through 24
12 36 22 23 26 35 19 14 42 40 34 16
Columns 25 through 36
5 15 2 6 18 11 33 13 39 31 7 21
Columns 37 through 42
20 17 8 24 29 1 so 3 is a primitive root mod43
[4] (5 pts) p54, Problem 1.34, part (b) [omit]
Math 373/578, Spring 2013 due: Thursday, February 7, 2013
For Math 578 students only:
[5] (10 pts) p54, Problem 1.34, part (a)
Let p be an odd prime number and let b be an integer with
€
p / | b . Prove that either b has two square roots modulo p or else b has no square roots modulo p.
In other words, prove that the congruence
€
X 2 ≡ b(mod p) has either two solutions or no solutions in
€
Z p .
(What happens for p = 2? What happens if
€
p|b ?)
proof: It suffices to show that if b has at least one square root modulo p, then b must have exactly two square roots modulo p.
Suppose that a is a square root of b modp. Since
€
p / | b , then
€
a / ≡ 0(mod p) . Therefore
€
p / | a and thus
€
gcd(a, p) =1.
Since
€
a2 ≡ b(mod p), it follows that
€
(−a)2 ≡ a2 ≡ b(mod p) and so –a must also be a square root of b (modp). We need to explain that
€
a / ≡ −a(mod p) . If we had
€
a ≡ −a(mod p) , then
€
2a ≡ 0(mod p), so
€
p|(2a). Since
€
gcd(a, p) =1 and
€
p|(2a), then
€
p|2, which is contrary to p being prime. Hence,
€
a / ≡ −a(mod p) , and so b has at least two square roots.
We need to show that b cannot have more than 2 square roots. Suppose that for some
€
c ∈ Z p ,
€
c / ≡ a(mod p) and
€
c / ≡ −a(mod p) but
€
c 2 ≡ b(mod p). Then we have
€
a2 ≡ b ≡ c 2(mod p), or
equivalently,
€
(a − c )(a + c ) ≡ a2 − c 2 ≡ b −b ≡ (mod p) . This means
€
p|(a + c )(a − c ). If
€
p|(a − c ), then
€
c ≡ a(mod p) ; if
€
p|(a + c ), then
€
c ≡ −a(mod p) . Either way will lead to a contradiction to the assumptions that
€
c / ≡ a(mod p) and
€
c / ≡ −a(mod p) . Thus, b must have exactly two square roots, if it has at least one.