aidoesscience
aidoesscience › Buffon · π
Validating · validations

Buffon's needle · Monte-Carlo π

Can pure randomness measure π? Drop needles on a ruled floor and count how often they cross a line.

Buffon's needle · Monte-Carlo π simulation running in the browser

▶ Run the simulationSee the measured result

Known value
3.1415927

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)

How the lab tests it

Drop N needles of length L on a floor ruled with lines spaced d apart (L < d): each needle's centre-to-line distance and angle are uniform, so the crossing probability integrates to P = 2L/(πd). Tally the crossings and invert: π̂ = 2L/(d·P̂). A separate experiment runs 200 independent estimates at each N to measure the estimator's RMS error.

What it checks

π recovered from a crossing tally (π̂ = 2L/(d·P̂)); and the universal Monte-Carlo convergence rate — the RMS error falling as N^(−1/2) (halving the error costs 4× the samples), the same √N law that makes Monte-Carlo integration slow but dimension-blind

Buffon's needle calculator: π from a tally, the crossing probability, and the drops it costs

Buffon asked the question in 1777 and it is still the strangest result in elementary geometry: drop a needle of length L on a floor ruled with parallel lines a distance d apart, and the chance it lands across a line is 2L/(πd). Nothing is curved, nothing is measured with a protractor, and π walks out of a tally of hits and misses. Invert it and you have an instrument — π̂ = 2L/(d·P̂) — which is the oldest Monte-Carlo method there is, older than the name by 170 years. The catch is circularity, and this page is built around it: if you sample the needle's angle the natural way, θ = U·(π/2), you have put π inside the machine that is supposed to be measuring it. The lab's simulation does not; it draws a uniform direction by rejecting points outside the unit disk and takes |sinθ| = |b|/√(a²+b²), so the sampler uses nothing but +, −, ×, ÷ and a square root, and neither does the calculator below. π is typed nowhere on this page. It is reached only to SCORE an answer, and the one direction that spends it says so in its first sentence. What you get back is honest about its own limits in the way a Monte-Carlo estimate has to be: every recovered π̂ carries the standard error √((1−P)/(PN))·π̂ that its crossing count entitles it to, the planning direction shows why one more decimal place costs a hundred times the drops, and the tally's own granularity — one crossing moves π̂ by π̂/C — is reported, because an experiment cannot resolve what its counter cannot. That is also the arithmetic that convicts Lazzarini, whose famous 1901 needle run returned exactly 355/113 from 3408 tosses: this page recovers his π̂ from his own tally, prices his apparatus's standard error, and reports how many times finer his claim is than the instrument that produced it. The rival is a dial rather than a paragraph: g mixes the two orientation laws draw by draw, so g = 1 hands π back as a self-test and g = 0 returns 4 exactly — same needle, same floor, same estimator, different answer, which is the whole falsification. And the last direction re-executes the shipped module's own stream, cosmetic needles and all, to reproduce the number on the screen above. Four things this page will not do: turn a standard error into a guarantee of correct decimals, model a needle that bounces or lands off the floor, handle a floor ruled in two directions (that is Buffon–Laplace, a different integral), or claim more precision from the long-needle branch than Math.acos is specified to give.

P = 2L/(πd) for L ≤ d · π̂ = 2L/(d·P̂) = 2LN/(dC) · SE(π̂) = π̂·√((1−P)/(PN)) ⇒ N = (1−P)/(P·ε²) · long needle: P = (2/π)·(m − √(m²−1) + arcsec m), m = L/d · uniform PROJECTION instead of uniform angle: the same estimator returns 4

—
This simulation has a catalogued, oracle-checked result: Buffon's needle measures π NON-CIRCULARLY.