Courses / Mathematics I
Arithmetic and Number Theory

Congruences and Applications

Mathematics I 330 words Free to read

Putting Modular Arithmetic to Work

Modular arithmetic is not just theory — it powers check digits, hashing, calendars, and cryptography. This lesson develops the tools to solve modular equations and see where they apply.

A linear congruence has the form axb(modn)ax \equiv b \pmod{n} — solve for the unknown residue xx. The key is the multiplicative inverse: a1a^{-1} is a residue with aa11(modn)a \cdot a^{-1} \equiv 1 \pmod n. When it exists, multiply both sides by it to get xa1bx \equiv a^{-1} b. The crucial fact from Lesson 4: aa has an inverse mod nn if and only if gcd(a,n)=1\gcd(a, n) = 1 (they are coprime). So axb(modn)ax \equiv b \pmod n has a unique solution exactly when aa and nn are coprime; otherwise it may have several solutions or none.

Two celebrated theorems make computation easy:

Applications are everywhere. Check digits (ISBN, credit cards) append a digit making a weighted sum 0(modn)\equiv 0 \pmod{n}, so single-digit errors are caught. Hash functions reduce keys mod a table size. And public-key cryptography (RSA) rests entirely on modular exponentiation being easy while its inverse (factoring, or the discrete logarithm) is hard — the coprimality and inverse ideas of this unit, scaled to enormous numbers.

Common pitfall: trying to solve axb(modn)ax \equiv b \pmod n by "dividing by aa" when aa and nn are not coprime. The inverse a1a^{-1} exists only when gcd(a,n)=1\gcd(a, n) = 1; without it you cannot simply divide. When gcd(a,n)>1\gcd(a, n) > 1 the congruence has either no solution or several (never a single unique one) — checking coprimality first tells you which case you are in.

Practise this lesson

The explanation above is free to read. The graded practice for this lesson lives in the Tryals app.

10practice questions
2interactive scenes
Start Mathematics I free

Arithmetic and Number Theory