Abakcus
← All DIY cards

DIY · Card 100 · Math · Probability

Buffon’s Needle: How to Find π by Dropping Toothpicks

A box of toothpicks, a sheet of lined paper, and nothing but chance. Drop the sticks, count how many land across a line, and out comes π, the number of circles, from a game with no circles in it.

Time
30 minutes
Difficulty
Grown-up
Not needed
Mess
Toothpicks everywhere

01The brief

Drop sticks. Count. Get π.

2 ⁄ π ≈ 64 %

of sticks cross a line when the lines are one stick apart

π ≈ 2N ⁄ C

N drops, C crossings: the whole recipe

1733

when the Comte de Buffon first posed the puzzle

π is the number you get when you divide a circle’s distance around by its distance across. So it is strange to find it in a game where you throw sticks on a floor of straight lines. Yet it’s there: the chance that a stick lands across a line has π hidden inside it.

For the hundredth card in this series, we end where mathematics and chance meet. If you liked watching randomness make a pattern on the Galton board, or seeing why a circle’s area is πr² on the area of a circle card, this is where the two ideas meet.

02Kit

What you need

Toothpicks, paper and patience.

Tick off what you have

0 of 4 ready

03Method

Eight steps, from toothpicks to π

Measure, rule, drop, count, repeat.

Step 1 of 8 · Minute 0

Gather the kit

You need a box of toothpicks (all the same length), a big sheet of paper, a ruler, a pen, a calculator, and paper to keep score.

Why
Toothpicks play the part of Buffon’s needles. They must all be the same length, because that length goes into the formula.
Watch for
A pile of identical toothpicks.

If it doesn’t work

My answer is far from 3.14.

Why

Not enough drops. A hundred drops can easily give anything from about 2.9 to 3.4.

Fix

Keep going to 500 or 1,000 drops, or pool your results with friends.

The answer is always too high or too low.

Why

The lines are not exactly one toothpick apart, or you are aiming the drops.

Fix

Re-measure the spacing, and drop from higher so the toothpicks spin and scatter.

I can’t tell if one is crossing.

Why

It is touching or nearly touching the line.

Fix

Count touching as crossing, and use a fine pen for the lines so it’s clearer.

04Why π?

A thousand drops in a second

Your kitchen table gives you a few hundred drops an hour. A computer can drop thousands a second. Try it, and watch the estimate settle:

Drops

0

Crossings

0

Estimate of π

—

Typical error

—

π = 3.14159…3.742.54

Orange needles cross a line, teal ones don’t. With needles as long as the gap, about 64 % cross, and π ≈ 2 × drops ÷ crossings. The estimate jumps about at first, then settles, but slowly: to make the error ten times smaller, you need a hundred times as many drops.

So where does π come from? Describe each drop by two numbers: the needle’s angle, and how far its centre lands from the nearest line. Every drop is then a point in a box, and the crossing drops fill a curved hump:

0π⁄2πangle of the needle →t⁄20↑ distance from centre to nearest line

Shaded area ÷ box

63.7 %

Points in the shade

—

2l ⁄ (πt)

0.6366

Every possible drop is a point in this box, and every point is equally likely. The needle crosses a line when its centre is closer to the line than half its height, (l⁄2) sin(angle): the orange hump. The area under a sine arch is 2, so the hump’s area is l, and the box’s area is π × t⁄2. That is where π sneaks in: through the angle.

05The big idea

Chance can
calculate.

One toothpick tells you nothing. A thousand toothpicks tell you π to two decimal places. Randomness on its own is useless, but randomness counted carefully, many times over, becomes a measuring instrument.

That idea, born as a parlour puzzle in the 1700s, now runs weather forecasts, designs medicines and lights the films you watch. Not bad for a box of toothpicks.

06The math

Probability, area and π

1 · Buffon’s answer

P = 2l ⁄ (πt)

Needle length l, line spacing t, with l ≤ t.

2 · Turned around

π ≈ 2lN ⁄ (tC)

N drops, C crossings.

3 · How close

error ∝ 1 ⁄ √N

The error shrinks with the square root of the drops.

Let the needle’s centre land a distance x from the nearest line (between 0 and t⁄2) at an angle θ (between 0 and π). It reaches the line when x ≤ (l⁄2) sin θ. All the possible drops fill a box of area (t⁄2) × π; the crossing ones fill the area under the curve, ∫ (l⁄2) sin θ dθ = l. So the chance of crossing is l ⁄ (πt⁄2) = 2l ⁄ (πt).

With l = t the chance is 2 ⁄ π ≈ 0.637, and π ≈ 2N ⁄ C. After N drops the typical error is about 2.4 ⁄ √N: roughly 0.24 after 100 drops, 0.08 after 1,000 and 0.024 after 10,000. Each new correct digit costs a hundred times more drops, which is why nobody computes π this way, and why it is such a good lesson in how chance behaves.

