Virtual laboratory/Mathematics/Probability/Buffon's needle — π from tossing a needle

Buffon's needle — π from tossing a needle

An extension of the topic of geometric probability. Tossing a needle onto a floor ruled with parallel lines, the probability of crossing a line is $P=2L/(\pi d)$ — from the frequency of crossings one can estimate π, the more accurately the more tosses are made. Surprisingly, π (the circle constant) appears in a problem about tossing a needle. Georges-Louis Leclerc de Buffon posed the problem in 1733 and published the solution in 1777 — the first "Monte Carlo" method.

Buffon's needle — π from tossing a needle
Mathematics · Probability · Buffon’s needle — π from tossing a needle (1777)
Number of needle tosses NN200 tosses
As the number of needle tosses grows, the estimate of π…
N (tosses)
200
crossings
128
estimate of π
3.1250
error |Δ|
0.0166
🎯 Challenge: hit the estimate of π
streak: 0

I’ll give you a target value for the estimate of π — tune the number of tosses N with the slider to reach it.

What just happened?

We toss N needles of length L onto a floor with parallel lines spaced d apart (with L ≤ d). We count how many needles crossed a line. The crossing frequency (crossings/N) approximates the crossing probability: the more tosses, the closer to the true value.

Probability of crossing:

P=2LπdP = \dfrac{2L}{\pi d}

— and this is astonishing: the number π, seemingly tied only to the circle, appears in a problem about tossing needles onto straight lines. Inverting this formula, we estimate π from the crossing frequency:

π≈2L Nd⋅(number of crossings)\pi \approx \dfrac{2L\,N}{d\cdot(\text{number of crossings})}

Taking for simplicity L=dL = d we have P=2/πP = 2/\pi, so π≈2Nnumber of crossings\pi \approx \dfrac{2N}{\text{number of crossings}}.

The invariant — what random sampling does NOT change:

P=2Lπd→ L=d 2π≈0.6366P = \dfrac{2L}{\pi d} \quad\xrightarrow{\,L=d\,}\quad \dfrac{2}{\pi} \approx 0.6366

This frequency is always exactly the same, independent of N — it is pure geometry. Tossing needles only estimates it, with an error that shrinks as N grows (the law of large numbers). π appears here because the distribution of the angle at which the needle lands is rotationally symmetric (it is “round”).

Where did this method come from?

The problem was posed by Georges-Louis Leclerc, Count de Buffon, in 1733, and he published the solution in 1777 (in “Essai d’arithmétique morale”). It is one of the first and most famous problems of geometric probability — and the first “Monte Carlo” method (estimating a value through random sampling) long before the technique was named. What is surprising is that by tossing a needle onto parallel lines and counting how often the needle crosses a line, one can experimentally estimate the number π.

What does this mean in practice?

This is a general idea: when an exact calculation is hard, random sampling gives a good approximation. The same principle drives today’s Monte Carlo simulations in physics, finance and machine learning — Buffon’s needle is its oldest, geometric ancestor.

Why you need this for the exam:

Geometric-probability problems are computed exactly from the ratio of measures (lengths, areas, angles), not from random sampling. Buffon’s needle shows the intuition for how such a ratio — here 2L/(πd) — links geometry with probability.

Remember: more tosses ⇒ smaller estimation error, but the crossing frequency 2L/(πd) has always been constant — tossing needles only uncovers it.

Illustrative model · NexTutor Virtual laboratory

Enjoyed the experiment? Share it.

It's free — send it to friends from school.

Theory & formulas

Probability of crossing

A needle of length LL tossed onto lines spaced dd apart (with L≤dL\le d) crosses a line with probability: P=2LπdP=\frac{2L}{\pi d}

Estimating π

From the crossing frequency P≈crossingstossesP\approx\dfrac{\text{crossings}}{\text{tosses}} we compute: π≈2Ld P\pi\approx \frac{2L}{d\,P}

Why π

The needle's angle of landing has a rotationally symmetric distribution (it is "round") — hence π\pi appears in the result. This is the first Monte Carlo-type method.

Notation: LL needle length, dd line spacing, PP probability of crossing.

Frequently asked questions

›

How does tossing a needle let us estimate π?

From the frequency with which the needle crosses the parallel lines — that frequency tends to 2L/(πd), so from it we compute π.

›

Why does π appear in this problem?

Because the distribution of the angle at which the needle lands is rotationally symmetric (it is "round").

›

Who posed Buffon's needle problem?

Georges-Louis Leclerc de Buffon — he posed it in 1733 and published the solution in 1777.

Teaching? Embed this experiment on your site.

Free widget — paste it on your school site, blog or notes. It links to the full version.

Teaching a class or tutoring? Guide students in NexTutor →