Math 236: Discrete Mathematics with Applications
Tutorial 2: 23 February 2012
1. Determine which of the following pairs of integers are relatively prime (give reasons
for your answers):
(a)
(b)
(c)
(d)
14 and 42
33 and 18
45 and 108
24 and 2039, given that 2039 is a prime number
(a) Note that 14 = 2 · 7 and 42 = 2 · 3 · 7. Thus, 2|14 and 2|42, gcd(14, 42) ≥ 2 6= 1. Hence 14
and 42 are not relatively prime.
(b) Similarly to (a.), 3|33 and 3|18. Thus, gcd(33, 18) ≥ 3 6= 1. Hence 33 and 18 are not
relatively prime.
(c) Note that 45 = 3 · 3 · 5 and 108 = 2 · 2 · 3 · 3 · 3. Thus, gcd(45, 108) = 6 6= 1. Hence, 45 and
108 are not relatively prime.
(d) We are told that 2039 is a prime number. Thus, the only positive divisors of 2039 are 1
and 2039. Therefore, the only divisor of 24 which is also a divisor of 2039 is 1. Hence,
gcd(24, 2039) = 1 and 24 and 2039 are relatively prime.
2. Let R be a relation dened on Z by aRb if gcd(a, b) = 1. Determine, with justication,
whether R is: (i) reexive, (ii) symmetric, (iii) transitive
In this case, R is not reexive. We prove this by giving the following counter-example: 2 ∈ Z
and gcd(2, 2) = 2. Thus, 2 6R 2.
Let x, y ∈ Z. To prove that R is symmetric, we assume that xRy and we must show that yRx.
By our assumption that xRy , it follows that gcd(x, y) = 1. Thus, the greatest common divisor
of x and y is 1. But this means that the greatest common divisor of y and x is 1. Hence,
gcd(y, x) = 1. Thus, yRx.
In this case, R is not transitive. We prove this by giving the following counter-example: 2, 3, 4 ∈ Z
and 2R3 and 3R4. But, 2 6R 4.
3. Use the Division Algorithm to nd the following:
(a) gcd(8, 21)
(b) gcd(331, 1324)
(c) gcd(67942, 4209)
(a) Applying the Division algorithm:
i
0
1
2
3
4
pi
21
8
5
3
2
qi
8
5
3
2
1
ri
5
3
2
1
0
21 = 2 · 8 + 5
8=5+3
5=3+2
3=2+1
2=2·1+0
Thus, gcd(8, 21) = 1
(b) Applying the Division algorithm:
i
0
pi
1324
qi
331
ri
0
1324 = 4 · 331 + 0
Thus, gcd(1324, 331) = 331
(c) Applying the Division algorithm:
i
0
1
2
pi
67942
4209
598
qi
4209
598
23
ri
598
23
0
67942 = 16 · 4209 + 598
4209 = 7 · 598 + 23
598 = 26 · 23 + 0
Thus, gcd(67942, 4209) = 23
4. For each pair a, b of integers in the previous question, use the Extended Division
Algorithm to nd integers
s, t
such that
gcd(a, b) = sa + tb
(a) From the previous question we get:
gcd(8, 21) = 1
=3−2
= 3 − (5 − 3)
=2·3−5
= 2(8 − 5) − 5
=2·8−3·5
= 2 · 8 − 3(21 − 2 · 8)
= 8 · 8 − 3 · 21
Therefore, s = 8 and t = −3
(b) From the previous question we get that gcd(1324, 331) = 331. Therefore, s = 0 and t = 1
(c) From the previous question we get:
gcd(67942, 4209) = 23
= 4209 − 7 · 598
= 4209 − 7(67942 − 16 · 4209)
= −7 · 67942 + 113 · 4209
Therefore, s = −7 and t = 113
5. Find, where possible, each of the following:
(a)
(b)
(c)
(d)
(e)
8−1 ∈ Z21
331−1 ∈ Z1324
4209−1 ∈ Z67942
337−1 ∈ Z490256
110−1 ∈ Z273
Hint: Make use of questions 3 and 4, where applicable
(a)
(b)
(c)
(d)
From (3.a) and (4.a), gcd(8, 21) = 1 = 8 · 8 − 3 · 21. Thus, 8−1 exists in Z21 and 8−1 = 8.
From (3.b), gcd(1324, 331) = 331. Thus, 331−1 does not exist in Z1324 .
From (3.c), gcd(67942, 4209) = 23. Thus, 4209−1 does not exist in Z67942 .
Applying the Division algorithm:
i
0
1
2
3
4
5
pi
490256
337
258
79
21
16
qi
337
258
79
21
16
5
ri
258
79
21
16
5
1
490256 = 1454 · 337 + 258
337 = 258 + 79
258 = 3 · 79 + 21
79 = 3 · 21 + 16
21 = 16 + 5
16 = 3 · 5 + 1
Thus, gcd(490256, 337) = 1. So, 337−1 exists in Z490256 . Applying the Extended Division
Algorithm,
1 = 16 − 3 · 5
= 16 − 3(21 − 16)
= −3 · 21 + 4 · 16
= −3 · 21 + 4(79 − 3 · 21)
= 4 · 79 − 15 · 21
= 4 · 79 − 15(258 − 3 · 79)
= −15 · 258 + 49 · 79
= −15 · 258 + 49(337 − 258)
= 49 · 337 − 64 · 258
= 49 · 337 − 64(490256 − 1454 · 337)
= −64 · 490256 + 93105 · 337
Thus, 337−1 = 93105 in Z490256 .
6. Let a and b be relatively prime integers. Assume that a|c and b|c, where c is an
integer. Prove that (ab)|c
Since a and b are relatively prime, gcd(a, b) = 1. Thus, there exist integers s and t such that
1 = sa + tb.
(1)
Multiplying this equation by c, we get that
c = sac + tbc.
(2)
By the assumption that a|c and b|c, it follows that there exist integers u and v such that c = ua
and c = vb. This allows us to rewrite equation 2 as follows:
c = savb + tbua
= ab(sv + tu).
Since sv + tu ∈ Z, ab|c.
7. If a and b are positive integers with a > b, show that
gcd(a, b) = gcd(a, a − b)
Let d = gcd(a, b). Thus, d|a and d|b. Therefore, there exist integers s and t such that a = ds
and b = dt. Thus,
a − b = ds − dt
= d(s − t).
Since s − t ∈ Z, d|(a − b). Therefore, d is a common divisor of a and a − b. All we need to show
is that d the the greatest common divisor of a and a − b.
To do that, let p be a common divisor of a and a − b. We will show that d ≥ p. Since p is a
common divisor of a and a − b, p|a and p|(a − b). Therefore, there exist integers u and v such
that a = pu and a − b = pv . Now,
b = a − pv
= pu − pv
= p(u − v).
Hence, p|b. Thus, p is a common divisor of a and b. But since d is the greatest common divisor
of a and b, it follows that d ≥ p. This proves the result.
8.
(a) Give an example of positive integers p, a, and b where p|ab, but p - a and p - b
(b) Show that if p is a prime number, and a and b are positive integers such that
p|ab,
then
p|a
or p|b
(a) Consider p = 6, a = 4 and b = 3. Now, 6|(4 × 3) and 66 | 4 and 66 | 3.
(b) Let a and b be positive integers and let p be a prime number such that p|ab. Assume that
p does not divide a (that is, assume that p6 | a). We will prove that p|b.
By our assumption, p 6 { |}a. This implies that p is not a common factor of p and a. Since p
is prime, the only positive factors of p are 1 and p. Thus the only common factor of p and
a is 1. Hence,
gcd(p, a) = 1
This implies that there exist integers s and t such that
1 = sp + ta
Multiplying the equation by b we get that
b = spb + tab
Since p|ab, there exists and integer u such that ab = up. Hence,
b = spb + tup
= p(sb + tu)
Since sb + tu ∈ Z, p|b and the result is proved.
9. Let m and n be relatively prime positive integers. Let f : Zm −→ Zm be a function
dened by f (x) = nx mod m. Prove that f is one-to-one. See page 88 for a denition
of mod m
To prove that f is one-to-one, let x, y ∈ Zm such that f (x) = f (y). We show that x = y .By
dention of f , f (x) = f (y) implies that
nx mod m = ny mod m
This implies that
nx ≡ ny
Since gcd(m, n) = 1, n
−1
(mod m)
exists in Zm . Hence,
n−1 · nx ≡ n−1 · ny
(mod m)
and
x≡y
(mod m)
Therefore, m|(x − y). That is, x = y + mt for some t ∈ Z. Since x and y are both elements of
Zm , t must equal 0. Hence, x = y and f is one-to-one.
10. Calculate each of the following:
(a)
(b)
(c)
(d)
(e)
(f)
(g)
φ(14), φ(15), (16), φ(17), φ(25)
φ(123)
φ(211 )
φ(6889): Note 6889 = 832 and 83
φ(4657)
φ(15600)
φ(23328)
(a)
(b)
(c)
(d)
(e)
(f)
(g)
φ(14) = 6, φ(15) = 8, (16) = 8, φ(17) = 16, φ(25) = 20
φ(123) = 80
φ(211 ) = 1024
φ(6889) = 6806
φ(4657) = 4656
φ(15600) = 3840
φ(23328) = 7776
is prime
11. Estimate the number of prime numbers that are less than or equal to 999999
π(999999 ) ≈
999999
ln(999999 )
=
999998
ln(999)
12. Use Fermat's Little Theorem to answer the following question: Is 1720 prime?
Hint:
21720
mod 1720 = 656
If 1720 where prime, then gcd(2, 1720) would be 1 and hence
21720−1 ≡ 1
This would imply that 2
1720
(mod 1)720
≡ 2 (mod 1)720. But this is not true, since 21720 mod 1720 = 656.
13. Use the Square and Multiply Algorithm to determine the remainder when 1561 is
divided by 26
Note that 61 = 25 + 24 + 23 + 22 + 1. So,
5
1561 = 152
+24 +23 +22 +1
5
4
3
2
3
2
= 152 · 152 · 152 · 152 · 151
24
4
3
2
· 152 · 152 · 152 · 151
= 152
24
· 152 · 152 · 151
≡ (17 · 15)
≡ 212 · 15
2
≡ 21
≡ 15
· 15
2
2
· 152 · 151
2
· 151
1
(mod 2)6
≡ 112 · 15
2
23
(mod 2)6
(mod 2)6
(mod 2)6
Hence, the remainder when 1561 is divided by 26 is 15.
(mod 2)6
© Copyright 2026 Paperzz