Modular Arithmetic
Entry conditions
You should know divisibility and be comfortable with groups and rings.
Definitions
Two integers and are congruent modulo (written ) if divides .
Congruence modulo is an equivalence relation that partitions into residue classes. These classes form the quotient group under addition, and a ring under addition and multiplication.
is a field if and only if is prime. When is prime, every nonzero residue class has a multiplicative inverse.
Vocabulary (plain language)
- Congruent modulo : two numbers that leave the same remainder when divided by .
- Residue class: the set of all integers congruent to a given number modulo .
Symbols used
- : is congruent to modulo .
- : the integers modulo .
Intuition
Modular arithmetic is “clock arithmetic.” On a 12-hour clock, because . The residue classes are the positions on the clock face, and arithmetic wraps around.
The algebraic significance is that is the simplest example of a quotient group — and when is prime, the simplest example of a finite field.
Worked example
In : (since ), and (since ). So and are multiplicative inverses modulo .
Common mistakes
- Confusing as a ring with as a field. It is always a ring; it is a field only when is prime.
- Forgetting that congruence is an equivalence relation, not just a computational shortcut.