Mathwords logoMathwords

Modular Equivalence Rules

Modular Equivalence Rules

Algebra rules for manipulating modular equivalences are listed below.

 

Definition: a ≡ b (mod n) means a and b leave the same remainder when divided by n, where a, b, c are integers and n ≥ 2.

Four modular equivalence operations: addition, subtraction, multiplication, and division rules using variables a, b, c, and n.

 

 

See also

Equation rules, equivalence relation

Key Formula

If ab(modn) and cd(modn), then:\text{If } a \equiv b \pmod{n} \text{ and } c \equiv d \pmod{n}, \text{ then:} a+cb+d(modn)a + c \equiv b + d \pmod{n} acbd(modn)a - c \equiv b - d \pmod{n} acbd(modn)a \cdot c \equiv b \cdot d \pmod{n} akbk(modn)for any positive integer ka^k \equiv b^k \pmod{n} \quad \text{for any positive integer } k
Where:
  • a,b,c,da, b, c, d = Integers, where a ≡ b (mod n) and c ≡ d (mod n)
  • nn = The modulus, a positive integer
  • kk = A positive integer exponent

Worked Example

Problem: Find the remainder when 47 × 63 is divided by 10.
Step 1: Reduce each factor modulo 10.
477(mod10),633(mod10)47 \equiv 7 \pmod{10}, \quad 63 \equiv 3 \pmod{10}
Step 2: Apply the multiplication rule: you can multiply the remainders and the congruence is preserved.
47×637×3(mod10)47 \times 63 \equiv 7 \times 3 \pmod{10}
Step 3: Compute the product of the remainders and reduce mod 10.
7×3=211(mod10)7 \times 3 = 21 \equiv 1 \pmod{10}
Answer: The remainder when 47 × 63 is divided by 10 is 1.

Another Example

Problem: Find the remainder when 3⁸ is divided by 5.
Step 1: Start by computing a small power. Note that 3² = 9, and reduce mod 5.
32=94(mod5)3^2 = 9 \equiv 4 \pmod{5}
Step 2: Use the power rule: square both sides of the congruence to get 3⁴.
3442=161(mod5)3^4 \equiv 4^2 = 16 \equiv 1 \pmod{5}
Step 3: Square both sides again to get 3⁸.
3812=1(mod5)3^8 \equiv 1^2 = 1 \pmod{5}
Answer: The remainder when 3⁸ is divided by 5 is 1.

Frequently Asked Questions

Can you divide both sides of a modular congruence?
Not in general. Division is only valid when the divisor and the modulus are coprime (share no common factor other than 1). For example, from 6 ≡ 12 (mod 6), dividing both sides by 3 gives 2 ≡ 4 (mod 6), which is false. If gcd(c, n) = 1, you can divide both sides by c, because c has a modular inverse mod n.
Why can you replace a number with its remainder in modular arithmetic?
Because any integer a can be written as a = qn + r, where r is the remainder. This means a ≡ r (mod n). The equivalence rules guarantee that substituting r for a in additions, subtractions, and multiplications preserves the congruence, so you get the same final remainder either way.

Modular equivalence rules vs. Properties of equality

Properties of equality (like adding the same value to both sides of an equation) apply to exact numerical equality. Modular equivalence rules are analogous but apply to congruences mod n. A key difference is that division works freely with equality (when the divisor is nonzero) but requires extra conditions in modular arithmetic — the divisor must be coprime to the modulus.

Why It Matters

These rules are the foundation of modular arithmetic, which appears throughout number theory, cryptography (such as RSA encryption), computer science (hash functions, checksums), and competition mathematics. They let you break enormous calculations into small, manageable pieces by reducing at every step. Without these rules, computing something like the last digit of 7¹⁰⁰ would require multiplying out the full number.

Common Mistakes

Mistake: Dividing both sides of a congruence without checking that the divisor is coprime to the modulus.
Correction: Division in modular arithmetic is only valid when gcd(divisor, modulus) = 1. Otherwise the congruence may become false. Use the modular inverse of the divisor instead, or factor out common divisors carefully.
Mistake: Assuming the rules work for exponents in the modulus position, e.g., thinking a^c ≡ a^d (mod n) just because c ≡ d (mod n).
Correction: The power rule lets you replace the base, not the exponent. Replacing the exponent requires a different result (such as Fermat's Little Theorem or Euler's theorem), not the basic equivalence rules.

Related Terms