0% found this document useful (0 votes)
5 views10 pages

Tutorial 8: Number Theory I

The document is a tutorial on number theory, covering concepts such as modular arithmetic, multiplicative inverses, and properties of integers. It includes problems and solutions related to modular equations and divisibility. Key topics include proving statements about modular arithmetic and determining the existence of solutions in modular equations.

Uploaded by

王少甫
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views10 pages

Tutorial 8: Number Theory I

The document is a tutorial on number theory, covering concepts such as modular arithmetic, multiplicative inverses, and properties of integers. It includes problems and solutions related to modular equations and divisibility. Key topics include proving statements about modular arithmetic and determining the existence of solutions in modular equations.

Uploaded by

王少甫
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Tutorial 8: Number theory I

Department of Computer Science and Engineering


Hong Kong University of Science and Technology

Tutorial 8: Number theory I 1 / 10


Question 1

(a) Let m and n be two positive integers such that m divides n,


i.e., n = sm for some other integer s. Show that, for any
integer x,

(x mod n) mod m = x mod m.

(b) For each number in Z8 , state if it has a multiplicative inverse


mod 8, and if it has, state its inverse. There is no need to
explain your answer.

Tutorial 8: Number theory I 2 / 10


Question 1

Solution:
(a) Let x mod n = r1 . Then x = q1 n + r1 for some integer q1 .
Further let r1 mod m = r2 . Then r1 = q2 m + r2 for some
integer q2 . Hence,

x = q1 n + q2 m + r2 = q1 sm + q2 m + r2 = (q1 s + q2 )m + r2

where 0 ≤ r2 < m. Consequently,

x mod m = r2 = (x mod n) mod m.

(b) 0 has no inverse; 1’s inverse is 1; 2 has no inverse; 3’s inverse


is 3; 4 has no inverse; 5’s inverse is 5; 6 has no inverse; 7’s
inverse is 7.

Tutorial 8: Number theory I 3 / 10


Question 2

Let a, m and n be three positive integers that are larger than 1. Is


each of the following statements true or false? If it is true, give a
proof. If it is false, give a counterexample.
(a) (a mod mn) mod n = a mod n.
(b) (a mod mn) mod n = a mod m.
(c) If a mod n = 1, then gcd(a, n) = 1.
(d) If gcd(a, n) = 1, then a mod n = 1.

Tutorial 8: Number theory I 4 / 10


Question 2
Solution:
(a) This is true. According to Euclid’s Division Theorem, there
exist q1 and r1 such that

a = q1 mn + r1 , 0 ≤ r1 < mn,

where r1 = (a mod mn). Similarly, there exist q2 and r2 such


that

r1 = q2 n + r2 , 0 ≤ r2 < n,

where r2 = r1 mod n = (a mod mn) mod n. Combining the


two equations, we get

a = (q1 m + q2 )n + r2 , 0 ≤ r2 < n.

Hence, a mod n = r2 . Consequently,

(a mod mn) mod n = r2 = a mod n.


Tutorial 8: Number theory I 5 / 10
Question 2

(b) This is false. Let a = 8, m = 2 and n = 3. We have

(a mod mn) mod n = (8 mod 6) mod 3 = 2,


a mod m = 8 mod 2 = 0.

(c) This is true. a mod n = 1 implies that there exist q such that
a = qn + 1, or a − qn = 1. The latter equation implies that
any common divisor of a and n must divide 1, hence must be
1. Therefore, gcd(a, n) = 1.
(d) This is false. For example, gcd(5, 3) = 1, but 5 mod 3 = 2.

Tutorial 8: Number theory I 6 / 10


Question 3

Let a, b, m and n be positive integers. Suppose

a mod m = b mod m, n|m.

Prove the following equations:


(a) a mod n = b mod n.
(b) a2 mod m = b 2 mod m.

Tutorial 8: Number theory I 7 / 10


Question 3
Solution:
(a) Since n|m, it holds that m = tn for some integer t. Moreover,
a mod m = b mod m implies (a − b) mod m = 0, which in
turn implies there exists integer q such that

(a − b) = qm
→ (a − b) = qtn.

So n divides (a − b). This implies (a − b) mod n = 0, which


in turn implies a mod n = b mod n.
(b) As shown earlier, (a − b) = qm for some q. Multiplying both
sides with (a + b), we get

a2 − b 2 = (a + b)(a − b) = (a + b)qm.

So m divides a2 − b 2 . This implies that a2 − b 2 mod m = 0,


which in turn implies that a2 mod m = b 2 mod m.
Tutorial 8: Number theory I 8 / 10
Question 4

Does there exist an x in Z154 that solves

21 ·154 x = 5?

if yes, give the value of x (it is not necessary to show your work).
If no, prove that such an x does not exist.

Tutorial 8: Number theory I 9 / 10


Question 4
Solution:
No. First note that 21 = 3 · 7 and 154 = 22 · 7.
If there was such an x then 21x = 154q + 5 for some q.
Then 5 = 21x − 154q = 7(3x − 22q)
Since 7 does not divide 5, this is impossible.
Note that to solve this problem it would not have been enough to
say that “gcd(21, 154) = 7 6= 1 so 21 does not have an inverse in
Z154 .”
Some problems in the form

21 ·154 x = b

actually do have solutions x ∈ Z154 . For example

21 ·154 x = 42

has the solution x = 2.


Tutorial 8: Number theory I 10 / 10

You might also like