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

Modular 3

This document discusses modular arithmetic and two related topics: 1. Euclid's algorithm for finding the greatest common divisor (GCD) of two numbers and expressing one number as a linear combination of the other. 2. The Chinese remainder theorem, which guarantees a solution exists to a system of congruences when the moduli are pairwise relatively prime. It provides examples of using these methods to solve problems like finding values that satisfy multiple congruences or the smallest positive number satisfying a system of congruences.

Uploaded by

Monny MOM
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)
64 views10 pages

Modular 3

This document discusses modular arithmetic and two related topics: 1. Euclid's algorithm for finding the greatest common divisor (GCD) of two numbers and expressing one number as a linear combination of the other. 2. The Chinese remainder theorem, which guarantees a solution exists to a system of congruences when the moduli are pairwise relatively prime. It provides examples of using these methods to solve problems like finding values that satisfy multiple congruences or the smallest positive number satisfying a system of congruences.

Uploaded by

Monny MOM
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

MODULAR ARITHMETIC III

PETER MCNAMARA
Bucknell University
and Trinity College Dublin

Main definition
a≡b (mod m) if
m | a−b i.e. m divides a − b.

This is equivalent to a and b having the same remainder under


division by m.

Motivating Problem.
We know how to find k that satisfies 77k ≡ 1 (mod 100). How?

Now find k that satisfies 77k ≡ 1 (mod 100).

1
2

1. EUCLID’S ALGORITHM
Two problems:
(a) Find gcd(153, 442) = d .
(b) Find r and s such that r (153) + s(442) = d .

Euclid’s Algorithm, also know as the Euclidean Algorithm, answers


both of these questions quickly.
442 = 2 . 153 + 136 d = gcd(153, 136)

153 = 1 . 136 + 17 d = gcd(136, 17)

136 = 8 . 17 + 0 d = gcd(17, 0) = 17

Now work backwards to find r and s:


17 = 153 − 1 . 136

= 153 − (442 − 2 . 153)

= 3 . 153 − 442.

Answer: r = 3 and s = −1
3

Problem 1. Find some k so that 77k ≡ 1 (mod 100).

Solution.

Claim. If gcd(m, n) = 1, then there exists r with rm ≡ 1 (mod n).


Proof of Claim. By Euclid’s Algorithm, 1 = rm + sn for some r
and s.
Therefore, rm ≡ 1 − sn ≡ 1 (mod n), as required.

In seats. Use Euclid’s Algorithm on 100 and 77 to solve Problem


1.
4

100 = 1 . 77 + 23

77 = 3 . 23 + 8

23 = 2 . 8 + 7

8 = 1.7 + 1

7 = 7.1 + 0

Now work backwards:

1=8−7

= 8 − (23 − 2 . 8)

= 3 . 8 − 23

= 3(77 − 3 . 23) − 23

= 3 . 77 − 10 . 23

= 3 . 77 − 10(100 − 77)

= 13 . 77 − 10 . 100

Thus
13 . 77 ≡ 1 + 10 . 100 ≡ 1 (mod 100).

Answer: 13
5

Problem 2. Using the result of Problem 1, find 7777 (mod 100)


in a fancier way than before.

Solution. 2 things we know:


1. 77 . 13 ≡ 1 (mod 100).
2. 77φ(100) ≡ 1 (mod 100).
What’s φ(100)?
φ(100) = φ(4 . 25) = φ(2252) = (22 − 2)(52 − 5) = 40.

We get

7740 ≡ 1 (mod 100)

7780 ≡ 1 (mod 100)

13 . 7780 ≡ 13 (mod 100)

13 . 77 . 7779 ≡ 13 (mod 100)

1 . 7779 ≡ 13 (mod 100)

Multiply twice more by 13 to wither it down to

7777 ≡ 133 (mod 100)

≡ 97 (mod 100).
6

2. CHINESE REMAINDER THEOREM


6, 10, 15 are coprime since gcd(6, 10, 15) = 1 but they are not
pairwise coprime since
gcd(6, 10) = 2,
gcd(6, 15) = 3,
gcd(10, 15) = 5.

Chinese Remainder Theorem. Given integers n1, n2, ... , nk that


are pairwise coprime and any integers a1, a2, ... , ak , then there exists
an integer x such that

x ≡ a1 (mod n1),

x ≡ a2 (mod n2),

x ≡ a3 (mod n3),
... ... ...

x ≡ ak (mod nk ).

Furthermore, if x 0 is another solution of this system then


x0 ≡ x (mod n1n2 · · · nk ).
7

Proof (as time permits). Since n1 and n2 are coprime, we can find
r and s such that
1 = r n1 + s n 2 .

So
s n 2 ≡ 1 − r n1 ≡ 1 (mod n1),
r n1 ≡ 1 − s n 2 ≡ 1 (mod n2).

The trick: let x = a1 s n2 + a2 r n1.


x ≡ a1 s n2 + 0 ≡ a1 (mod n1),
x ≡ 0 + a2 r n 1 ≡ a2 (mod n2).

Now consider n3, and use the same technique to find y such that
y ≡ a3 (mod n3),
y ≡x (mod n1n2),

so
y ≡ x ≡ a1 (mod n1),
y ≡ x ≡ a2 (mod n2).

And so on...
If x 0 is another solution, then x 0 −x is divisible by n1, n2, ... , nk . Since
the ni have no common factors, x 0 − x is divisible by n1n2 · · · nk ,
i.e.,
x0 ≡ x (mod n1n2 · · · nk ).
8

Example. Find the smallest positive integer n such that n leaves


a remainder of 10 on division by 33 and n leaves a remainder of 13
on division by 47.
In other words,
n ≡ 10 (mod 33),
n ≡ 13 (mod 47).

As before, can work out that


1 = 10 . 33 − 7 . 47.

In seats:
n = a1 s n2 + a2 r n1

= 10 . (−7) . 47 + 13 . 10 . 33

= 10(13 . 33 − 7 . 47)

= 10(429 − 329)

= 1000 .

Important: is this the smallest solution?


Any other solution x satisfies

x ≡ 1000 (mod 33 . 47 = 1551).

Since 0 ≤ 1000 < 1551, it must be that 1000 is the smallest


positive solution.
9

Problem 3. Find the smallest positive n such that

n ≡ 1 (mod 2),

n ≡ 2 (mod 3),

n ≡ 3 (mod 4),

n ≡ 4 (mod 5),

n ≡ 5 (mod 6),

n ≡ 6 (mod 7),

n ≡ 7 (mod 8),

n ≡ 8 (mod 9),

n ≡ 9 (mod 10).

Solution. One solution is −1, except that it is not positive. We


know that n must satisfy
n ≡ −1 (mod n1n2 · · · nk )

except that 2, 3, ... , 10 are not pairwise relatively prime. Instead


consider the system

n ≡ 4 (mod 5),

n ≡ 6 (mod 7),

n ≡ 7 (mod 8),

n ≡ 8 (mod 9).
10

We check that every solution of this new system is a solution of the


original system, and vice versa. Now we have that our moduli of 5,
7, 8, 9 are pairwise relatively prime. So
n ≡ −1 (mod 5 . 7 . 8 . 9)

.
The first positive solution is n = −1 + 5 . 7 . 8 . 9 = −1 + 2520 =
2519 .

You might also like