Modulo
Modulo
MATHEMATICS
MODULAR ARITHMETIC
OBJECTIVES
By the end of the lesson the student will be able to;
1. Calculate the value of numbers for a given modulo.
2. Add and multiply numbers in a given modulo.
Calculation of a number for a given modulo
• Modular arithmetic is a system of arithmetic where we are only interested in the
remainder after dividing a number by another number.
• The number used to the divide the number is called modulo
• Modulo(mod) is a mathematical operation that find the remainder when one
number is divided by another.
𝑥
• Example, 𝑥 𝑚𝑜𝑑 𝑦 = 𝑟 is the same as = 𝑟, where 𝑥 is the dividend, 𝑦 is the
𝑦
divisor and 𝑟 is the remainder.
The face of a clock
• We have 24 hours within a day but the numbers on the clock in our homes
ranges from 1 to 12.
• This means that is it design in 12 hours which is in mod 12
• When its get to the 14th hour, we have 14 mod 12 = 2. 14pm on the 24 hour
clock is the same as 2pm on the 12 hour clock
The idea of remainder to find the modulus of numbers
• Modular arithmetic is related to the remainder theory in division
• Any number in a given modulo is found by dividing the number by the modulo
and the remainder is the value we are interested in.
• Example, 5 in modulo 2 (5 𝑚𝑜𝑑 2) is 1, since when 5 is divided by 2 the
remainder is 1
Example
1. 2 = 2 in mod 5
2. 25 = 1 in mod 4
3. 13 = 3 in mod 10
4. 5 = 5 in mod 13
Modulo of negative numbers
• The modulo of negative numbers is obtained by adding multiples of the modulo
to the number until we get the first positive number
• Example, -9 mod 5 = -9 + 5 = -4
−4 + 5 = 1
Since we have a positive answer, -9 mod 5 = 1
Example
1. -2 = 3 in mod 5
2. -12 = 0 in mod 6
3. -5 = 1 in mod 2
Addition ⊕ and Multiplication ⊗ table in a given
modulo
The sum or product of two or more numbers in a given modulo is found by first
adding or multiplying the numbers before converting the given modulo.
Example
1. 4 + 5 (mod 5) = 9 (mod 5) = 4
2. -10 + 4 (mod 5) = -6 (mod 5) = 4
3. 5 × 9 (mod 12) = 45 (mod 12) = 9
Note: subtraction is also performed in the same way as addition and multiplication.
Examples
1. Draw an addition and multiplication table for modulo 12 on the set 𝑃 =
{1,4,9,11}.
Use your table to find the truth set of
i. 9⨂𝑛 = 0
ii. 𝑛⨂𝑛 = 1
iii. 4⨁9 = 𝑛
iv. 11⨁(1 ⨂ 4)
addition mod 12 multiplication mod 12
⨁ 1 4 9 11 ⨁ 1 4 9 11
1 2 5 10 0 1 1 4 9 11
4 5 8 1 3 4 4 4 0 8
9 10 1 6 8 9 9 0 9 3
11 0 3 8 10 11 11 8 3 1