Buffon's Needle

Luis R. Suazo
2015

History


Buffon's needle refers to a problem in geometric probability first posed by Georges-Louis Lecler, Comte de Buffon in the in the 1733:

“Suppose we have a floor made of parallel strips of wood, each the same width, and we drop a needle onto the floor. What is the probability that the needle will lie across a line between two strips?”

The solution, presented in 1777 (the year Gauss was born!) by Buffon himself, was the first of its kind.

P(crossing)

If the spacing between lines (of strips of wood on floor, or lines on a ruled paper, etc.) is \( d \), and the length of the needle is \( l \), then assuming \( \,l < d \) the probability of crossing turns out to be

\[ P(Crossing) = \frac{2l}{d\pi} \]

In the associated shiny application, located at:

https://luisris.shinyapps.io/ShinyProject

I use \( \,d = 2l \) so \( \,P(Crossing) = 1/\pi \).

In R

The \( x \) and \( y \) positions of the dropped needles are assumed to have a uniform distribution within the floor (or notebook). Similarly the angle is uniformly distributed between \( 0 \) and \( \pi \).

num <- 10000; angle <- runif(num,0,pi)
x.center <- runif(num,0,10)
y.center <- runif(num,0,10)

Using simple trigonometric calculations we can get the ratio of needles dropped to needles crossing lines.

num/sum(crossing)
[1] 3.133814

Plot of Estimates

Plot of estimate of \( \pi \) for each number of needles dropped, compared to actual value of \( \pi \) in red. plot of chunk unnamed-chunk-5