Online Help

All Products Maple MapleSim

Buffon's Needle Problem refers to a question first posed by Georges-Louis Leclerc, Comte de Buffon: "Suppose we have a floor made of parallel strips of wood, each of the same width. If we drop a needle on the floor, what is the probability that the needle will land on a line between two strips?"

The case in which the length of the needle is less than or equal to the width of each strip of wood can be used to design a Monte-Carlo style approximation of &pi;.

Probability Density Functions

Let l be the length of the needle, d be the distance between the parallel lines, x be the distance from the center of the needle to the closest line, and &theta; be the acute angle between the needle and a line.

The uniform probability density function of x between 0 and d2 is 2d0&leq;x&leq;d20elsewhere.

The uniform probability density function of &theta; between 0 and &pi;2 is 2&pi;0&leq;&theta;&leq;&pi;20elsewhere.

So, the joint probability density function of the independent random variables x and &theta; is the product of their individual probability density functions: 4d&pi;0&leq;x&leq;d2&comma;0&leq;&theta;&leq;&pi;20elsewhere.

The needle will cross a line only if x&leq;l2sin&theta;.

A Solution to the "Short Needle" Case using Integral Geometry

This solution can be found simply by using an iterated integral. Assuming that l&leq;d, integrating the joint probability density function gives the probability that the needle will cross a line:

We can also calculate the probability, P, of the needle crossing a line as the product of P1 and P2, where P1 is the probability that the center of the needle falls close enough to a line to possibly cross it and P2 is the probability that the needle actually crosses the line, given that its center is within reach.

Let l represent the length of the needle and d represent the width of each piece of wood (that is, the distance between two lines).

The needle can possibly cross a line if its center is within l2units of either side of the line. So, adding l2&plus;l2 to account for the needle falling on either side of the line, then dividing by the total distance between this line and the next, d, we get

P1&equals;l2&plus;l2d&equals;ld.

Now, we assume the center is within reach of crossing a line, meaning it lies l2units or less from a line.

Recall that the needle will cross a line for a given x whenx&leq;l2sin&theta;, or arcsin2xl&leq;&theta;. The probability of this happening is thus &pi;2−arcsin2xl&pi;2−0, since we assume &theta; ranges uniformly between 0 and &pi;2, independently of x. Taking the average overall possible values of x between 0 and l2, we find that:

P2&equals;1l2∫0l2π2−arcsin2xlπ2−0&DifferentialD;x

P2&equals;2&pi;

Putting this all together, we obtain P&equals;P1P2&equals;ld2&pi;&equals;2ld&pi;.

Approximation of π

The formula from the solution to the "short needle" case above can be rearranged to &pi;&equals;2ldP. So, if we conduct an experiment to estimate P, we can also find an approximation for &pi;.

Let's say our experiment involves dropping N needles on the floor and we observe that n of them cross a line, so the observed probability of a needle crossing a line is P&approx;nN.

Thus, our approximation of π is: &pi;&approx;2lNdn.

A Solution to the "Long Needle" Case Using Integral Geometry

This solution can also be found simply by using an iterated integral. Assuming that l&gt;d, integrating the joint probability density function gives us the probability that the needle will cross a line:

P&equals;&Integral;0&pi;2&Integral;0m&theta;4d&pi;&DifferentialD;x&DifferentialD;&theta;, where m&theta; is the minimum of l2sin&theta;&comma;d2. Splitting into the cases d&gt;lsin&theta; and d<lsinθ, we get:

Thus, when l&gt;d, a Monte-Carlo style approximation of π is available via:

π&approx;2Nnl−l2−d2d&plus;arccosdl.

Adjust the number of needles being dropped, the length of each needle, and the distance between lines to compare the expected probability of a needle crossing a line with the observed probability of the experiment. If the length of each needle is less than or equal to the distance between the parallel lines, observe the approximation of π constructed using the results of the experiment.

Maplesoft™, a subsidiary of Cybernet Systems Co. Ltd. in Japan, is the leading provider of high-performance software tools for engineering, science, and mathematics. Its product suite reflects the philosophy that given great tools, people can do great things.