Learn

Learning preferences

Make learning more comfortable. Changes apply immediately.

Enlarges page content, including diagrams and their labels. You can also use your browser’s zoom.

Choose the colours that are easiest for you to distinguish. Applies to lesson diagrams and lab plots. Labels, shapes, hatching and line patterns also distinguish meanings. Source photographs and raw image brightness stay unchanged; mask-only views are available for image overlays.

ExampleComparisonSample link

Saved in this browser on this device. Preferences are separate from progress backups.

Lesson 5 of 30

Calculate with classes while respecting cancellation

Prove congruence arithmetic and distinguish units from zero divisors.

Loading your saved responses…

Try the optional starting-point checks and targeted refreshers. You can continue directly into this lesson.

Try

The integers 2, 9, 16 and −5 all leave the same remainder modulo seven. We write a≡b mod m when m divides a−b, always taking m>0 here. A congruence concerns a whole class of integers, not only the chosen remainder. Working with classes lets large calculations be reduced to small representatives, provided the operations do not depend on which representative was selected.

Predict

Predict whether division behaves like addition and multiplication. Modulo eight, 2·1 and 2·5 are equal, yet 1 and 5 are different classes. Cancelling the factor two would be invalid. The issue is not a technicality: two is a zero divisor because 2·4≡0 although neither factor is zero. Inverses exist only for classes coprime to the modulus.

Experiment

Inspect multiplication by two modulo eight.

Input classProduct class
00
12
24
36
40

Continue the table and find the collisions. Compare multiplication by three, which permutes all eight classes. Explain this contrast using gcd information rather than merely observing the completed tables.

Understand

Congruence is an equivalence relation: zero differences give reflexivity, negation gives symmetry, and addition of divisible differences gives transitivity. Addition and multiplication descend to classes because differences of sums and products remain divisible by m. In particular, ab−a′b′=(a−a′)b+a′(b−b′). These operations form the residue ring Z/mZ. A class a is a unit exactly when gcd(a, m)=1: Bézout supplies an inverse in one direction, and an equation ab≡1 forces every common divisor to divide one in the other. For a prime modulus every nonzero class is a unit, giving a field. For composite m, a nontrivial factorization m=uv exhibits zero divisors.

Apply

Integer polynomial substitution respects congruence by repeated products and sums. This makes modular arithmetic useful for impossibility proofs: squares modulo four are only zero or one, so a number congruent to three modulo four cannot be a sum of two squares. Such a congruence obstruction is necessary information, not generally a complete existence criterion. Also distinguish equality of integers from equality of classes: replacing an integer by its residue is valid inside a congruence calculation but not in an ordinary magnitude estimate or inequality.

To diagnose an illegal cancellation, record the exact divisor lost. From ac=bc modulo n one knows n divides c(a−b). If g=gcd(c, n), dividing by g and using coprimality proves a=b modulo n/g. That weaker modulus is the generally valid conclusion. For example, two times one equals two times four modulo six, but one and four agree only modulo three. Cancellation modulo the original n requires g=1.

Continue

Keep the modulus visible in every chain of congruences, especially when it changes during a proof. A written implementation should normalize negative remainders consistently and avoid overflow in multiplication before reduction. The next lesson solves ax≡b by converting it to an integer equation and shows how many distinct solutions exist. The cancellation failure above will become an exact gcd condition rather than a collection of exceptional examples.

Return to the number theory unit to choose a targeted retry. Continue with count every solution to a modular linear equation.

Apply · explain · revise

Practice and reasoning

Drafts save locally as you type. Reveal worked solutions when useful; the site remembers that exposure. Automatic matches check the requested answer, while written arguments require review against the rubric.

Find the least nonnegative residue of 17² modulo 7.

Integers, fractions and finite decimals are accepted. Expressions such as sqrt(2) are not parsed by this checker.

How many residue classes modulo 12 are units?

Integers, fractions and finite decimals are accepted. Expressions such as sqrt(2) are not parsed by this checker.

Prove congruent representatives give congruent products.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Give a counterexample to cancellation modulo a composite modulus and state a sufficient repair.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Prove every nonzero class modulo prime p has an inverse.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Prove integer-coefficient polynomial evaluation respects congruence.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Reflect and continue

Before marking this lesson complete, explain one key idea without the worked solution and identify a condition that matters. Marking complete records participation, not independent mastery.