No history yet

Congruence Fundamentals

Beyond Remainders

You're likely familiar with finding the remainder of a division. For example, 17 divided by 12 leaves a remainder of 5. Modular arithmetic uses this idea but formalises it into a more powerful concept: congruence.

Two integers, aa and bb, are said to be congruent modulo n if their difference, (ab)(a - b), is an integer multiple of nn. This means nn divides (ab)(a-b) evenly, which we write as n(ab)n | (a - b). The relationship is expressed with a special notation:

ab(modn)a \equiv b \pmod{n}

Let's use our earlier example. We can say that 175(mod12)17 \equiv 5 \pmod{12} because their difference, 175=1217 - 5 = 12, is divisible by 12. Similarly, 295(mod12)29 \equiv 5 \pmod{12} because 295=2429 - 5 = 24, which is also divisible by 12. In essence, congruence tells us that two numbers share the same remainder when divided by the modulus.

This is slightly different from the (%) you might see in programming languages. That operator is a function that returns a single value: the remainder. Congruence, on the other hand, describes a relationship between two numbers.

Residue Classes

Congruence is useful because it groups all integers into a finite number of sets based on their remainder. Each of these sets is called a residue class or congruence class.

Every integer belongs to exactly one residue class for a given modulus nn. For example, let's look at modulus 4. There are four possible remainders when you divide an integer by 4: 0, 1, 2, or 3. This gives us four residue classes.

Residue ClassDescriptionSome Members
[0]4[0]_4Integers with remainder 0{..., -8, -4, 0, 4, 8, ...}
[1]4[1]_4Integers with remainder 1{..., -7, -3, 1, 5, 9, ...}
[2]4[2]_4Integers with remainder 2{..., -6, -2, 2, 6, 10, ...}
[3]4[3]_4Integers with remainder 3{..., -5, -1, 3, 7, 11, ...}

The number 10 belongs to the class [2]4[2]_4 because 10÷410 \div 4 leaves a remainder of 2. The number -5 belongs to the class [3]4[3]_4 because 5=(4×2)+3-5 = (4 \times -2) + 3. Any number in a class can be used to represent the entire class. So, [3]4[3]_4 is the same set as [1]4[-1]_4 or [7]4[7]_4.

The complete set of all residue classes modulo nn is denoted as Z/nZ\mathbb{Z}/n\mathbb{Z}. So, for our example, Z/4Z={[0]4,[1]4,[2]4,[3]4}\mathbb{Z}/4\mathbb{Z} = \{ [0]_4, [1]_4, [2]_4, [3]_4 \}. This finite set is the foundation for arithmetic in modular systems.

The Rules of Equivalence

Congruence isn't just a casual relationship; it's a formal This means it has three specific properties that make it mathematically sound and consistent. These properties allow us to treat congruent numbers as interchangeable in many contexts.

1. Reflexive Property: aa(modn)a \equiv a \pmod{n} A number is always congruent to itself. This is true because aa=0a - a = 0, and any integer nn divides 0.

2. Symmetric Property: If ab(modn)a \equiv b \pmod{n}, then ba(modn)b \equiv a \pmod{n} If nn divides (ab)(a-b), then it must also divide its negative, (ab)-(a-b), which is equal to (ba)(b-a).

3. Transitive Property: If ab(modn)a \equiv b \pmod{n} and bc(modn)b \equiv c \pmod{n}, then ac(modn)a \equiv c \pmod{n} If aa and bb have the same remainder, and bb and cc have the same remainder, then aa and cc must also have that same remainder.

These three rules ensure that the system of residue classes is well-behaved. They are the logical bedrock that allows us to perform algebra with congruences, substituting one number for another as long as they belong to the same residue class.

The Number Circle

A great way to visualise modular arithmetic is with a number circle, much like the face of a clock. For a modulus nn, we can arrange the integers 0,1,2,,n10, 1, 2, \dots, n-1 in a circle. As we count upwards, we simply loop around the circle. This is why modular arithmetic is sometimes called

On this circle for modulus 6, the number 8 lands on the same spot as 2, because 82(mod6)8 \equiv 2 \pmod{6}. The number -1 would be one step counter-clockwise from 0, landing on 5, because 15(mod6)-1 \equiv 5 \pmod{6}. Every integer has a unique place on this circle, corresponding to its residue class.

This simple, visual model captures the essence of congruence: it's a system where the number line wraps around itself, repeating in a predictable cycle. This cyclical nature is what makes it so useful in areas from cryptography to music theory.

Quiz Questions 1/5

What does it mean for two integers, aa and bb, to be congruent modulo nn, written as ab(modn)a \equiv b \pmod{n}?

Quiz Questions 2/5

Which of the following congruence statements is true?