Have you ever noticed that if it is 10 o'clock right now, 4 hours later it will be 2 o'clock, not 14 o'clock? Without knowing it, you use a special kind of math every single day called Modular Arithmetic. Often referred to as "clock arithmetic," modular arithmetic deals with numbers that wrap around a specific value called the Modulus.
Whether you are preparing for secondary school certificate exams like WAEC and JAMB or NECO, or diving into computer science, mastering modular arithmetic is simple once you learn the basic tricks. Let us break down how these cyclic patterns work and explore multiple step-by-step examples for every arithmetic operation.
1. The Concept of Cyclic Patterns (The Clock Analogy)
In standard mathematics, numbers go on forever in a straight line. In modular arithmetic, numbers move in a circle. Once you hit the maximum value (the modulus), the counting resets back to zero.
When we write A ≡ B (mod M), it simply means that when you divide A by M, the remainder is B. In modular arithmetic, we only care about the remainder!
- Standard 12-Hour Clock (Mod 12): The numbers run from 0 to 11 (where 12 acts as 0). If you count 14 hours past 12, you land on 2, because 14 divided by 12 leaves a remainder of 2.
- Days of the Week (Mod 7): There are 7 days in a week. If today is Monday (Day 1), in 8 days it will be Tuesday (Day 2), because 8 divided by 7 leaves a remainder of 1.
2. Basic Operations in Modular Arithmetic
Performing arithmetic in different moduli follows regular math rules, with one extra step: If your answer is equal to or greater than the modulus, divide it by the modulus and write down the remainder instead!
A. Modular Addition
Add the numbers normally. If the sum is greater than or equal to the modulus, find the remainder.
Example 1: Find (8 + 7) mod 12
- Step 1: Add the numbers normally: 8 + 7 = 15.
- Step 2: Since 15 is greater than the modulus (12), divide by 12: 15 ÷ 12 = 1 remainder 3.
- Answer: 8 + 7 ≡ 3 (mod 12).
Example 2: Find (4 + 3) mod 5
- Step 1: Add normally: 4 + 3 = 7.
- Step 2: Divide by the modulus 5: 7 ÷ 5 = 1 remainder 2.
- Answer: 4 + 3 ≡ 2 (mod 5).
Example 3: Find (17 + 25) mod 6
- Step 1: Add normally: 17 + 25 = 42.
- Step 2: Divide 42 by the modulus 6: 42 ÷ 6 = 7 remainder 0.
- Answer: 17 + 25 ≡ 0 (mod 6).
Example 4 (Application): If today is Wednesday (Day 3), what day of the week will it be in 53 days?
- Step 1: Set up the modular equation using Mod 7 (since there are 7 days in a week): (3 + 53) mod 7.
- Step 2: Add the values: 3 + 53 = 56.
- Step 3: Divide by 7: 56 ÷ 7 = 8 remainder 0.
- Since Sunday is Day 0, the answer is Sunday.
B. Modular Subtraction
Subtract the numbers normally. If your answer becomes negative, keep adding the modulus to it until the result becomes a positive number within the allowed cyclic range.
Example 1: Find (3 - 7) mod 5
- Step 1: Subtract normally: 3 - 7 = -4.
- Step 2: Because it is negative, add the modulus (5): -4 + 5 = 1.
- Answer: 3 - 7 ≡ 1 (mod 5).
Example 2: Find (2 - 9) mod 6
- Step 1: Subtract normally: 2 - 9 = -7.
- Step 2: Add the modulus (6): -7 + 6 = -1 (still negative!).
- Step 3: Add the modulus again: -1 + 6 = 5.
- Answer: 2 - 9 ≡ 5 (mod 6).
Example 3: Find (11 - 15) mod 4
- Step 1: Subtract normally: 11 - 15 = -4.
- Step 2: Add the modulus (4) to eliminate the negative value: -4 + 4 = 0.
- Answer: 11 - 15 ≡ 0 (mod 4).
Example 4: Find (1 - 8) mod 9
- Step 1: Subtract normally: 1 - 8 = -7.
- Step 2: Add the modulus (9): -7 + 9 = 2.
- Answer: 1 - 8 ≡ 2 (mod 9).
C. Modular Multiplication
Multiply the numbers normally. Then, simplify the result by dividing by the modulus and keeping the remainder.
Example 1: Find (4 × 6) mod 7
- Step 1: Multiply normally: 4 × 6 = 24.
- Step 2: Divide by the modulus 7: 24 ÷ 7 = 3 remainder 3 (since 7 × 3 = 21).
- Answer: 4 × 6 ≡ 3 (mod 7).
Example 2: Find (5 × 5) mod 8
- Step 1: Multiply normally: 5 × 5 = 25.
- Step 2: Divide by the modulus 8: 25 ÷ 8 = 3 remainder 1 (since 8 × 3 = 24).
- Answer: 5 × 5 ≡ 1 (mod 8).
Example 3: Find (9 × 8) mod 5
- Step 1: Multiply normally: 9 × 8 = 72.
- Step 2: Divide by the modulus 5: 72 ÷ 5 = 14 remainder 2 (since 5 × 14 = 70).
- Answer: 9 × 8 ≡ 2 (mod 5).
Example 4 (Advanced Trick): Find (14 × 19) mod 3
Pro Tip: You can simplify the numbers before multiplying to keep the math easy!
- Step 1: Simplify 14 mod 3 first. 14 ÷ 3 leaves a remainder of 2.
- Step 2: Simplify 19 mod 3. 19 ÷ 3 leaves a remainder of 1.
- Step 3: Multiply the simplified remainders: 2 × 1 = 2.
- Answer: 14 × 19 ≡ 2 (mod 3).
Conclusion
Modular arithmetic is simply regular arithmetic that stays inside a fixed loop ( mod). Whenever your computations break out of the allowed boundaries, divide by your modulus or add it back to keep your values moving correctly inside the cycle. I hope you understand that simple guides we brought to you, if have any question please let us know.


0 Comments