FP2 5.3 - Modular arithmetic and congruences
Calculate with remainders using congruence notation (FP2 5.3). You will use the equivalence, addition, subtraction, multiplication and power laws, while keeping the modulus fixed and checking before cancelling.
Congruence means the same remainder
A machine returns to its starting setting after every seven turns. Can one backwards turn leave it at the same setting as six forwards turns? We need a language that remembers the setting and discards complete cycles.
You already know
The division theorem writes an integer as , where and . Two integers have the same remainder precisely when their difference is a multiple of . Euclid finds , and Bezout's identity expresses it as an integer combination.
A congruence compares remainders, rather than asserting that two integers are equal.
Congruence and residues
For integers and a positive integer modulus ,
Equivalently, have the same remainder on division by .
The least nonnegative residue is the representative with . The least positive residue is the representative with . These agree unless the remainder is zero; the zero class has least positive representative .
Every integer congruent to has the form , where .
Not in the formula booklet: learn it.
The word “least” selects a representative from infinitely many integers. Writing may be useful during working, but it is not a positive final residue.
Worked example 1: a negative input, a positive remainder
Question. Find the least nonnegative and least positive residues of modulo . Write the congruence and describe all integers in its class.
Plan. Use division with a nonnegative remainder, then check whether that remainder is zero.
Why this step? Reducing a negative integer requires the remainder interval ; taking the absolute value would give a different class.
Answer. Both requested residues are . The class consists of the integers .
Check. ; for example, are also in this class.
Change only the input from to . This time the distinction between the two requested representatives matters.
Worked example 2: the zero class
Question. Find the least nonnegative and least positive residues of modulo .
Plan. Reduce first; if the remainder is zero, move one complete modulus forwards to obtain a positive representative.
Why this step? Zero is nonnegative but not positive. The smallest positive integer congruent to zero modulo is .
Answer. Least nonnegative residue ; least positive residue .
Check. The representatives are the multiples of ; no integer strictly between and is in this class.
A zero remainder is the boundary case where the requested representative range changes the answer.
Watch out
“Least positive residue ” is wrong because zero is not positive. For the zero class modulo , write least nonnegative residue , but least positive residue .
A modulus belongs to the whole congruence statement. Include it in each displayed line so the reader knows which remainders are being compared.
Link congruences without changing the modulus
Integers with the same remainder form a class. This explains why a congruence can be reversed or linked to another congruence with the same modulus.
Three equivalence properties
For integers and the same positive integer modulus :
These follow because , the negative of a multiple of , and the sum of two multiples of are all multiples of .
Not in the formula booklet: learn it.
The modulus is part of the information. A chain of remainder comparisons works only when every link uses the same modulus.
Worked example 3: a valid chain
Question. Suppose and . Show that . Must ?
Plan. Link the two given congruences, then distinguish a congruence class from a single integer.
Why this step? Transitivity identifies the remainder, not the number of whole moduli added to it.
Answer. , but need not equal .
Check. , so is a valid alternative.
Change only the modulus in the second premise from to . A counterexample now tests whether the same conclusion is guaranteed.
Worked example 4: an invalid mixed-modulus chain
Question. Suppose and . Must ?
Plan. Find values satisfying both premises but failing the proposed conclusion.
Why this step? One counterexample disproves a claim that is supposed to hold for every pair of integers satisfying the premises.
Answer. No. The two different moduli do not form a transitive chain modulo .
Check. , while the claimed residue was .
Transitivity is a statement about one fixed remainder system.
Watch out
The proposed chain , , therefore , is invalid: its links use different moduli. With , both premises hold but the conclusion fails.
Reverse a congruence when the direction is inconvenient; preserve its modulus. Then link it only to congruences using that same modulus.
Add and subtract reduced representatives
Once the modulus is fixed, replace large integers by convenient representatives before doing arithmetic. Representatives can be negative during the calculation; reduce to the requested final range afterwards.
Addition and subtraction laws
If and , then
For example, writing and gives
Thus the differences are still multiples of the same modulus.
Not in the formula booklet: learn it.
Continue this lesson.
You’re previewing NovaLearn without an account. Create a free account to read the rest.
Create free account