You are on page 1of 10

MODULAR

ARITHMETIC
MODULAR ARITHMETIC
Modular arithmetic is a system of arithmetic for integers,
which considers the remainder. In modular arithmetic, numbers
"wrap around" upon reaching a given fixed quantity (this given
quantity is known as the modulus) to leave a remainder. Modular
arithmetic is often tied to prime numbers, for instance, in Wilson's
theorem, Lucas's theorem, and Hensel's lemma, and generally
appears in fields like cryptography, computer science, and
computer algebra.
- BRILLIANT MATH AND SCIENCE WIKI
MODULAR ARITHMETIC
CONGRUENCE
Let a and b are integers and n is a natural counting number. We
say that a is congruent to b modulo n in symbols :
a  b(mod n)
If the difference of a and b is divisible by n.
In addition, if n >0, and r is the remainder when b is divided by n,
the integer r is referred to as the least residue.
MODULAR ARITHMETIC
EXAMPLE 1
Verify if 12  36(mod 4)
To verify, we perform 36-12=24 and 24 is divisible by 4 , then we can say that
the expression 12  36(mod 4) is a congruence.
EXAMPLE 2
Verify if 25  150(mod 6)
To verify, we perform 150 -25 =125 and 125 is not divisible by 6 , then we can
say that the expression 25  150(mod 6) is not a congruence.
MODULAR ARITHMETIC
To. determine the least residue is to simply get the remainder when
b is divided by n.
b(mod n) means b divided by n. n is referred to as the modulus
(divisor). Do not use a calculator.
EXAMPLE 3
Determine the least residue of 89 (mod 9)
Dividing 89 by 9 wiil give a quotient 9 and a remainder of 8.
Therefore, 89 (mod 9) =8
MODULAR ARITHMETIC
EXAMPLE 4
Determine the least residue of 120(mod10)
Since 120 is exactly divisible by 10 .The least residue of 120 (mod 10)
= 0.
EXAMPLE 5
Determine the least residue of 32(mod 40)
Dividing 32 by 40 will give a quotient of 0 and a remainder of 32.
Therefore, the least residue of 32(mod40)=32.
MODULAR ARITHMETIC
EXAMPLE 5
Determine the least residue of -12 (mod 5)
Solution :
/-12/(mod 5)
12(mod 5)= 2
Subtract the least residue 2 from the modulus 5
5-2= 3
Therefore, /-12/ (mod 5) = 3
MODULAR ARITHMETIC
OPERATIONS IN MODULAR ARITHMETIC
Operations in Modular Arithmetic are just normal operations, same as how we
use in normal arithmetic
Consider modulo n
A) Modulo addition is defined (a+b)mod n
B) Modulo subtraction is defined as (a-b) mod n
C) Modulo multiplication is defined as (a*b) mod n
D) Modulo division is defined as (a/b) mod n
MODULAR ARITHMETIC
EXAMPLE 6
(19 + 23) mod 12 = 42 mod 12
=6
EXAMPLE 7
(78 – 45) mod 20 = 33 mod 20
=13
EXAMPLE 8
(25* 8) mod 4 = 200 mod 4
=0
EXAMPLE 9
(216/8) mod 15 = 27 mod 15
= 27
END

You might also like