In probability theory, Buffon's needle problem is a question first posed in the 18th century by Georges-Louis Leclerc, Comte de Buffon:

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?

Buffon's needle was the earliest problem in geometric probability to be solved; it can be solved using integral geometry. The solution for the sought probability , in the case where the needle length  is not greater than the width  of the strips, is

This can be used to design a Monte Carlo method for approximating the number , although that was not the original motivation for de Buffon's question.

Solution 
The problem in more mathematical terms is: Given a needle of length  dropped on a plane ruled with parallel lines  units apart, what is the probability that the needle will lie across a line upon landing?

Let  be the distance from the center of the needle to the closest parallel line, and let  be the acute angle between the needle and one of the parallel lines.

The uniform probability density function (PDF) of  between 0 and  is

Here,  represents a needle that is centered directly on a line, and  represents a needle that is perfectly centered between two lines. The uniform PDF assumes the needle is equally likely to fall anywhere in this range, but could not fall outside of it.

The uniform probability density function of  between 0 and  is

Here,  represents a needle that is parallel to the marked lines, and  radians represents a needle that is perpendicular to the marked lines. Any angle within this range is assumed an equally likely outcome.

The two random variables,  and , are independent, so the joint probability density function is the product

The needle crosses a line if

Now there are two cases.

Case 1: Short needle () 
Integrating the joint probability density function gives the probability that the needle will cross a line:

Case 2: Long needle () 
Suppose . In this case, integrating the joint probability density function, we obtain:

where  is the minimum between  and .

Thus, performing the above integration, we see that, when , the probability that the needle will cross at least one line is

or

In the second expression, the first term represents the probability of the angle of the needle being such that it will always cross at least one line. The right term represents the probability that the needle falls at an angle where its position matters, and it crosses the line.

Alternatively, notice that whenever  has a value such that , that is, in the range , the probability of crossing is the same as in the short needle case. However if , that is,  the probability is constant and is equal to 1.

Using elementary calculus 
The following solution for the "short needle" case, while equivalent to the one above, has a more visual flavor, and avoids iterated integrals.

We can calculate the probability  as the product of two probabilities: , where  is the probability that the center of the needle falls close enough to a line for the needle to possibly cross it, and  is the probability that the needle actually crosses the line, given that the center is within reach.

Looking at the illustration in the above section, it is apparent that the needle can cross a line if the center of the needle is within  units of either side of the strip. Adding  from both sides and dividing by the whole width , we obtain .

Now, we assume that the center is within reach of the edge of the strip, and calculate . To simplify the calculation, we can assume that .

Let  and  be as in the illustration in this section. Placing a needle's center at , the needle will cross the vertical axis if it falls within a range of  radians, out of  radians of possible orientations. This represents the gray area to the left of  in the figure. For a fixed , we can express  as a function of : . Now we can let  range from 0 to 1, and integrate:

Multiplying both results, we obtain  as above.

There is an even more elegant and simple method of calculating the "short needle case". The end of the needle farthest away from any one of the two lines bordering its region must be located within a horizontal (perpendicular to the bordering lines) distance of  (where  is the angle between the needle and the horizontal) from this line in order for the needle to cross it. The farthest this end of the needle can move away from this line horizontally in its region is . The probability that the farthest end of the needle is located no more than a distance  away from the line (and thus that the needle crosses the line) out of the total distance  it can move in its region for  is given by

Without integrals 
The short-needle problem can also be solved without any integration, in a way that explains the formula for  from the geometric fact that a circle of diameter  will cross the distance  strips always (i.e. with probability 1) in exactly two spots. This solution was given by Joseph-Émile Barbier in 1860 and is also referred to as "Buffon's noodle".

Estimating  

In the first, simpler case above, the formula obtained for the probability  can be rearranged to

Thus, if we conduct an experiment to estimate , we will also have an estimate for .

Suppose we drop  needles and find that  of those needles are crossing lines, so  is approximated by the fraction . This leads to the formula:

In 1901, Italian mathematician Mario Lazzarini performed Buffon's needle experiment. Tossing a needle 3,408 times, he obtained the well-known approximation  for , accurate to six decimal places.
Lazzarini's "experiment" is an example of confirmation bias, as it was set up to replicate the already well-known approximation of  (in fact, there is no better rational approximation with fewer than five digits in the numerator and denominator, see also Milü), yielding a more accurate "prediction" of  than would be expected from the number of trials, as follows:

Lazzarini chose needles whose length was  of the width of the strips of wood.  In this case, the probability that the needles will cross the lines is .  Thus if one were to drop  needles and get  crossings, one would estimate  as

So if Lazzarini was aiming for the result , he needed  and  such that

or equivalently,

To do this, one should pick  as a multiple of 213, because then  is an integer; one then drops  needles, and hopes for exactly  successes. If one drops 213 needles and happens to get 113 successes, then one can triumphantly report an estimate of  accurate to six decimal places.  If not,  one can just do  213 more trials and hope  for  a total of 226 successes; if not, just repeat as necessary. Lazzarini performed  trials, making it seem likely that this is the strategy he used to obtain his "estimate".

