3.2: Modulo Arithmetic
( \newcommand{\kernel}{\mathrm{null}\,}\)
In this section, we will explore arithmetic operations in a modulo world.
Let n∈Z+.
Theorem 5 :
Let a,b,c,d,∈Z such that a≡b(modn) and c≡d(modn). Then (a+c)≡(b+d)(modn).
- Proof:
-
Let a,b,c,d∈Z, such that a≡b(modn) and c≡d(modn).
We shall show that (a+c)≡(b+d)(modn).
Since a≡b(modn) and c≡d(modn),n∣(a−b) and n∣(c−d)
Thus a=b+nk, and c=d+nl, for k and l∈Z.
Consider(a+c)−(b+d)=a−b+c−d=n(k+l),k+l∈Z.
Hence (a+c)≡(b+d)(modn).◻
Theorem 6:
Let a,b,c,d,∈Z such that a≡b(modn) and c≡d(modn). Then (ac)≡(bd)(modn).
- Proof:
-
Let a,b,c,d∈Z, such that a≡b(modn) and c≡d(modn).
We shall show that (ac)≡(bd)(modn).
Since a≡b(modn) and c≡d(modn),n∣(a−b) and n∣(c−d)
Thus a=b+nk, and c=d+nl, for k and l∈Z.
Consider (ac)−(bd)=(b+nk)(d+nl)−bd=bnl+dnk+n2lk=n(bl+dk+nlk), where (bl+dk+nlk)∈Z.
Hence (ac)≡(bd)(modn).◻
Theorem 7:
Let a,b∈ Z such that a≡b(modn). Then a2≡b2(modn).
- Proof:
-
Let a,b∈ Z, and n ∈ Z+, such that a≡b(modn).
We shall show that a2≡b2(modn).
Since a≡b(modn),n∣(a−b).
Thus (a−b)=nx, where x∈ Z.
Consider (a2−b2)=(a+b)(a−b)=(a+b)(nx),=n(ax+bx),ax+bx∈Z.
Hence n∣a2−b2, therefore a2≡b2(modn). ◻
Theorem 8:
Let a,b∈ Z such that a≡b(modn). Then am≡bm(modn), ∀∈ Z.
- Proof:
-
Exercise.
By using the above result we can solve many problems. Some of them are discussed below:
Example 3.2.1: mod3 Arithmetic
Let n=3.
Addition
+ | [0] | [1] | [2] |
[0] | [0] | [1] | [2] |
[1] | [1] | [2] | [0] |
[2] | [2] | [0] | [1] |
Multiplication
x | [0] | [1] | [2] |
[0] | [0] | [0] | [0] |
[1] | [0] | [1] | [2] |
[2] | [0] | [2] | [1] |
Example 3.2.2: mod4 Arithmetic
Let n=4.
x | [0] | [1] | [2] | [3] |
[0] | [0] | [0] | [0] | [0] |
[1] | [0] | [1] | [2] | [3] |
[2] | [0] | [2] | [0] | [2] |
[3] | [0] | [3] | [2] | [1] |
Example 3.2.3:
Find the remainder when (101)(103)(107)(109) is divided by 11.
- Answer
-
101≡2(mod11)
103≡4(mod11)
107≡8(mod11)
109≡10(mod11).
Therefore,
(101)(103)(107)(109)≡(2)(4)(8)(10)(mod11)≡2(mod11).
Example 3.2.4:
Find the remainder when71453 is divided by 8.
- Answer
-
70≡1(mod8)
71≡7(mod8)
72≡1(mod8)
73≡7(mod8),
As there is a consistent pattern emerging and we know that 1453 is odd, then 71453≡7(mod8). Thus the remainder is 7.
Example 3.2.5:
Find the remainder when 72020 is divided by 18.
- Answer
-
70≡1(mod18)
71≡7(mod18)
72≡13(mod18)
73≡1(mod18),
As there is a consistent pattern emerging and we know that 2020=(673)3+1, 72020=7(673)3+1=(73)67371≡7(mod18). Thus the remainder is 7.
Example 3.2.6:
Find the remainder when 261453 is divided by 3.
Odd and Even integers:
An integer n is even iff n≡0(mod2).
An integer n is odd iff n≡1(mod2).
Two integers a and b are said to have some parity if they are both even or both odd otherwise a and b are said to have different parity.
Example 3.2.6:
Show that the sum of an odd integer and an even integer is odd.
- Answer
-
Proof: Let a be an odd integer and let b be an even integer. We shall show that a+b is odd by using the language of congruency.
Since a is odd, a≡1(mod2).
Since b is even, b≡0(mod2).
Then (a+b)≡(1+0)(mod2),
(a+b)≡1(mod2).
Hence a+b is odd.◻
Example 3.2.7:
Show that the product of an odd integer and an even integer is even.
- Answer
-
Proof: Let a be an odd integer and let b be an even integer. We shall show that ab is even by using the language of congruency.
Since a is odd, a≡1(mod2).
Since b is even, b≡0(mod2).
Then (ab)≡(1)(0)(mod2),
(ab)≡0(mod2).
Hence ab is even.◻
Example 3.2.8:
Show that n2+1 is not divisible by 3 for any integer n.
- Answer
-
Proof: Let n∈Z. We shall show that (n2+1) is not divisible by 3 using the language of congruency.
We shall show that (n2+1)(mod3)≢0 by examining the possible cases.
Case 1: n≡0(mod3).
n2≡02(mod3).
(n2+1)≡1(mod3).
Hence n2+1 is not divisible by 3.
Case 2: n≡1(mod3).
n2≡12(mod3).
(n2+1)≡1(mod3).
Hence n2+1 is not divisible by 3.
Case 3: n≡2(mod3).
n2≡22(mod3)≡1(mod3).
(n2+1)≡2(mod3).
Hence n2+1 is not divisible by 3.
Since none of the possible cases is congruent to 0(mod3),n2+1 is not divisible by 3. ◻
Example 3.2.9:
Show that 5∣a5+4a for any integer a.
- Answer
-
Notice that 4≡−1(mod5). Therefore, 5∣a5+4a iff 5∣a5−a for all integer a.
We will proceed by examining the 5 possible cases of \(
. \) Specifically,
.
Having examined all possible cases,
.◻
- Answer
-
Thus
. Rearranging, we obtain
.
Clearly,
. We shall examine the possible cases of
.
ISBN Check Digit
ISBN is the abbreviation for the International Standard Book Number. ISBN numbers are 10 digits in length. In an ISBN of the form X-XX-XXXXXX-X:
- The first block of digits on the left represents the language of the book (0 is used to represent English).
- The second block of digits represents the publisher.
- The third block of digits represents is the number assigned to the book by the publishing company.
- The fourth block consists of the check digit.
Consider the ISBN 0-13-190190-?
To determine the check digit for this Book Number, follow the below steps.
Step 1: Multiply all nine assigned digits by weighted values. The weighted values are 1 for the first digit from the left, 2 for the second digit, three for the third digit, etc.
1∗0+2∗1+3∗3+4∗1+5∗9+6∗0+7∗1+8∗9+9∗0=139.
Step 2: ISBN uses (mod11) to determine the check digit. So 139=11(11)+7 so 139≡7(mod11). Hence the check digit is 7. Note that X is used for 10.
If someone orders a book by the ISBN number then the check digit is a way of ensuring that the number was reported and recorded correctly so that the correct book is obtained.