Clock arithmetic
Ukurasa huu bado haujatafsiriwa kwa Kiswahili, kwa hiyo unaonyeshwa kwa English.
Saidia kutafsiri →Swali
It's 9 o'clock. What time will it be in 5 hours — and in 29 hours? Can a clock teach us a whole new kind of arithmetic?
Fanya jaribio kabla ya kuendelea kusoma. Hakuna njia mbaya ya kuchunguza.
Jaribio
Maabara ya saa
Kwenye saa yenye saa k, kuhesabu huzunguka na kuanza upya. Chunguza kujumlisha na kuzidisha.
9 + 5 = 14 ≡ 2 (mod 12)
Kusonga mbele saa 14 kwenye saa ya saa 12 kunakufikisha 2: baki unapogawanya 14 kwa 12.
Vidokezo, ukivitaka
Kinachoendelea
Kinachoendelea
On a clock with hours, counting wraps around: after comes again. Two numbers land on the same position exactly when they have the same remainder after division by . Mathematicians write
(" is congruent to modulo ") when and leave the same remainder. So , and as well.
/-- On a 12-hour clock, 5 hours after 9 o'clock is 2 o'clock: `(9 + 5) mod 12 = 2`. -/
theorem clock_wraps : (9 + 5) % 12 = 2 := by decideClock arithmetic has its own multiplication too, and something remarkable happens. On a 7-hour clock, , so acts like "one third"! On a 4-hour clock, though, has no partner at all: is always or .
/-- Modulo 7, the number 3 has an inverse, namely 5: `3 · 5 = 15 = 2 · 7 + 1`. -/
theorem three_inv_mod_seven : (3 * 5) % 7 = 1 := by decide/-- Modulo 4, the number 2 has **no** inverse: `2 · x` is always even, so it is never `1`
more than a multiple of 4. `decide` checks all four possibilities `x = 0, 1, 2, 3`. -/
theorem two_no_inv_mod_four : ∀ x : Fin 4, (2 * x.val) % 4 ≠ 1 := by decideThe pattern you can see in the experiment is a theorem: has a multiplicative partner modulo exactly when and have no common factor except . The table is evidence for small ; the proof, which uses Bézout's identity, comes in number theory. When is prime, every non-zero number has a partner — so arithmetic on a prime clock behaves like arithmetic with fractions. These number systems are called , and for prime they are examples of finite fields.
/-- Modulo 5 (a prime), every non-zero number has an inverse:
`1·1 = 1`, `2·3 = 6`, `3·2 = 6`, `4·4 = 16`, and each of these leaves remainder 1.
`decide` checks every `a` and searches for each `b`. -/
theorem inverses_mod_five : ∀ a : Fin 5, a.val ≠ 0 → ∃ b : Fin 5, (a.val * b.val) % 5 = 1 := by
decideModular arithmetic is not only a curiosity. It underlies calendars and check digits on identity numbers, and it is the foundation of much of modern cryptography.
Hii inaelekea wapi
- Darasa la 6–8 · ImepangwaClock arithmetic: remainders and modular arithmeticArithmetic on a clock: working with remainders on division by n, addition and multiplication tables modulo n, repeating patterns, and calendar and game puzzles.
- Shahada ya kwanza (mwanzo) · ImepangwaCongruencesCongruence modulo n as an equivalence relation compatible with addition and multiplication; linear congruences, inverses modulo n, the Chinese remainder theorem, and the theorems of Fermat, Euler and Wilson.
- Shahada ya kwanza (juu) · ImepangwaQuotient groups and quotient ringsCollapsing a group by a normal subgroup or a ring by an ideal: cosets as elements, well-defined operations, the isomorphism theorems, ℤ/nℤ as ℤ modulo nℤ, and fields built as quotients of polynomial rings.