E EpicCBT
Home Lesson Notes Quiz Center Leaderboard Login
All notes Mathematics · Modular Arithmetic · SSS1

Addition, Subtraction and Multiplication Operations in Module Arithmetic

1 views
Addition, Subtraction and Multiplication Operations in Module Arithmetic
Week Four: Modular Arithmetic
WEEK FOUR

Modular Arithmetic

The Mathematics of Cycles

Content Overview

  • Foundations: Congruence, Residue Classes, and the Modulus
  • The Arithmetic of Remainders: Addition, Subtraction, and Multiplication in ℤₙ
  • Algebraic Structure: Properties and Patterns
  • Applications in Modern Life: Cryptography, Timekeeping, and Error Detection

1. Concept of Modular Arithmetic: The Algebra of Cyclic Systems

The Clock Analogy (Intuitive Introduction)

Imagine a standard 12-hour clock. If it is currently 10 o'clock, what time will it be in 5 hours? Not 15 o'clock, but 3 o'clock. We intuitively "wrap around" after reaching 12. Modular arithmetic formalizes this "wrap-around" behavior for any integer modulus n.

Formal Definition: Let n be a positive integer (the modulus). We say that integer a is congruent to integer b modulo n, written as:
a ≡ b (mod n)
if and only if n divides the difference (a - b). Equivalently, a and b yield the same remainder when divided by n.
Key Notation Distinction:
  • Congruence (≡): a ≡ b (mod n) denotes a relationship (like equality).
  • Modulo Operation (mod): a mod n = r denotes the operation that returns the remainder r when a is divided by n, where 0 ≤ r < n.

Visual Illustration: The Number Circle

Unlike the infinite number line, modular arithmetic operates on a finite cyclic structure:

0 11 1 10 2 9 3 8 4 7 5 6 (Mod 12)

In this system, moving forward from 11 brings us back to 0. The numbers 0, 1, 2, ..., n-1 form a complete set of residues (remainders).

Example 1: Reducing to Simplest Form

To reduce a number modulo n, we find its remainder upon division by n.

Reduce 55 modulo 3, 4, 5, and 6:

Modulus Division Remainder Congruence
3 55 = 18 × 3 + 1 1 55 ≡ 1 (mod 3)
4 55 = 13 × 4 + 3 3 55 ≡ 3 (mod 4)
5 55 = 11 × 5 + 0 0 55 ≡ 0 (mod 5)
6 55 = 9 × 6 + 1 1 55 ≡ 1 (mod 6)
Key Insight: If a ≡ b (mod n) and 0 ≤ b < n, we call b the least residue of a modulo n.

2. Arithmetic Operations in ℤₙ

We denote the set of integers modulo n as ℤₙ = {0, 1, 2, ..., n-1}. Operations in this system follow the rule: perform standard arithmetic, then reduce to the least residue.

A. Addition and Subtraction

Addition Table for ℤ₄ (Mod 4)

The symbol denotes addition modulo n.

0 1 2 3
00123
11230
22301
33012

How to read: 2 ⊕ 3 = 5 ≡ 1 (mod 4). We ignore multiples of 4.

Subtraction as Adding the Inverse

Subtraction a ⊖ b is equivalent to finding x such that b ⊕ x ≡ a (mod n). Graphically, this means moving b steps counter-clockwise on the number circle.

Example 2: Subtraction in Mod 4

Find 0 ⊖ 3 (mod 4):

  • Start at 0 on the clock.
  • Move 3 steps backward (counter-clockwise): 0 → 3 → 2 → 1.
  • Result: 0 ⊖ 3 ≡ 1 (mod 4).

Find 1 ⊖ 2 (mod 4):

  • Start at 1.
  • Move 2 steps backward: 1 → 0 → 3.
  • Result: 1 ⊖ 2 ≡ 3 (mod 4).

Important Note: Subtraction is not commutative. 2 ⊖ 1 ≡ 1 (mod 4), but 1 ⊖ 2 ≡ 3 (mod 4).

Efficient Calculation Strategy

For large numbers, reduce first, then operate:

Example: 39 ⊕ 29 (mod 6)

Method 1 (Reduce first):

  • 39 ≡ 3 (mod 6) (since 39 = 6 × 6 + 3)
  • 29 ≡ 5 (mod 6) (since 29 = 6 × 4 + 5)
  • 3 ⊕ 5 = 8 ≡ 2 (mod 6)

Method 2 (Add then reduce):

  • 39 + 29 = 68
  • 68 ÷ 6 = 11 remainder 2
  • 68 ≡ 2 (mod 6)

B. Multiplication

Multiplication modulo n is performed by standard multiplication followed by reduction.

Multiplication Table for ℤ₄

0 1 2 3
00000
10123
20202
30321
Example 3: Multiplication Modulo 4
  1. 2 ⊗ 2 = 4 ≡ 0 (mod 4)
  2. 3 ⊗ 3 = 9 ≡ 1 (mod 4)
  3. 33 ⊗ 9 (mod 4):
    • Reduce first: 33 ≡ 1 (mod 4) and 9 ≡ 1 (mod 4)
    • 1 ⊗ 1 = 1 (mod 4)
