Topic 1. Modular Arithmetic: Learning Objectives
Topic 1. Modular Arithmetic: Learning Objectives
Topic 1. Modular Arithmetic: Learning Objectives
Modular Arithmetic
Learning Objectives
At the end of the lesson, you are expected to:
1. Carry out the operations in modular arithmetic.
2. Use modulo concepts and properties to solve modular arithmetic problems and compose
proofs.
Presentation of Content
Modular arithmetic deals primarily with operations and applications regarding
remainders. Essentially, it’s just another way to express remainders, and has many useful
applications.
How can you begin to understand modular arithmetic? One way is to think about hours
on a clock. Imagine a clock face with numbers from zero to eleven, one hand to show the
hour (there is no minute hand). You can
add numbers on the clock by moving the
hand in a clockwise direction. You can
also subtract by moving the hand in anti-
clockwise direction as follows.
You could also do clock arithmetic with a 24- hour clock. For example, 17 hours after
16hoo is 09hoo, since 17 + 16 = 33, and 24 is subtracted to get the time. Similarly, 11
hours before 09hoo is 22hoo (9 – 11 = - 2; add 24 to get 22).
Therefore, we can say that 373 has a remainder of 1 when divided by 6, and can be
expressed in modulo notation as 373 ≡ 1(mod 6).
Congruent Modulo
Some numbers have the same remainder when they are divided by a particular integer.
For example, 47 ÷5 has remainder 2 and 5 ÷ 12 also has remainder 2. This similarity
helps you to define a new number relationship called congruence. If two integers a and b
have the property that a – b is divisible by another m (m<1), then a and b are called
congruent modulo m and write a ≡ b (mod m). For example
47≡ 2 (mod 5) and
12≡2 mod 5)
47≡12 (mod 5).
Since 47 – 2 and 47 – 12 are both divisible by 5. Similarly -16≡ 8 (mod 12) since – 16 – 8
is divisible by 12, Look at general modular arithmetic modulo n, where n is an integer
greater than 1. The key idea is that if a≡ b(mod n), then a – b is divisible by n. If a
number a leaves a remainder of r
after division by n, then a ≡ r (mod n).
It is now easy to see that if a≡ b (mod n), and c≡ d (mod n), then a+c=b+d (mod n) and a-
c ≡ b-d (mod n).
For if a and b differ by a multiple of n, and c and d also differ by multiple of n, then
clearly a + d and 0+11 b + d differ by the sum of those multiple of n, which is again a
multiple of n. Modular arithmetic also extends to multiplication. If a≡ b and c≡ d (mod
n), then ac≡ bd (mod n).
Modular arithmetic obeys the same laws as convential arithmetic, such as the
commutative laws a+b ≡ b+a, the associative laws (a+b)+c ≡ a+(b+c) and (ab)c≡a(bc)
and the distributive laws (laws of brackets) a(b+c) ≡ ac +bc, all of these modulo n.
Example 01. Find the possible values of m that satisfy each congruence:(a) 13≡ 3 (mod
m)
Solution:
(a)By definition of congruence, 13 – 3 = 10 must be divisible by m. So the possible
values of m are the positive divisors of 10: m ∈ {2, 5}. Remember by definition m ≠ 1.
Example 02. If today is Wednesday, what day of the week will it be in 100 days’ time?
Solution:
Sun Mon Tue Wed Thurs Fri Sat
0 1 2 3 4 5 6
Since you have numbers 0, 1, 2 , 3, 4, 5 and 6, do the arithmetic in modulo 7.Today is
Wednesday (day 3) hence to find 100 days later, you can write: 3+100 = 103 ≡ 5 (mod 7).
So the answer is the 5th day which is Friday
Modular Operations
Just like many different mathematical concepts, modular arithmetic has its own unique
set of operations.
Modular Addition
Modular Addition is used to add congruence classes. To think of this concept, look at the
additions of 14 and 15 using modulo 6:
Transferring both into modulo notation you get: 17 ≡ 5 (mod 6) and 15 ≡ 3 (mod 6) Let
us
Add in the following manner:
17 ≡ 5 (mod 6) + 15 ≡ 3 (mod 6) = (17 + 15) ≡ (5 + 3) (mod 6)
= 32 ≡ 8 (mod 6)
= 32 ≡ 2 (mod 6)
If you were to find 32 in modulo 6 using the algorithm, we would get 32 ≡ 2 (mod 6).
You can extend this to say that any number that is 5 (mod 6) added to any number that is
3 (mod 6) will have a sum that is 2 (mod 6).
Now, you create an addition chart for all the congruence classes for modulo 6. The
addition charts are different for every modulo based on reducing and how you add. When
you add a class from a column and a row you change the sum into the modulo you are
working with. This chart for example, shows that the sum of two numbers in modulo 6
with remainder 2 and 3 will result in a number with remainder 5:
Modular subtraction is the exact opposite of this concept and can be thought of as adding
a negative number to find a sum. Remember that congruence classes stretch to negative
infinity and therefore negative sums exist in congruence classes.
Modular Multiplication
Transferring both into modulo notation you get: 17 ≡ 2 (mod 6) and 15 ≡ 3 (mod 6)
Multiply in the following manner:
17 ≡ 5 (mod 6) × 15 ≡ 3 (mod 6) = (17 × 15) ≡ (5 × 3) (mod 6)
= 255 ≡ 15 (mod 6)
= 255 ≡ 3 (mod 6)
If you were to find 255 in modulo 6 using the algorithm, we would get 255 ≡ 3 (mod 6).
We can extend this to say that any number that is 5 (mod 6) multiplied by any number
that is 3 (mod 6) will have a product that is 3 (mod 6).
Now, create a multiplication chart for all the congruence classes for modulo 6. When you
multiply, you change the product into a modulo 6 as well. This chart for example, shows
that the product of two numbers in modulo 6 with remainder 2 and 3 will result in a
number with remainder 0:
Applications of Congruences
Look at a 12-hour analog clock. It is easy to tell from this what hour it is currently, it is
up to us to know if it is am or pm. However, what if you have a 24-hour digital clock?
When it comes to using 24-hour clocks, we have probably used tricks such as subtracting
12 from the number to get that 13:00 is the same as 1:00. We can very much write this as
a mod: 13 ≡ 1 (mod 12). A useful thing to remember is that the number of total items
there are in the question is usually the modulo we are working in. In this case, 12 hours
means we are working in modulo 12.
Solution:
(a) Change 280 into modulo notation. Since you are concerned with the day it will be,
you will use modulo 7 as there are 7 days.
280 ≡ 0 (mod 7) which means that in 280 days, it will be a Monday.
(b) Change 365 into modulo notation. Since you are concerned with the day it will be,
you will use modulo 7 as there are 7 days.
365 ≡ 1 (mod 7) which means that in 365 days, it will be one day later, a Tuesday.
(b) Change 1000 into modulo notation. Since you are concerned with the day it will be,
you will use modulo 7 as there are 7 days.
1000 ≡ 6 (mod 7) which means that in 1000 days, it will be six days later, a Sunday.