15 Jul 2015

Buffon's Needle

A simple Monte Carlo approach to estimate pi

Overview

When I was in high school, my teacher set up an experiment which included dropping a needle on to a poster board; the poster board has many parallel lines with a spacing equal to the length of the needle. The idea is to drop the needle many times (let's label this number as N) from some height and recording the number of times the needle intersects (denoted by Nint) with a line on the poster board. The probability that the needle intersects with a line on the poster board, or Nint/N, may be used to estimate π using a geometrical probability approach. This is the idea behind the famous experiment known as Buffon's needle. The process of repeating the drop many times sets up a Monte Carlo simulation as many initial parameters are unintentionally tweaked (or randomly selected), and all the experimenter cares about is the result of many attempts. The figure is an example of my simulation where red lines indicate an intersection; green lines represent no intersection. For this situation, π may be estimated as $$ \pi = \frac{2 l}{t P}, $$ where l is the needle length, t is the poster board line separation, and P is the probability that a needle intersects with a line on the board. My output for 5,000 attempts is consistently within 5% of π which is surprisingly interesting.

-->