Example 4: Larger Moduli

Evaluate 16 ⊗ 7 (mod 5):

  • 16 ≡ 1 (mod 5) (since 16 = 3 × 5 + 1)
  • 7 ≡ 2 (mod 5) (since 7 = 1 × 5 + 2)
  • 16 ⊗ 7 ≡ 1 ⊗ 2 = 2 (mod 5)

Evaluate 18 ⊗ 17 (mod 3):

  • 18 ≡ 0 (mod 3) (divisible by 3)
  • Any number ⊗ 0 ≡ 0
  • Therefore, 18 ⊗ 17 ≡ 0 (mod 3)

3. Algebraic Properties of Modular Arithmetic

Modular arithmetic forms a commutative ring with identity. The following properties hold for all a, b, c ∈ ℤₙ:

Property Addition Multiplication
Closure a ⊕ b ∈ ℤₙ a ⊗ b ∈ ℤₙ
Commutativity a ⊕ b = b ⊕ a a ⊗ b = b ⊗ a
Associativity (a ⊕ b) ⊕ c = a ⊕ (b ⊕ c) (a ⊗ b) ⊗ c = a ⊗ (b ⊗ c)
Identity a ⊕ 0 = a (0 is identity) a ⊗ 1 = a (1 is identity)
Inverse Every a has additive inverse -a (or n-a) Exists only if gcd(a,n)=1
Observation: Notice in the Mod 4 multiplication table that 2 ⊗ 2 = 0, even though 2 ≠ 0. This shows that in modular arithmetic, the Zero Product Property (if ab=0 then a=0 or b=0) does not always hold when the modulus is composite.

4. Applications to Daily Life and Modern Technology

A. Time Calculation (Mod 12 and Mod 24)

  • If it is 9:00 AM now, what time is it in 7 hours? 9 + 7 = 16 ≡ 4 (mod 12). Answer: 4:00 PM.
  • Determining the day of the week involves arithmetic modulo 7.

B. Rotating Schedules (The Market Example Enhanced)

In many West African communities, markets operate on 4-day or 8-day cycles. If Market A opens today, it will next open in 4 days.

  • If today is Day 0, Market A opens on days: 0, 4, 8, 12... ≡ 0 (mod 4)
  • Market B (opening tomorrow) opens on days: 1, 5, 9... ≡ 1 (mod 4)
Problem: If you visit Market A on Day 45, is it open?
Solution: 45 ÷ 4 = 11 remainder 1, so 45 ≡ 1 (mod 4). No, it is closed; Market B is open.

C. Cryptography: The Caesar Cipher

Julius Caesar encrypted messages by shifting each letter by a fixed number. This is addition modulo 26 (for the alphabet).

  • Shift of 3: A → D, B → E, ..., Z → C (since 26 + 3 = 29 ≡ 3 (mod 26), mapping to C if A=1, or adjust indexing).
  • Decryption is subtraction modulo 26.

D. Check Digits (Error Detection)

ISBNs, credit cards, and UPC barcodes use modular arithmetic (often mod 10 or mod 11) to detect transcription errors. A weighted sum of digits must satisfy a congruence relation for the number to be valid.

E. Computer Science: Hashing

Hash functions map large data sets to fixed-size indices using modular arithmetic: Index = Hash(data) mod n, ensuring data fits into a table of size n.

Evaluation & Practice Problems

Section A: Computational Skills

1. Reduce to least residue:

  • 247 (mod 9)
  • -15 (mod 7) (Hint: Add multiples of 7 until positive)

2. Construct the complete addition table for ℤ₅.

3. Evaluate:

  • 145 ⊕ 267 (mod 8)
  • 20 ⊗ 14 (mod 6)
  • 3 ⊖ 7 (mod 5)

Section B: Problem Solving

4. A pharmacist has 100 pills and distributes them into containers holding 6 pills each. Using modular arithmetic, determine how many pills remain after filling as many containers as possible.

5. If your birthday is on a Tuesday this year, what day of the week will it be next year? (Assume non-leap year: 365 days). Use modulo 7.

6. Cryptography Challenge: Decode the message "KHOOR" knowing it was encrypted with a Caesar shift of +3 (i.e., x → x+3 (mod 26)).

Section C: Conceptual Understanding

7. Explain why division is not always possible in modular arithmetic. For example, why does 2 ÷ 3 (mod 6) have no solution?

8. Identify which elements in ℤ₆ have multiplicative inverses. What pattern do you notice regarding the relationship between these numbers and the modulus 6?

Project Idea: Research how the International Standard Book Number (ISBN-10) uses modulo 11 arithmetic to validate book codes. Create a worked example showing how to calculate the check digit for a given ISBN.

Test yourself on Mathematics

Quadratic Equations II

166 questions 10 min SSS1
Start quiz

Quadratic Equations

322 questions 10 min SSS1
Start quiz

SIMPLE EQUATION AND VARIATIONS

180 questions 10 min SSS1
Start quiz

LOGARITHMS II

157 questions 10 min SSS1
Start quiz

Logarithms I

338 questions 10 min SSS1
Start quiz

Indices

194 questions 10 min SSS1
Start quiz

Track your reading & take quizzes

Create free account