Sub topic 2
Congruence Notation: What \(a \equiv b \pmod n\) Means
Assume you can divide integers and identify the quotient and remainder. Congruence notation gives a compact way to say that two integers have the same remainder when divided by a positive integer \(n\).
The meaning of congruence
The statement
\[ a \equiv b \pmod n \]
is read as “\(a\) is congruent to \(b\) modulo \(n\).” It means that \(a\) and \(b\) leave the same remainder when divided by \(n\).
For example,
\[ 47 \equiv 5 \pmod 6 \]
because both 47 and 5 leave remainder 5 when divided by 6. Equivalently, their difference is divisible by 6:
\[ 47-5=42=6\cdot7. \]
Therefore, these two statements mean the same thing:
\[ a \equiv b \pmod n \quad\Longleftrightarrow\quad n\mid(a-b). \]
The symbol \(n\mid(a-b)\) means that \(n\) divides \(a-b\) exactly.
| Statement | Interpretation |
|---|---|
| \(23 \equiv 2 \pmod 7\) | 23 and 2 have the same remainder modulo 7 |
| \(23-2=21\) | Their difference is divisible by 7 |
| \(23=7\cdot3+2\) | Division by 7 leaves remainder 2 |
Congruence is not equality
Congruence does not say that \(a\) and \(b\) are the same number. It says they occupy the same remainder class for a chosen modulus.
For instance,
\[ 23 \equiv 2 \pmod 7, \]
but \(23\ne2\). The numbers 2, 9, 16, 23, and 30 are all congruent modulo 7 because each leaves remainder 2.
A useful test is to subtract the two numbers. If the difference is a multiple of the modulus, the congruence is true.
a, b, n = 23, 2, 7
print(a % n == b % n) # True
print((a - b) % n == 0) # True
print(a == b) # FalseWorking with congruences
Congruences can be added, subtracted, and multiplied. If
\[ a\equiv b\pmod n \quad\text{and}\quad c\equiv d\pmod n, \]
then
\[ a+c\equiv b+d\pmod n, \]
\[ a-c\equiv b-d\pmod n, \]
and
\[ ac\equiv bd\pmod n. \]
For example, since \(23\equiv2\pmod7\) and \(38\equiv3\pmod7\),
\[ 23+38\equiv2+3\equiv5\pmod7, \]
and
\[ 23\cdot38\equiv2\cdot3\equiv6\pmod7. \]
This lets you replace large numbers with smaller remainders before calculating.
A common error
Do not cancel a factor in a congruence automatically. From
\[ 6x\equiv6y\pmod{10}, \]
you cannot always conclude \(x\equiv y\pmod{10}\). Dividing by 6 is safe only when the factor and modulus are suitably related. For CAT questions, first check the modulus and common factors before cancelling.
Exercise
Is \(41 \equiv 6 \pmod 7\)? Give two justifications.
Show answer
Yes. Both numbers leave remainder 6 on division by 7, and \(41-6=35\), which is divisible by 7.