Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

MATHEMATICAL SYSTEM 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. . . . .

GEC 4 – Mathematics in the Modern World Page 1


MATHEMATICAL SYSTEM 3
MODULE
FINDING THE VALUE OF A NUMBER IN A GIVEN MODULUS

Example: Consider the number line below:

mod 4 , The set of values in mod 4 0,1, 2, 3

0 1 2 3 0 1 2 3 0 1 2

The value of 7 in mod 4 is 3 The value of 5 in mod 4 is 1 The value of 4 in mod 4 is 0


7 mod 4 = 3 5 mod 4 = 1 4 mod 4 = 0

Find the value of the following:


a. 10 mod 5 = b. 3 mod 4 = c. 6 mod 7 =

FINDING THE VALUE OF A POSITIVE WHOLE NUMBER IN A GIVEN MODULUS

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.

GEC 4 – Mathematics in the Modern World Page 2


MATHEMATICAL SYSTEM 3
MODULE
3. When the number is greater than the modulus
If x is greater than y, then the value of x in mod y (x mod y) is a.
a is the remainder when x is divided by y.
If x > y then x mod y = a , where a is the remainder when x is divided by y.

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.

FINDING THE VALUE OF NEGATIVE WHOLE NUMBER IN A GIVEN MODULUS


The value of a negative number in a given modulo is obtained by adding the
modulus to the number until we get a positive number.

Examples:

A. -7 mod 2 B. -6 mod 4 C. -2 mod 3

-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.

Check your progress: Evaluate the following.

a. 10 mod 15 = c. 6 mod 6 = e. -24 mod 11 =


b. -21 mod 2 = d. 8 mod 2 = f. 5 mod 8 =

GEC 4 – Mathematics in the Modern World Page 3


MATHEMATICAL SYSTEM 3
MODULE
ARITHMETIC OPERATIONS MODULO n

Arithmetic modulo n (where n is a natural number) requires us to evaluate a


modular expression after using the standard rules of arithmetic. Thus we
perform the arithmetic operation and then divide by the modulus. The answer is
the remainder. The result of an arithmetic operation mod n is always a whole
number less than n.

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.

GEC 4 – Mathematics in the Modern World Page 4


MATHEMATICAL SYSTEM 3
MODULE
Multiplication Modulo n
Example:
Evaluate:
a. (15 • 23) mod 11
Solution:
a. (15 • 23) mod 11
Find the product 15 • 23 and then divide by the modulus, 11. The answer is the remainder.

15 x 23 = 345 345 ÷ 11 = 31, remainder 4


(15 • 23) mod 11 = 4
The answer is 4.
Check your progress. . .
Evaluate:
a. (51 + 72) mod 2 c. (33 • 41) mod 17
b. (21 – 43) mod 7 d. (56 – 23) mod 3
e. (15 + 14) mod 5

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.

Example: Determine whether the congruence is true.


a. 29 8 mod 3 b. 15 4 mod 6
Solution:
a. Find = = 7. Because 7 is an integer, 29 8 mod 3 is a true congruence.

b. Find = . Because is not an integer, 15 4 mod 6 is not true.

Note: Check your progress. . .


Integer – whole numbers that can be Determine whether the congruence is true.
positive, negative, or zero. a. 7 12 mod 5
Non-integers – fractions and decimals are b. 15 1 mod 8
not integers.

GEC 4 – Mathematics in the Modern World Page 5


MATHEMATICAL SYSTEM 3
MODULE
APPLICATIONS OF MODULAR ARITHMETIC
ISBN and UPC
 ISBN (International Standard Book Number) Check Digit. An ISBN is a 13-digit number
used to identify a book. The 13th digit is a check digit. If we label the first digit of an ISBN
d1, the second digit d2, and so on to the 13th digit as d13, then the check digit is given by
the following formula.
d13 = 10 – ( d1 + 3d2 + d3 + 3d4 + d5 + 3d6 + d7 + 3d8 + d9 + 3d10 + d11 + 3d12 ) mod 10
If d13 = 10, then the check digit is 0.
Example: Determine the ISBN check digit for the book The Equation that Couldn’t Be Solved by Mario Livio. The
first 12 digits of the ISBN are 978-0-7432-5820- ?

Solution: Given: 978-0-7432-5820-


d1 = 9 d2 = 7 d3 = 8 d4 = 0 d5 = 7 d6 = 4
d7 = 3 d8 = 2 d9 = 5 d10 = 8 d11 = 2 d12= 0

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-?

Solution: Given: 0-25192-21221-


d1 = 0 d2 = 2 d3 = 5 d4 = 1 d5 = 9 d6 = 2
d7 = 2 d8 = 1 d9 = 2 d10 = 2 d11 = 1

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

CREDIT CARD NUMBERS


Companies that issue credit cards also use modular arithmetic to determine whether a
credit card is valid. This is especially important in e-commerce, where credit card information is
frequently sent over the Internet. The primary coding method is based on the Luhn algorithm,
which uses mod 10 arithmetic.

Example: Determine whether 5234 8213 3410 1298 is a valid credit card number.

Solution: Given: 5234 8213 3410 1298

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

A. Highlight every other number from right to left.


B. Double each of the highlighted numbers.
C. Add all the numbers, treating two-digit numbers as two single numbers.
D. Add all the numbers. 1+2+6+4+7+2+2+3+6+4+2+0+2+2+9+8 = 60

Note: The final sum must be congruent to 0 mod 10.


60 0 𝑚𝑜𝑑 10 60 – 0 = 60; 60 ÷ 10 = 6, 6 is an integer
60 is congruent to 0 mod 10, therefore it is a valid credit card.

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.

B. Is 1-32342-65933-9 a valid UPC?

C. Is 6011 0123 9145 2317 a valid credit card number?

GEC 4 – Mathematics in the Modern World Page 7

You might also like