Numberphile has a video about the Buffon's needle experiment (Video). I am writing an essay on determining $\pi$ using probability and I need to show my understanding of the topic. I kind of already understand how we get $\pi$ from the randomness however I need some clarification on how the following was evaluated:
$$\int_{\theta=0}^{{\pi\over2}}\int_{x=0}^{{l\over2}sin\theta}P_x P_{\theta} dx d\theta$$
$P_x$ being ${1\over l}$ where $l$ is the length of the match (this should be irrelevant since it will cross out)
$P_{\theta}$ being ${2 \over \pi}$
The result should be ${1\over\pi}$
I would recommend watching the video, start at 3 min if you only want the math behind it.
I need someone to explain a step by step of how we got to the result, specifically how double integration works in this case. I do understand some calculus so no need to go to extreme details.
If indeed $P_\theta = \pi/2$ here is what I get. $$ \begin{split} \int_0^{\pi/2} \int_0^{\frac{L}{2} \sin \theta} \frac{1}{L} \frac{\pi}{2} dx d\theta &= \frac{\pi}{2L} \int_0^{\pi/2} \left[ \int_0^{\frac{L}{2} \sin \theta} dx \right] d\theta \\ &= \frac{\pi}{2L} \int_0^{\pi/2} \frac{L}{2} \sin \theta d\theta \\ &= \frac{\pi}{4} \int_0^{\pi/2} \sin \theta d\theta \\ &= \frac{\pi}{4} \left[ -\cos \theta \right]_0^{\pi/2} \\ &= \pi/4. \end{split} $$ But if $P_\theta = 2/\pi$ (which I think is right), the same technique produces $$ \begin{split} \int_0^{\pi/2} \int_0^{\frac{L}{2} \sin \theta} \frac{1}{L} \frac{2}{\pi} dx d\theta &= \frac{2}{L\pi} \int_0^{\pi/2} \left[ \int_0^{\frac{L}{2} \sin \theta} dx \right] d\theta \\ &= \frac{2}{L\pi} \int_0^{\pi/2} \frac{L}{2} \sin \theta d\theta \\ &= \frac{1}{\pi} \int_0^{\pi/2} \sin \theta d\theta \\ &= \frac{1}{\pi} \left[ -\cos \theta \right]_0^{\pi/2} \\ &= 1/\pi. \end{split} $$