Parametric equations
A needle of length falls at random onto parallel lines spaced apart, with . The probability that the needle crosses a line is . After many throws, the rate of crossings estimates .
is the number of throws and is the number of crossings. This is the short-needle case only.
Interaction
- Needle length ℓ and Line spacing d: their ratio sets the probability above, and how fast the estimate settles. The experiment keeps
- Throws per frame: each frame drops that many needles, marks each crossing, and adds to the count. The curve plots the number of throws against the running estimate of
- Reset: clear the needles and the estimate
- The lines stay equally spaced, and a needle that crosses one is highlighted
What to notice
- A crossing is a needle that meets one of the parallel lines. A miss is drawn dimmer.
- While , the probability of a crossing is . The estimate is .
- More throws pull the curve toward . Changing changes that probability, and how quickly the estimate settles.
Comments
Comment with a GitHub account.