Homework 2 Solutions - WVU Math Department

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)
€ ∃d ∈ Z such €
Since a|bc , then
that ad = bc .
(2)
€ sides of (2) by v: €adv = avc .
€ Multiplying both
(3)
€ (1): bv =1− au€ and substituting into (3):
€ Rearranging
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)
€
€
so, 11−1 ≡ −17 ≡ 30(mod 47)
d =
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)
€
so, 345−1 ≡114(mod 587)
d =
1
u =
€
114
v =
-67
(2) >> powermod(345,585,587)
ans =
114
(c) p =104801, a = 78467
(1) >> [d,u,v]=gcd(78467,104801)
€
so, 78467−1 ≡1763(mod104801)
d =
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
so 2 is not a primitive root mod7
1
(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
so 2 is a primitive root mod13
1
(iii) p =19
>> X=[]; for x=1:18; y=powermod(2,x,19); X=[X,y];end
€
>> X
so 2 is a primitive root mod19
X =
Columns 1 through 9
2
4
8
16
13
7
14
9
18
6
12
5
10
1
Columns 10 through 18
17
15
11
3
(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
8
16
9
18
13
Columns 10 through 18
12
1
2
4
Columns 19 through 22
3
6
12
so 2 is not a primitive root mod23
1
(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
so 3 is a primitive root mod5
1
(ii) p = 7
>> X=[]; for x=1:6; y=powermod(3,x,7); X=[X,y];end
€
>> X
X =
3
2
6
4
5
so 3 is a primitive root mod7
1
(iii) p =11
>> X=[]; for x=1:10; y=powermod(3,x,11); X=[X,y];end
€
so 3 is not a primitive root mod11
>> X
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
9
22
18
Columns 13 through 16
12
2
6
so 3 is a primitive root mod17
1
(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
so 5 is a primitive root mod23
X =
Columns 1 through 12
5
2
10
4
20
8
17
16
11
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
so 2 is a primitive root mod29
X =
Columns 1 through 12
2
4
8
16
3
6
12
24
19
9
18
7
21
13
26
23
17
5
10
20
Columns 13 through 24
14
28
27
25
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
30
5
35
40
34
33
26
18
28
32
19
10
29
39
27
25
Columns 13 through 24
12
2
14
16
Columns 25 through 36
3
21
24
4
Columns 37 through 40
11
36
6
so 7 is a primitive root mod41
1
(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
26
35
19
14
42
40
34
16
18
11
33
13
39
31
7
21
Columns 13 through 24
12
36
22
23
Columns 25 through 36
5
15
2
6
Columns 37 through 42
20
17
8
24
[4] (5 pts) p54, Problem 1.34, part (b)
29
1
[omit]
so 3 is a primitive root mod43
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 a 2 ≡ b(mod p) , it follows that (−a) 2 ≡ a 2 ≡ 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.
€
€
€
€ that for some c ∈ Z ,
We need to show that b cannot have more than 2 €
square roots. Suppose
p
€
€
€
2
2
2
c ≡/ a(mod p) and c ≡/ −a(mod p) but c ≡ b(mod p) . Then we have a ≡ b ≡ c (mod p), or
equivalently, (a − c )(a + c ) ≡ a 2 − c 2 ≡ b − b ≡ (mod p) . This means p|(a + c )(a − c ) . If p|(a − c ) , then
to the
c ≡ a(mod p) ; if p|(a + c ) , then c ≡ −a(mod p) . Either way will lead to a contradiction
€
assumptions
b must have exactly two square roots, if it
€ that c ≡/ a(mod€p) and c ≡/ −a(mod p) . Thus, €
has at least one. 
€
€
€
€
€
€
€