Professional Documents
Culture Documents
GEC 4 Lesson 3
GEC 4 Lesson 3
MODULE
OBJECTIVES
1. Define and understand the concept of modular arithmetic.
2. Find the value of a number in a given modulus.
3. Perform arithmetic operations modulo n.
4. Determine congruence in modulo n.
5. Express appreciation on the applications of modular system.
Figure A
INTRODUCTION
Many clocks have the familiar 12-hour design. If we want to
determine a time in the future or in the past, it is necessary to consider
whether we have passed 12 o’clock. To determine the time 8 hours after 3
o’clock, we add 3 and 8. Because we did not pass 12 o’clock, the time is 11
o’clock (Figure A). However, to determine the time 8 hours after 9 o’clock,
we must take into consideration that once we have passed 12 o’clock, we Figure B
begin again with 1. Therefore, 8 hours after 9 o’clock is 5 o’clock (Figure B).
In many time-keeping system, we don’t even use numbers larger than 12, and instead
use a.m and p.m (from the Latin ante meridiem and post meridiem) to denote the earlier and
latter halves of a 24-hour period. Such system that “wrap around” after hitting some limit, are
called modular arithmetic system, and play an important role in both theoretical and applied
mathematics.
MODULAR ARITHMETIC
Modular arithmetic is a system of arithmetic for integers where numbers “wrap around”
after they reach a certain value called the modulus.
Modulo 2 0 1 0 1 0 1 0 1 0 1
Modulo 3 0 1 2 0 1 2 0 1 2 0
Modulo 4 0 1 2 3 0 1 2 3 0 1
Modulo 5 0 1 2 3 4 0 1 2 3 4
Note that:
The set of numbers in mod 2 are 0, 1
The set of numbers in mod 3 are 0, 1, 2
The set of numbers in mod 4 are 0, 1, 2,3
The set of numbers in mod 5 are 0, 1, 2, 3, 4
The set of numbers in mod 6 are 0, 1, 2, 3, 4, 5
And so on. . . . .
0 1 2 3 0 1 2 3 0 1 2
Example:
A. 2 mod 3 =
1. When the number is less than the modulus The given number x is 2 and modulo y is 3.
The value of x in mod y (x mod y) is x if x is less than y 2 is less than 3, (2 < 3)
x mod y = x if x < y Therefore, 2 mod 3 = 2
B. 15 mod 24 =
The given number x is 15 and modulo y is 24.
15 is less than 24, (15 < 24)
Therefore, 15 mod 24 = 15
Example:
A. 2 mod 2 = 0
B. 5 mod 5 = 0
C. 3 mod 3 = 0
D. 7 mod 7 = 0 2. When the number is equal to the modulus
The value of x in mod x (x mod x) is x 0.
As you can see the given number x mod x = 0
is equal to modulo. If x is equal to
modulo, the answer is 0.
Example:
A. 5 mod 2 = 1 Solution: If the number
5 ÷ 2 = 2, remainder is 1 is greater than the
modulo, we divide the
B. 8 mod 4 = 0 number by the
8 ÷ 4 = 2, remainder is 0. modulo, then the
remainder will be the
C. 6 mod 4 = 2 answer.
6 ÷ 4 = 1, remainder is 2.
Examples:
-7 + 2 = -5 -6 + 4 = -2 -2 + 3 = 1
-5 + 2 = -3 -2 + 4 = 2
-3 + 2 = -1 -2 mod 3 = 1
-1 + 2 = 1 -6 mod 4 = 2
-7 mod 2 = 1
Solution: We just simply add the given modulo to the negative number continuously
until we arrived to the positive number. The positive number that was obtained after
performing the addition will be the answer.
Addition Modulo n
Example:
Evaluate: (23 + 38) mod 12
Solution:
Add 23 + 38 to produce 61. To evaluate 61 mod 12, divide 61 by the modulus, 12. The answer is
the remainder.
23 + 38 = 61 61 ÷ 12 = 5, remainder 1
(23 + 38) mod 12 = 1
The answer is 1.
Subtraction Modulo n
Example:
Evaluate each of the following.
a. (33 - 16) mod 6 b. (14 – 27) mod 5
Solution:
a. (33 - 16) mod 6
Subtract 33 – 16 = 17. The result is positive. If the result is positive we then divide the
difference by the modulus, 6. The answer is the remainder.
33 – 16 = 17 17 ÷ 6 = 2, remainder 5
(33 - 16) mod 6 = 5
The answer is 5.
Solution:
b. (14 – 27) mod 5
Subtract 14 – 27 = -13. The result is negative. If the result is negative, we then add the modulo
to the number until we obtain a positive integer.
14 – 27 = -13 -13 + 5 = -8
-8 + 5 = -3
-3 + 5 = 2 2 is already a positive number.
Therefore, (14 – 27) mod 5 = 2
The answer is 2.
CONGRUNCES IN MODULO
Modulo n
Two integers a and b are said to be congruent modulo n, where n is a natural number, if is
an integer. In this case, we write a b mod n. The number n is called modulus. The statement
a b mod n is called congruence.
Formula: d13 = 10 – ( d1 + 3d2 + d3 + 3d4 + d5 + 3d6 + d7 + 3d8 + d9 + 3d10 + d11 + 3d12 ) mod 10
d13 = 10 – (9 + 3(7) + 8 + 3(0) + 7 + 3(4) + 3 + 3(2) + 5 + 3(8) + 2 + 3(0)) mod 10
d13 = 10 – (9 + 21 + 8 + 0 + 7 + 12 + 3 + 6 + 5 + 24 + 2 + 0) mod 10
d13 = 10 – 97 mod 10 97 mod 10 = 97 ÷ 10 = 9, remainder 7
97 mod 10 = 7
d13 = 10 – 7
d13 = 3, therefore the check digit is 3.
UPC (Universal Product Code) Check Digit. A UPC is a 12-digit number that is used to
identify a product such as a DVD, game, or grocery item.
d12 = 10 – ( 3d1 + d2 + 3d3 + d4 + 3d5 + d6 + 3d7 + d8 + 3d9 + d10 + 3d11 ) mod 10
If d12 = 10, then the check digit is 0.
Example: Find the check digit for the UPC of the Blu-ray Disc release of the film Jurassic World. The first 11 digits
are: 0-25192-21221-?
Formula : d12 = 10 – ( 3d1 + d2 + 3d3 + d4 + 3d5 + d6 + 3d7 + d8 + 3d9 + d10 + 3d11 ) mod 10
d12 = 10 – (3(0) + 2 + 3(5) + 1 + 3(9) + 2 + 3(2) + 1 + 3(2) + 2 + 3(1)) mod 10
d13 = 10 – (0 + 2 + 15 + 1 +2 7 + 2 + 6 + 1 + 6 + 2 + 3) mod 10
d13 = 10 – 65 mod 10 65 mod 10 = 65 ÷ 10 = 6, remainder 5
65 mod 10 = 5
d13 = 10 – 5
d13 = 5, therefore the check digit is 5.
GEC 4 – Mathematics in the Modern World Page 6
MATHEMATICAL SYSTEM 3
MODULE
Example: Determine whether 5234 8213 3410 1298 is a valid credit card number.
A 5 2 3 4 8 2 1 3 3 4 1 0 1 2 9 8
B 10 2 6 4 16 2 2 3 6 4 2 0 2 2 18 8
C 1+0 2 6 4 1+6 2 2 3 6 4 2 0 2 2 1+8 8
D 1 2 6 4 7 2 2 3 6 4 2 0 2 2 9 8
CRYPTOLOGY
Related to codes on books and grocery items are secret codes. These codes are used to
send messages between people, companies, or nations. It is hoped that by devising a code that
is difficult to break, the sender can prevent the communication from being read if it is
intercepted by an unauthorized person. Cryptology is the study of making and breaking secret
codes.
Check your progress. . .
A. A purchase order for the book The Mathematical Tourist by Ivars Peterson includes
the ISBN 978-0-716-73250-5. Determine whether this is a valid ISBN.