07Real life

The Monte Carlo method

Buffon’s idea, grown up.

  • The atomic age

    In the 1940s, Stanisław Ulam, recovering from an illness and playing patience, wondered if he could find the chance of winning by just playing many games. With John von Neumann at Los Alamos he turned the idea into the Monte Carlo method, named after the casino.

  • Weather forecasts

    Forecasters run their weather model dozens of times from slightly different starting points. The share of runs that bring rain becomes the chance of rain you see on your phone.

  • Animated films

    To light a computer-animated scene, software traces millions of random light paths and averages them. That is Monte Carlo too, and why early test renders look speckled.

  • Opinion polls

    Asking a thousand randomly chosen people is a random experiment, like dropping a thousand needles. It gives an answer within a few percent, for the same 1 ⁄ √N reason.

  • Game-playing computers

    In 2016 the program AlphaGo beat one of the world’s best Go players. Part of how it chose moves was a Monte Carlo search: playing out many random futures and counting which moves won most often.

  • Radiotherapy

    Hospitals plan cancer treatment by simulating the random paths of millions of particles through the body, to work out exactly where the radiation dose will go.

1777

Georges-Louis Leclerc, Comte de Buffon, was a famous naturalist who wrote a vast history of the natural world. In 1733 he asked the Paris Academy of Sciences a gambler’s question about a stick dropped on a floor of planks, and in 1777 he published the answer, with π in it.

In 1901 the Italian Mario Lazzarini reported dropping a needle 3,408 times and getting π as 3.1415929, correct to six decimal places. It was exactly the old fraction 355 ⁄ 113. Mathematicians have since shown how unlikely that is by fair chance; most likely he stopped at just the right moment. Real, honest drops are never that lucky.

08Is and isn’t

Four things people believe about Buffon’s needle

You need circles to find π.

No circle appears anywhere: just straight lines and straight sticks. π comes in through the angles at which the sticks land.

It needs a needle.

Any straight stick works. In 1860 Joseph-Émile Barbier showed that even a bent ‘noodle’ of length l crosses lines 2l ⁄ (πt) times on average.

Every extra drop makes the answer better.

Not every time. The estimate wanders up and down. Only on average, over many drops, does it home in on π.

In 1901 Lazzarini proved it gives π to six places.

He claimed 3.1415929 from 3,408 drops, but that is exactly 355 ⁄ 113, a famous fraction. His numbers are almost certainly too good to be true.

09Go further

Five more things to try

  1. A

    Shorter needles

    Cut toothpicks in half and keep the same lines. Now π ≈ 2 × l × drops ⁄ (t × crossings). Does it still work?

  2. B

    Buffon’s noodle

    Bend pipe cleaners of the same length into curves. Count crossings, not sticks: a curve can cross more than once.

  3. C

    Rice and a circle

    Draw a circle inside a square and sprinkle rice over both. The share landing in the circle is π ⁄ 4. Another Monte Carlo π!

  4. D

    Class record

    Pool every drop in your class or school. Keep a running total on the board and plot the estimate after each round.

  5. E

    Spot a cheat

    Look up Lazzarini’s numbers: 3,408 drops and 1,808 crossings. Why is 3,408 such a suspicious number to stop at?

10Questions

Buffon’s needle, quickly answered

What is Buffon’s needle?

A probability puzzle posed by the French naturalist Buffon in 1733: if you drop a needle on a floor of parallel lines, what is the chance it lands across a line? The answer, 2l ⁄ (πt) for a needle of length l and lines t apart, contains π.

How do you estimate π with toothpicks?

Draw parallel lines one toothpick-length apart, drop toothpicks on them at random, and count how many cross a line. Then π ≈ 2 × drops ÷ crossings. The more drops, the closer you get.

Why does π appear in Buffon’s needle?

Because the needle can land at any angle. Whether it crosses depends on the sine of that angle, and averaging a sine over half a turn brings in π, the same π that measures half a turn in radians.

How many drops do you need to get π right?

Roughly, the error shrinks like 1 ⁄ √N. A hundred drops typically land within about 0.24 of π, a thousand within 0.08, ten thousand within 0.02. Each extra correct digit costs about a hundred times more drops.

What is the Monte Carlo method?

Solving a problem by running many random trials and counting results, as Buffon’s needle does. Named in the 1940s by scientists at Los Alamos, it is now used everywhere from weather forecasting to film animation.

Safety · Toothpicks are sharp at both ends: drop them on a table, not near faces, and keep them away from very young children. Use real needles only with a grown-up.

All DIY cards →