Needles on a lined floor — green = crosses a line, grey = misses
Convergence of the π estimate vs number of drops

About Buffon's Needle

Written by MySimulator Team · Reviewed by MySimulator Editorial Review

Last updated: 5 July 2026

Buffon's Needle is a classical probability experiment proposed by the French mathematician Georges-Louis Leclerc, Comte de Buffon, in 1777. A needle of length L is dropped at random onto a surface ruled with parallel lines spaced d apart (with L ≤ d). The probability that the needle crosses a line is P = 2L/(π·d), which involves π in a purely geometric context. Rearranging gives π ≈ 2·L·N/(d·crossings), where N is the number of drops and crossings is the count of needles that land across a line. This is one of the earliest and most elegant Monte Carlo methods — using random sampling to estimate a mathematical constant — and it converges to the true value of π as N increases, by the law of large numbers.

The simulation drops needles at random positions and orientations, highlights crossing needles in green and non-crossing ones in grey, and plots the convergence of the π estimate against number of drops on a second chart. You can control the needle-to-spacing ratio L/d (0.1–1.0) and the drop speed (1–30 needles per frame), drop 100 needles in a single burst, or let the animation run continuously to watch the estimate tighten around 3.14159.

Frequently Asked Questions

How does dropping needles estimate π?

Let x be the perpendicular distance from the needle's centre to the nearest line (uniform on [0, d/2]) and θ its acute angle with the lines (uniform on [0, π/2]). The needle crosses when x ≤ (L/2)·sin θ. Integrating over both uniform distributions gives the crossing probability P = 2L/(πd). Solving for π yields π = 2L/(Pd). Replacing the true probability P with the observed fraction crossings/N gives the estimate π ≈ 2LN/(d·crossings).

How quickly does the estimate converge to π?

By the central limit theorem, the standard error of a Monte Carlo π estimate scales as 1/√N. To gain one extra decimal digit of accuracy you need roughly 100 times more drops. After 10,000 drops you can typically expect about 2 correct decimal places; after 1,000,000 drops, about 3. The convergence chart shows the estimate oscillating around π = 3.14159 and gradually tightening, which is the law of large numbers in visual form.

What happens if the needle is longer than the line spacing (L > d)?

When L > d the simple formula P = 2L/(πd) no longer holds because a long needle can cross multiple lines. The general formula for the "long needle" case is P = (2L)/(πd) − (2/π)·[L/d − √((L/d)² − 1) + arccos(d/L)/(d/L)] when L > d. This simulation uses L/d ≤ 1.0 (the short needle case) where the formula is exact and simpler to derive.

Who was the Comte de Buffon?

Georges-Louis Leclerc, Comte de Buffon (1707–1788), was a French naturalist, mathematician, and cosmologist best known for his 44-volume Natural History encyclopedia. His needle problem, presented to the Royal Academy of Sciences in 1777, was one of the first applications of geometric probability. Buffon also proposed early theories of evolution, suggested the Earth was much older than biblical accounts indicated (estimating 75,000 years based on metal cooling rates), and influenced later naturalists including Darwin.

What is the law of large numbers?

The law of large numbers states that as the number of independent trials N increases, the sample average converges to the true expected value. In the needle experiment, the observed crossing fraction (crossings/N) converges to the true probability P = 2L/(πd), and therefore the estimate π = 2LN/(d·crossings) converges to the true value π. There are two versions: the weak law (convergence in probability) and the strong law (almost sure convergence).

Has anyone used the physical experiment to estimate π?

Yes. In 1901 the Italian mathematician Mario Lazzarini claimed to have obtained π ≈ 3.14159265 using 3,408 needle throws — suspiciously accurate for the sample size. Statistical analysis suggests his result was either fraudulent or a case of "optional stopping" (stopping when the estimate happened to be good). More reliable experiments typically obtain 2–3 accurate decimal places with thousands of throws. Modern computers can perform billions of virtual throws in seconds.

How does the needle length ratio L/d affect the crossing probability?

The crossing probability P = 2L/(πd) is directly proportional to L/d. With L/d = 1 (needle as long as the line spacing), P = 2/π ≈ 0.6366, so about 64% of needles cross a line. With L/d = 0.5, P ≈ 0.318, so about 32% cross. A higher crossing probability gives more crossings per drop, reducing variance and making the estimate converge somewhat faster, but the trade-off is that very short needles cross very rarely, increasing variance again.

Is this the most efficient way to compute π?

No. Modern algorithms like Machin-like series (π/4 = 4·arctan(1/5) − arctan(1/239)) or the Bailey–Borwein–Plouffe (BBP) formula can compute billions of digits of π using deterministic arithmetic. Monte Carlo methods like Buffon's Needle are interesting theoretically and historically but are computationally inefficient for high-precision π calculation. They do remain important in statistical physics and risk modelling for estimating multi-dimensional integrals that have no closed form.

What does the convergence chart show?

The convergence chart plots the running π estimate (green line) against the number of drops N on the horizontal axis. A dashed amber line at y = 3.14159 marks the true value. Early in the experiment the estimate fluctuates wildly; as N grows the green line settles closer to the dashed reference. The characteristic "funnel" shape — wide scatter early, narrower late — is a direct visual demonstration that standard deviation decreases as 1/√N.

Are there other geometric probability experiments like Buffon's Needle?

Yes. Buffon's Noodle generalises the experiment to a curved needle of the same length, giving the same probability formula (elegantly explained by Cauchy's theorem). The Bertrand paradox asks for the probability that a random chord of a circle is longer than the side of the inscribed equilateral triangle, with three different "natural" answers depending on how "random chord" is defined. Monte Carlo estimation of π can also be done by randomly placing points in a unit square and checking if they fall inside the inscribed quarter-circle (area ratio π/4).