The above description of strategy might even be considered charitable to Lazzarini. A statistical analysis of intermediate results he reported for fewer tosses leads to a very low probability of achieving such close agreement to the expected value all through the experiment. This makes it very possible that the "experiment" itself was never physically performed, but based on numbers concocted from imagination to match statistical expectations, but too well, as it turns out.

Dutch science journalist Hans van Maanen argues, however, that Lazzarini's article was never meant to be taken too seriously as it would have been pretty obvious for the readers of the magazine (aimed at school teachers) that the apparatus that Lazzarini said to have built cannot possibly work as described.

Laplace's extension (short needle case)
Now consider the case where the plane contains two sets of parallel lines orthogonal to one another, creating a standard perpendicular grid. We aim to find the probability that the needle intersects at least one line on the grid. Let  and  be the sides of the rectangle that contains the midpoint of the needle whose length is . Since this is the short needle case, , . Let  mark the coordinates of the needle's midpoint and let  mark the angle formed by the needle and the -axis. Similar to the examples described above, we consider , ,  to be independent uniform random variables over the ranges , , .

To solve such a problem, we first compute the probability that the needle crosses no lines, and then we take its compliment. We compute this first probability by determining the volume of the domain where the needle crosses no lines and then divide that by the volume of all possibilities, . We can easily see that .

Now let  be the volume of possibilities where the needle does not intersect any line. Developed by J.V. Uspensky,

where  is the region where the needle does not intersect any line given an angle . To determine , let's first look at the case for the horizontal edges of the bounding rectangle. The total side length is  and the midpoint must not be within  of either endpoint of the edge. Thus, the total allowable length for no intersection is  or simply just . Equivalently, for the vertical edges with length , we have . The ± accounts for the cases where  is positive or negative. Taking the positive case and then adding the absolute value signs in the final answer for generality, we get

Now we can compute the following integral: 

Thus, the probability that the needle does not intersect any line is

 

And finally, if we want to calculate the probability, , that the needle does intersect at least one line, we need to subtract the above result from 1 to compute its compliment, yielding

.

Comparing estimators of  

As mentioned above, Buffon's needle experiment can be used to estimate . This fact holds for Laplace's extension too since  shows up in that answer as well. The following question then naturally arises and is discussed by E.F. Schuster in 1974.
Is Buffon's experiment or Laplace's a better estimator of the value of ? Since in Laplace's extension there are two sets of parallel lines, we compare  drops when there is a grid (Laplace), and  drops in Buffon's original experiment.

Let  be the event that the needle intersects a horizontal line (parallel to the -axis)

and let  be the event that the needle intersects a vertical line (parallel to the -axis)

For simplicity in the algebraic formulation ahead, let  such that the original result in Buffon's problem is . Furthermore, let  drops.

Now let us examine  for Laplace's result, that is, the probability the needle intersects both a horizontal and a vertical line. We know that

From the above section, , or the probability that the needle intersects no lines is

We can solve for  and  using the following method:

Solving for  and  and plugging that into the original definition for  a few lines above, we get

Although not necessary to the problem, it is now possible to see that . With the values above, we are now able to determine which of these estimators is a better estimator for . For the Laplace variant, let  be the estimator for the probability that there is a line intersection such that
.

We are interested in the variance of such an estimator to understand the usefulness or efficiency of it. To compute the variance of , we first compute  where 

Solving for each part individually,

We know from the previous section that

yielding

Thus,

Returning to the original problem of this section, the variance of estimator  is 

Now let us calculate the number of drops, , needed to achieve the same variance as 100 drops over perpendicular lines. If  then we can conclude that the setup with only parallel lines is more efficient than the case with perpendicular lines. Conversely if  is equal to or more than 200, than Buffon's experiment is equally or less efficient, respectively. Let  be the estimator for Buffon's original experiment. Then, 

and

Solving for , 

Thus, it takes 222 drops with only parallel lines to have the same certainty as 100 drops in Laplace's case. This isn't actually surprising because of the observation that . Because  and  are negatively correlated random variables, they act to reduce the total variance in the estimator that is an average of the two of them. This method of variance reduction is known as the antithetic variates method.

See also 
Bertrand paradox (probability)

References

Bibliography 
 
 
 
 
 Schroeder, L. (1974). "Buffon's needle problem: An exciting application of many mathematical concepts". Mathematics Teacher, 67 (2), 183–6.
 Uspensky, James Victor. "Introduction to mathematical probability." (1937).

External links 

 Buffon's Needle Problem at cut-the-knot
 Math Surprises: Buffon's Noodle at cut-the-knot
 MSTE: Buffon's Needle
 Buffon's Needle Java Applet
 Estimating PI Visualization (Flash)
 Buffon's needle: fun and fundamentals (presentation) at slideshare
 Animations for the Simulation of Buffon's Needle by Yihui Xie using the R package animation
 3D Physical Animation by Jeffrey Ventrella
 

Applied probability
Integral geometry
Probability problems