Every real number is a descent between two rationals: a₀ + 1/(a₁ + 1/(a₂ + …)). Cut the descent anywhere and you hold the single best rational no smaller denominator can beat. A. Ya. Khinchin proved the shape of the typical descent — and it is runnable: the convergents, the best-approximation bound, the Gauss–Kuzmin law, and the two constants (Khinchin ≈ 2.6854520010, Lévy ≈ 3.2758) all fall out of the engine, live. The blue team builds and defends; the red team attacks.
source A. Ya. Khinchin, Continued Fractions, Mir Publishers, Moscow, 1964 (3rd Russian ed. 1961) — archive.org/details/khinchin-continued-fractions. Rendered, not quoted.
The convergents are not divided out one by one; they grow from a two-term recurrence. With the partial quotients a₀,a₁,a₂,… feeding in:
pₖ = aₖ·pₖ₋₁ + pₖ₋₂
qₖ = aₖ·qₖ₋₁ + qₖ₋₂
(p₋₁=1, p₋₂=0, q₋₁=0, q₋₂=1)
Two facts hold at every step, and the witness (7) checks both:
Determinant. pₖqₖ₋₁ − pₖ₋₁qₖ = ±1, alternating sign — so every convergent is already in lowest terms.
Best approximation. |x − pₖ/qₖ| < 1/(qₖ·qₖ₊₁) < 1/qₖ². No rational with a denominator below qₖ comes closer.
Lagrange: a continued fraction is eventually periodic ⇔ x is a quadratic irrational. √2 = [1;2̄], φ = [1;1̄], √3 = [1;1,2̄].
Khinchin (1964): for almost every x the geometric mean of a₁…aₙ tends to one universal number K ≈ 2.6854520010 — independent of x. And qₙ1/n → Lévy's eπ²/12ln2 ≈ 3.2758.
Live geometric mean of the current number's quotients: — · K = 2.6855.
The blue team re-derives everything from scratch on load: √2 & φ convergents exact, the determinant identity, the best-approximation bound on π, and the Gauss–Kuzmin law. If red corrupts the recurrence (6), this badge is where it shows.
Feed one real number. Named irrationals carry their exact partial quotients (Lagrange, not floating point); a rational p/q is expanded by the Euclidean algorithm and always terminates; a free decimal is expanded until floating precision runs out.
The convergents, cut at each depth — every number computed from the recurrence on the spot, never looked up:
| k | aₖ | pₖ/qₖ | value | |x − pₖ/qₖ| | 1/qₖ² |
|---|
The output is a ladder of best rationals: each convergent is the closest any fraction gets until you spend a larger denominator. 355/113 nails π to seven places on a three-digit denominator.
The typical number is one you will never write down. The named numbers — the ones mathematics is built from — are all exceptions.
"22/7 is π." Cut. 22/7 is the second convergent; |π − 22/7| ≈ 0.00126. It is a best approximation, not the number.
"Every continued fraction terminates." Cut. Only rationals terminate; an infinite CF is irrationality.
"Khinchin's constant is π's geometric mean." Cut. It is the mean for almost all x. Nobody has proven π is one of them.
The red team's move: corrupt the recurrence — add pₖ₋₁ where the law says pₖ₋₂. The convergents keep marching, but they no longer descend toward x, and the best-approximation bound shatters.
Break the two-term law and the "best rationals" stop being best — the witness (7) recomputes, the error stops shrinking, the badge turns red. The attack is real and it is caught.