Buffon's Needle
Drop a needle of length l onto a floor ruled with parallel lines a distance d apart. When the needle is no longer than the gap, the chance it crosses a line is \(2l/(\pi d)\). PictorX runs the throws for you, draws each one, and turns the count around so the same experiment estimates \(\pi\).
How it works
- Open this page and press play. Needles fall on the lines at random.
- Watch \(\pi\) settle. With the needle at half the gap, it is throws divided by crossings.
- Open the sine diagram, place one needle by hand, or drop a thousand at once, then save a PNG.
Two numbers decide a crossing
A throw is fixed by the distance x from the center of the needle to the nearest line, and by the angle \(\theta\) between the needle and the lines. x runs from 0 to \(d/2\). \(\theta\) runs from 0 to \(\pi\), because a needle has no head and a half-turn covers every direction. The needle crosses when \(x\le (l/2)\sin \theta\).
The short-needle formula
For \(l\le d\) the chance of a crossing is \(P=2l/(\pi d)\). The pairs \((\theta ,\,x)\) fill a rectangle \(\pi\) wide and \(d/2\) tall. The crossings are the area under the sine curve, and that area is l. Dividing the two areas leaves \(\pi\) in the denominator. At \(l=d/2\) the chance is \(1/\pi\), so \(\pi\) is about throws divided by crossings.
A slow way to find π
The rearranged formula is
\[\pi \approx 2l\cdot \frac{N}{d\cdot N_{hit}}\,.\]
It is a Monte Carlo estimate, and an inefficient one. A few thousand throws usually make the first digits recognizable. The next digit takes a much larger count.
The ± beside the readout is one standard error of the ratio. Drag on the floor to lay a single needle and see its x and \(\theta\). That needle is drawn and left out of the count.
Using the app
Press play to drop needles at random. A crossing estimates \(\pi\). With the needle at half the gap, \(\pi\) is about throws divided by crossings. Drag on the floor to place one needle by hand; that one is not counted.
Frequently asked questions
What is Buffon's Needle?
A needle of length l dropped on parallel lines spaced d apart. For a short needle, \(l\le d\), the chance it crosses a line is \(2l/(\pi d)\).
Why does the answer contain π?
The needle's direction is an angle from 0 to \(\pi\). All possible falls fill a rectangle that wide, and the crossings are the area under a sine curve. Dividing those areas leaves \(\pi\) in the denominator.
How does the experiment estimate π?
Count throws N and crossings \(N_{hit}\). Then
\[\pi \approx 2l\cdot \frac{N}{d\cdot N_{hit}}\,.\]
With the needle at half the gap this is throws divided by crossings.
Why is a hand-placed needle left out of the count?
The estimate needs a random position and a random angle. A needle you drag into place is drawn so you can see x and \(\theta\), and it is not added to N or \(N_{hit}\).
Has anyone really estimated π by dropping needles?
Yes. The best-known run is Mario Lazzarini's in 1901: 3,408 needles 5/6 of the gap long and 1,808 crossings, which gives \(355/113=3.1415929\). That is far too good to be luck, and he probably stopped at a convenient count. Set \(l/d\) to 0.83 and drop 1,000 throws to see a more honest result.
布豐投針: how do I record a video?
Press the red Record button in the playback bar: it films what the stage shows. Press it again to stop, and the video is saved to your device.Recording is free; you only need to sign in. Without a subscription the video carries a small PictorX logo in a corner.The button beside Record opens the video options: the shape (as shown, square, story 9:16 or wide 16:9), the length (until you stop, or 5, 10, 15 or 30 seconds for social media) and the file: MP4, WebM or an animated GIF.You can add one of three music tracks: calm, bright or beat.
Ready to try it?
Open PictorX in your browser — no install, no credit card required to start.
前往編輯器