Mathwords logoMathwords

Modulus — Definition, Formula & Examples

Modulus has two key meanings in math: in modular arithmetic, it is the number you divide by when finding remainders; in complex numbers, it is the distance from the origin, equivalent to absolute value.

In modular arithmetic, the modulus nn is the positive integer such that two integers aa and bb are congruent modulo nn if n(ab)n \mid (a - b). For a complex number z=a+biz = a + bi, the modulus is z=a2+b2|z| = \sqrt{a^2 + b^2}.

Key Formula

ab(modn)    n(ab)a \equiv b \pmod{n} \iff n \mid (a - b)
Where:
  • a,ba, b = Integers being compared
  • nn = The modulus — the positive integer you divide by
  • \equiv = Denotes congruence (same remainder when divided by n)

How It Works

In modular arithmetic, the modulus sets the size of the "clock" you are working on. When you compute 17mod517 \mod 5, the modulus is 5, and you find the remainder when 17 is divided by 5. All integers that share the same remainder under division by the modulus are considered equivalent. In the complex number context, the modulus measures how far a point in the complex plane is from the origin, exactly like the Pythagorean theorem applied to the real and imaginary parts.

Worked Example

Problem: Determine whether 23 and 8 are congruent modulo 5.
Step 1: Compute the difference of the two numbers.
238=1523 - 8 = 15
Step 2: Check whether the modulus (5) divides that difference evenly.
15÷5=315 \div 5 = 3
Step 3: Since 5 divides 15 with no remainder, the two numbers are congruent modulo 5.
238(mod5)23 \equiv 8 \pmod{5}
Answer: Yes, 23 and 8 are congruent modulo 5 because their difference (15) is divisible by the modulus (5). Both leave a remainder of 3 when divided by 5.

Why It Matters

The modulus is central to cryptography algorithms like RSA, which secure online transactions by performing arithmetic with very large moduli. In physics and engineering, the modulus of a complex number represents signal strength or vector magnitude.

Common Mistakes

Mistake: Confusing "modulus" with "modulo." Students sometimes use them interchangeably.
Correction: The modulus is the number itself (e.g., 5). "Modulo" is the operation or relation — you compute a value modulo the modulus. Think of "modulus" as the noun and "modulo" as the preposition.