Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Topic 1. Modular Arithmetic: Learning Objectives

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

Topic 1.

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.

The basic principles of modular arithmetic


are often discussed at primary school
level, except that it is likely to be called clock arithmetic. The idea is quite simple: 3
hours after 10 o’clock is 1 o’clock (because 10 + 3 =13 and we subtract 12). Similarly,
17hours after 9 o’clock will be 2 o’clock, because 17 + 9 = 26 and we must subtract 2
x12 = 24 to find where the hand is pointing on the clock face. And 9 hours before
4o’clock is 7 o’clock, since 4 – 9 = - 5, and now we add 12 to get the answer 7, the
required number on the clock face. Clock arithmetic thus deals only with the numbers
from 1 to 12 and whenever a calculation takes you outside that range, you add or subtract
a multiple of 12 to get back onto the clock face.

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

There is nothing special about 12 or 24 in these examples. In general, modular arithmetic


you do arithmetic with the numbers from 1 to n as normal, and if your answer goes
outside that range you add or subtract multiples of n to get back into the range. The
number n is called the modulus, and the calculations are said to be done modulo n or mod
n. Instead of the usual equality sign (=), the symbol ≡ is used in modular arithmetic. Here
are some examples:
6+8+1-2 ≡ 1( mod 12)
17-23+15+11-8= 11(mod 24)

Division and Remainder


When doing long division, you have learned to use remainders. For example, when you
divide 11 by 5, you see a remainder of 1. Look at how you can write this in two different

ways: which is also written as 11 ≡ 1(mod 5).


As you can see above there is a relationship between modulo notation and long division!
When working with modulo notation, a common phrase you use is “x is congruent to A
mod B”. A can be any number that has the same remainder as X when divided by B. In
this lesson, A will be the smallest positive integer between 0 and B. You can then make a
general statement about the relationship between modulo form and division:
which is also written as X ≡ A(mod B)
Modulo With Calculators

Example: Find 373 in modulus 6:

Divide 373 by the mod we want, which is 6: 373 ÷ 6 = 62.17


Round this number down to a whole number: 62.17 = 62
Multiply this number by the mod we are working with: 62 × 6 = 372
Subtract this new number from our original number: 373 − 372 = 1
Express this in modulo notation: 373 ≡ 1(mod 6)

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

Modular Multiplication is used to multiply congruence classes. To think of this concept,


look at the multiplication of 17 and 15 using modulo 6:

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.

Example: Today is a Monday. What day of the week will it be in:


(a) 280 days? (b) 365 days? (c) 1000 days?

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.

You might also like