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 7 of 30

Combine congruences without losing compatibility

Construct CRT solutions and prove uniqueness modulo the correct common period.

Loading your saved responses…

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

Try

Find an integer that leaves remainder one modulo four and remainder two modulo seven. Trying x=1+4t reduces the second condition to 4t≡1 modulo seven. The inverse of four is two, so t≡2 and x≡9 modulo twenty-eight. The two clocks determine one combined clock when their periods are coprime.

Predict

Predict what changes if the periods share a factor. Conditions x≡0 modulo four and x≡1 modulo six are impossible because the first requires even x and the second odd x. Shared information must agree. When compatible, the combined period is the least common multiple, not automatically the product. This compatibility test prevents treating CRT as an unconditional recipe for arbitrary moduli.

Experiment

Construct selector coefficients for moduli four and seven.

SelectorModulo 4Modulo 7
2110
801

The combination 1·21+2·8=37 reduces to nine modulo twenty-eight. Change the desired residues and reuse the selectors. Each selector behaves like a coordinate basis vector for the pair of residue systems.

Understand

For pairwise coprime positive moduli m₁,…, m_k, let M be their product and Mᵢ=M/mᵢ. Since gcd(Mᵢ, mᵢ)=1, choose uᵢ with uᵢMᵢ≡1 modulo mᵢ. Then x=ΣaᵢuᵢMᵢ realizes the desired residues. At modulus mᵢ its own term remains aᵢ and all other terms vanish. If two solutions exist, their difference is divisible by every mᵢ; coprimality implies divisibility by M. This proves existence and uniqueness modulo M. The correspondence respects addition and multiplication, so it is also a ring decomposition, not merely a counting trick.

Apply

For two arbitrary positive moduli m, n, put d=gcd(m, n). Necessity of d|(a−b) follows from subtracting x−a and x−b. Conversely set x=a+mt and solve mt≡b−a modulo n. The linear-congruence criterion supplies t exactly when d divides the difference. All solution differences are divisible by both m and n, hence by lcm(m, n), and adding that lcm preserves both conditions. This proves the generalized two-modulus theorem. Multiple noncoprime conditions can be combined successively, checking compatibility at each stage rather than assuming pairwise-independent clocks.

The construction also gives an independence interpretation: choosing one residue in each coprime component selects exactly one class modulo the product. There are mn possible pairs and mn classes, but matching counts alone does not prove the map is bijective. Existence comes from the explicit Bézout formula, and uniqueness comes from divisibility by both coprime moduli. For noncoprime m, n, subtracting the two target congruences shows the residues must agree modulo gcd(m, n). When they do, dividing the resulting linear equation by that gcd gives a solution, unique modulo lcm(m, n). This is compatibility, not independent free choice.

Continue

CRT will later turn prime-power congruence solutions into solutions modulo a composite integer and explain why some cryptographic exponent identities hold even on nonunits. Its constructive coefficients can be large, so implementations should reduce intermediate results and protect exactness. Verify both residues independently after construction. A returned representative is only one member of an infinite integer class; any application-specific interval or sign restriction still needs a separate final selection.

Return to the number theory unit to choose a targeted retry. Continue with use permutation of units to control powers.

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 x with x≡2 mod 3 and x≡3 mod 5.

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

Compatible congruences modulo 6 and 15 determine a class modulo what least common multiple?

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

For pairwise coprime m_i, derive the standard CRT sum.

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 uniqueness modulo M for pairwise coprime moduli.

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.

Solve x≡1 mod 6 and x≡4 mod 9.

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 two congruences x≡a mod m, x≡b mod n are compatible iff gcd(m, n)|(a−b).

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.