# Buffon's Needle problem

So I'm working through some computational stats stuff from a free pdf of a book. Specifically I'm looking at their take on the classic Buffon's needle problem. The question has a theoretical part and a computational part. My theoretical background isn't very strong, so I did some research to get those questions answered for me, so I can better understand the computational problem. And the theory seems fairly straight forward on explanation.

My issue is the precursor question to the actual computation problem. The question is this: Let T be the number of crossings in n tosses of the needle, then E=Td/(nl)is an unbiased estimator of 2/π. Calculate the variance of E and thus suggest the best needle length l to use, subject to the restriction l ≤ d.

How would I calculate this? And the best l is simply going to be the one that minimizes the variance of the estimate, right? I understand the definition of variance, but I have no idea how to apply them here.

For simplicity I will call your estimator $$\theta$$
\begin{align} \operatorname{var}(\theta) &= \operatorname{var}{[\frac{Td}{nl}}]\\ &= \frac{d^2}{n^2 l^2} \operatorname{var}[T]\\ \end{align}
The event of a needle crossing can just be considered a single trial in a bernoulli experiment with $$P = \frac{2l}{d \pi}$$. Therefore $$T$$ is binomially distributed with $$n=n$$, $$p = P$$.
The variance, $$\operatorname{var}[T]$$, then just follows: $$np*(1-p)$$.
Differentiate with respect $$l$$ then solve.