taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Exercise · Volume 1 · 1.2.4-14

Exercise 1.2.4-14

proved in Lean solution written

Rating12
Markersrecommended
KindK3, find a value: compute a number, a set or a closed form from the written solution
SectionSection 1.2.4 of Volume 1. Companion chapter: Integer functions and elementary number theory

The task

Find x mod 15x \bmod 15 when x mod 3=2x \bmod 3 = 2 and x mod 5=3x \bmod 5 = 3.

The exact wording is in your copy of the book.

Hints

Open one hint at a time. Try the exercise again after each.

Hint 1

Look for a number that has the same two remainders. Then compare it to xx.

Hint 2

Law D turns two congruences with relatively prime moduli into one congruence modulo the product.

Solution

Show the solution

Search for a small number with both remainders. The numbers with remainder 33 modulo 55 are 3,8,13,…3, 8, 13, \ldots. Of these, 3 mod 3=03 \bmod 3 = 0, 8 mod 3=28 \bmod 3 = 2. So 88 has both remainders.

Now x≡8(mod3)x \equiv 8 \pmod 3 and x≡8(mod5)x \equiv 8 \pmod 5, since both sides have the same remainder. Since 3⊥53 \perp 5, Law D gives x≡8(mod15)x \equiv 8 \pmod{15}. Since 0≤8<150 \le 8 < 15, the remainder is x mod 15=8x \bmod 15 = 8 (Exercise 1.2.4-16).

Check

Take x=23x = 23: 23 mod 3=223 \bmod 3 = 2, 23 mod 5=323 \bmod 5 = 3 and 23 mod 15=823 \bmod 15 = 8. Take x=−7x = -7: −7 mod 3=2-7 \bmod 3 = 2, −7 mod 5=3-7 \bmod 5 = 3 and −7 mod 15=8-7 \bmod 15 = 8. Among 0,…,140, \ldots, 14 only 88 has both remainders.

Remarks

This is the smallest case of the Chinese remainder theorem. The solution is unique modulo 1515: two solutions differ by a number that both 33 and 55 divide, so by a multiple of 1515.

This solution is checked, and a person has not reviewed it yet. The source.

In Lean

proved The statement and its proof are in Lean. The kernel accepts the proof, and it uses the standard axioms only.

The status is computed from the Lean build. The node of the map.

Something is wrong? Report it.