Can pure randomness measure a constant of pure geometry — π — without circularity? Drop a needle on a ruled floor, count how often it crosses a line, and recover π from nothing but that tally; and does the estimate obey the universal Monte-Carlo error law?
Units: dimensionless (π, a constant of pure geometry; the crossing probability 2L/(πd) is the only place π appears in the physics, and the recovery is arranged so it appears nowhere in the sampling)
▶ Run this simulationRead how it works
Buffon's needle measures π NON-CIRCULARLY: dropping needles of length L on a floor ruled every d, the crossing probability is P = 2L/(πd), so π̂ = 2L/(d·P̂) — recovered as 3.140715 over 24M drops (rel |Δ| = 2.8e-4), and 3.14072 ± 0.0037 across 24 seeds — with π NEVER used to generate the drops. The honesty hinge: the needle's orientation is drawn by REJECTION-SAMPLING a uniform direction in the unit disk (|sinθ| = |b|/√(a²+b²)), so the sampler uses only +,−,·,÷,√ — no Math.PI, no trig; sampling the angle the naive way θ = U·(π/2) would smuggle π into the very experiment meant to recover it. The estimator's RMS error falls as N^(−1/2) (fitted log-log slope −0.531, the universal Monte-Carlo rate: halving the error costs 4× the drops), the seed-to-seed spread matches the CLT prediction √((1−P)/(P·N))·π to 4%, and the recovered π is geometry-independent (same value at L/d = 0.3…0.9). Decisive control: drawing the needle's PROJECTION uniform on [0,1] instead of its ANGLE uniformly makes the IDENTICAL estimator recover 4.000, not π — so π is selected by the uniform-angle crossing statistics, not baked into the formula (Buffon 1777).
Drop a short needle (length L = 0.7d ≤ d) with uniform centre position and uniform orientation on a floor ruled with parallel lines spaced d apart. Integrating the crossing condition over the uniform centre-distance and uniform angle gives the crossing probability P = 2L/(πd), so π is recoverable as π̂ = 2L/(d·P̂) with P̂ = crossings/N. Crucially, the orientation is sampled WITHOUT π: a uniform direction is drawn by rejection-sampling a point in the unit disk (draw (a,b) uniform in [−1,1]², reject if a²+b² > 1) and the perpendicular projection is |sinθ| = |b|/√(a²+b²); the crossing test is t ≤ (L/2)|sinθ| with t uniform on [0, d/2]. π is loaded from the reference ONLY to score. Five checks: (A) 24 seeds × 1e6 drops → pooled and mean π̂; (B) unbiasedness — |mean−π| in units of the standard error of the mean — and the CLT spread — empirical seed-to-seed sd vs √((1−P)/(P·N))·π; (C) Monte-Carlo rate — least-squares log-log slope of the RMS error over N = 32…8192 (400 trials each), predicted −1/2; (D) geometry-independence at L/d = 0.3,0.5,0.7,0.9; (E) a falsification control — draw the projection uniform on [0,1] instead of the angle uniformly, which makes the same estimator recover 4.
Buffon short-needle crossing probability P = 2L/(πd) for L ≤ d with uniform position and uniform orientation; π̂ = 2L/(d·P̂), P̂ = crossings/N
3.140715
0.000279
3.140719
0.00366
0.00075
| L over d | Pi recovered |
|---|---|
| 0.3 | 3.1398 |
| 0.5 | 3.1409 |
| 0.7 | 3.1427 |
| 0.9 | 3.1421 |
0.0029
true
recovered π = 2L/(d·P̂) from the crossing tally of a π-free sampler; π is loaded from the reference only to score, and a scoring self-test confirms a deliberately-wrong reference (π×1.05) makes the oracle FAIL while the recovered value is unchanged. All 15 derisk gates pass (9 physics + 6 on-screen reconciliation), tamper ⇒ exit 1 in both directions (known_value and screen pins).
Buffon's needle (Comte de Buffon, 1777): a short needle (L ≤ d) dropped with uniform centre position t ∈ [0, d/2] and uniform orientation θ crosses a nearest line iff t ≤ (L/2)sin θ; integrating over the uniform (t, θ) gives the crossing probability P = 2L/(πd), so π = 2L/(d·P). This world VALIDATES, not derives: it assumes only the geometry of the drop and recovers π as a pure number from a Bernoulli crossing count, and it is arranged to be NON-CIRCULAR — the orientation is sampled by rejection in the unit disk so the estimator never touches Math.PI or a trig function (sampling θ = U·(π/2) directly would smuggle π into a measurement of π). It is the lab's cleanest instance of geometric probability and Monte-Carlo integration: the estimate is not deterministic but statistical, with RMS error falling as the universal N^(−1/2) rate (the central limit theorem applied to the crossing count), a seed-to-seed spread matching √((1−P)/(P·N))·π, and a recovered value independent of the needle/gap ratio. The uniform-projection control isolates the assumption under test: the same estimator returns 4 when the orientation law is changed, so π is a property of the uniform-angle crossing statistics, not of the formula. It is DISTINCT from ?world=galton (which builds a Gaussian from a binomial cascade) and ?world=polya (recurrence of a random walk): those are limit theorems of a sum; Buffon is a geometric-probability integral evaluated by sampling. Its N^(−1/2) rate is the same law that governs every Monte-Carlo estimator in the lab. The lab's first geometric-probability world.
npm run derisk -- buffon (scripts/buffon-derisk.mjs)scripts/oracles/buffon.reference.jsonG.-L. Leclerc, Comte de Buffon, 'Essai d'arithmétique morale', Supplément à l'Histoire Naturelle, vol. 4 (1777) — the needle problem and P = 2L/(πd). P.-S. Laplace, 'Théorie analytique des probabilités' (1812) — generalization and the use of the needle to estimate π. The N^(−1/2) error is the central limit theorem applied to the Bernoulli(P) crossing count. Reference value: π = 3.14159265358979.