◄ WORLD IV · SONIATHE OCHO · blue builds │ the machine │ red breaks

THE CONTINUED FRACTION

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.

◧ blue team · builds & defends
3

THE MODEL — the recurrence

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.

5

THE LINEAGE — periodicity & the constants Khinchin

Lagrange: a continued fraction is eventually periodic ⇔ x is a quadratic irrational. √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.

7

THE WITNESS live

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.

▼ the machine ▼
4

DATA IN — the number in ↓

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.

7
▼   expand into partial quotients   ▼
0

▣ THE PANEL — the descent LIT

The convergents, cut at each depth — every number computed from the recurrence on the spot, never looked up:

kaₖpₖ/qₖvalue|x − pₖ/qₖ|1/qₖ²
▼   the descent emits the best rational   ▼
8

DATA OUT — the best rational out ↓

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.

red team · attacks & breaks ◨
1

THE ADVERSARY

WALL Khinchin's constant holds for almost every number — a set of full measure — yet not one number you can name is known to obey it. Rationals stop (finite CF). Quadratic irrationals are periodic and bounded: √2's mean is exactly 2, never 2.685. And e = [2;1,2,1,1,4,…] has unbounded quotients whose mean diverges. Whether π is Khinchin-typical is conjectured, unproven.

The typical number is one you will never write down. The named numbers — the ones mathematics is built from — are all exceptions.

2

THE GRAVEYARD

"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.

6

THE TAMPER — break it

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.