Buffon's needle problem: Difference between revisions

Content deleted Content added
Tags: Reverted references removed
Reverted 3 edits by 82.47.233.96 (talk)
Line 11:
 
This can be used to design a [[Monte Carlo method]] for approximating the number [[pi|π]], although that was not the original motivation for de Buffon's question.<ref>{{cite web|last1=Behrends|first1=Ehrhard|title=Buffon: Hat er Stöckchen geworfen oder hat er nicht?|url=https://www.mathematik.de/ger/presse/ausdenmitteilungen/artikel/dmvm-2014-0022.pdf|accessdate=14 March 2015}}</ref>
 
== Solution ==
The problem in more mathematical terms is: Given a needle of length <math>l</math> dropped on a plane ruled with parallel lines ''t'' units apart, what is the probability that the needle will lie across a line upon landing?
 
Let ''x'' 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]] of ''x'' between 0 and ''t'' /2 is
:<math>
\begin{cases}
\frac{2}{t} &:\ 0 \le x \le \frac{t}{2}\\
0 &: \text{elsewhere.}
\end{cases}
</math>
 
Here, x = 0 represents a needle that is centered directly on a line, and x = t/2 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 π/2 is
:<math>
\begin{cases}
\frac{2}{\pi} &:\ 0 \le \theta \le \frac{\pi}{2}\\
0 &: \text{elsewhere.}
\end{cases}
</math>
 
Here, ''θ'' = 0 [[radians]] represents a needle that is parallel to the marked lines, and ''θ'' = π/2 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]], ''x'' and ''θ'', are independent, so the [[Joint probability distribution|joint probability density function]] is the product
:<math>
\begin{cases}
\frac{4}{t\pi} &:\ 0 \le x \le \frac{t}{2}, \ 0 \le \theta \le \frac{\pi}{2}\\
0 &: \text{elsewhere.}
\end{cases}
</math>
 
The needle crosses a line if
 
:<math>x \le \frac{l}{2}\sin\theta.</math>
 
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:
 
:<math>P = \int_{\theta=0}^{\frac{\pi}{2}} \int_{x=0}^{(l/2)\sin \theta} \frac{4}{t\pi}\,dx\,d\theta = \frac{2 l}{t\pi}.</math>
 
=== Case 2: Long needle ===
Suppose <math>l > t</math>. In this case, integrating the joint probability density function, we obtain:
 
:<math>\int_{\theta=0}^{\frac{\pi}{2}} \int_{x=0}^{m(\theta)} \frac{4}{t\pi}\,dx\,d\theta ,</math>
where <math>m(\theta) </math> is the minimum between
<math>(l/2)\sin\theta</math> and <math>t/2 </math>.
 
Thus, performing the above integration, we see that,
when <math>t < l</math>,
the probability that the needle will cross a line is
 
:<math>\frac{2 l}{t\pi} - \frac{2}{t\pi}\left\{\sqrt{l^2 - t^2} + t\sin^{-1}\left(\frac{t}{l}\right)\right\}+1</math>
 
or
 
:<math> \frac{2}{\pi} \cos^{-1}\frac{t}{l} + \frac{2}{\pi} \frac{l}{t} \left\{1 - \sqrt{1 - \left( \frac{t}{l} \right)^2 } \right\}. </math>
 
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 <math>\theta</math> has a value such that <math>l \sin\theta \le t</math>, that is, in the range <math>0 \le \theta \le \sin^{-1}(t/l)</math> the probability of crossing is the same as in the short needle case. However if <math>l \sin\theta > t</math>, that is, <math>\sin^{-1}(t/l) < \theta \le \frac{\pi}{2}</math> the probability is constant and is equal to 1.
 
:<math>\left(\int_{\theta=0}^{\sin^{-1}(t/l)} \int_{x=0}^{(l/2)\sin\theta} \frac{4}{t\pi}\right) + \left(\int_{\sin^{-1}(t/l)}^{\frac{\pi}{2}} \frac{2}{\pi}\right) = \frac{2 l}{t\pi} - \frac{2}{t\pi}\left\{\sqrt{l^2 - t^2} + t\sin^{-1}\left(\frac{t}{l}\right)\right\}+1</math>
 
== 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 <math>P</math> as the product of 2 probabilities: <math>P = P_1 \cdot P_2</math>, where <math>P_1</math> is the probability that the center of the needle falls close enough to a line for the needle to possibly cross it, and <math>P_2</math> 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 <math>l / 2</math> units of either side of the strip. Adding <math>\frac{l}{2}+\frac{l}{2}</math> from both sides and dividing by the whole width <math>t</math>, we obtain <math>P_1 = \frac{l}{t}.</math>
 
[[File:Buffon's needle corrected.PNG|thumb|right|The red and blue needles are both centered at x. The red one falls within the gray area, contained by an angle of 2θ on each side, so it crosses the vertical line; the blue one does not. The proportion of the circle that is gray is what we integrate as the center ''x'' goes from 0 to 1]]
 
Now, we assume that the center is within reach of the edge of the strip, and calculate <math>P_2</math>. To simplify the calculation, we can assume that <math>l = 2</math>.
 
Let ''x'' and ''θ'' be as in the illustration in this section. Placing a needle's center at ''x'', the needle will cross the vertical axis if it falls within a range of 2θ radians, out of π radians of possible orientations. This represents the gray area to the left of ''x'' in the figure. For a fixed ''x'', we can express ''θ'' as a function of ''x'': <math>\theta\left(x\right) = \cos^{-1}\left(x\right)</math>. Now we can let x move from 0 to 1, and integrate:
 
:<math>P_2 = \int_0^1 \frac{2\theta(x)}{\pi}\,dx = \frac{2}{\pi}\int_0^1 \cos^{-1}(x)\,dx = \frac{2}{\pi}\cdot 1 = \frac{2}{\pi}.</math>
 
Multiplying both results, we obtain <math>P = P_1\cdot P_2 = \frac{l}{t}\frac{2}{\pi} = \frac{2 l}{t\pi}</math>, 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 <math>l\cos\theta</math> (where <math>\theta</math> 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 <math>t</math>. The probability that the farthest end of the needle is located no more than a distance <math>l\cos\theta</math> away from the line (and thus that the needle crosses the line) out of the total distance <math>t</math> it can move in its region for <math>0 \le \theta \le \pi/2</math> is given by
 
<math>P = \frac{\int_0^{\frac{\pi}{2}} l\cos\theta d\theta}{\int_0^{\frac{\pi}{2}} t d\theta} = \frac{l}{t}\frac{\int_0^{\frac{\pi}{2}} \cos\theta d\theta}{\int_0^{\frac{\pi}{2}} d\theta} = \frac{l}{t}\frac{1}{\frac{\pi}{2}}=\frac{2l}{t\pi}</math>, as above.
 
== Without integrals ==
The short-needle problem can also be solved without any integration, in a way that explains the formula for ''p'' from the geometric fact that a circle of diameter ''t'' will cross the distance ''t'' strips always (i.e. with probability 1) in exactly two spots. This solution was given by [[Joseph-Émile Barbier]] in 1860<ref>{{Cite book|title=Proofs from THE BOOK|last1=Aigner|first1=Martin|last2=Ziegler|first2=Günter M.|edition=2nd|year=2013|pages=189–192|publisher=Springer Science & Business Media}}</ref> and is also referred to as "[[Buffon's noodle]]".
I am certi192|publisher=Springer Science & Business Media}}</ref> and is also referred to as "[[Buffon's noodle]]".
 
== Estimating π ==