        \problemdata       % Takes 5 *mandatory* arguments
        {pi-mesons}             % latex-friendly label for the prob.
        {expectation}  % The topic(s) of the problem content.
        {}               % Source (if known)
        {S02 cp11f-5, F97 ps10} % Usage (list ones you are aware of).
        {Ashish, S02}        % Last revision info (author, date).



\begin{problem} 
In a physics experiment, every second a $\pi$-meson passes through a
detector with probability $p$.  $\pi$-meson arrivals are mutually
independent from second to second.

\begin{problemparts}
\problempart
What is the probability of getting exactly $k$ $\pi$-mesons passing through
the detector in one minute?

\solution{At each second the appearance of a $\pi$-meson is the outcome of a
Bernoulli trial with probability of success $p$.  Therefore the number
of $\pi$-mesons observed in $60$ seconds is Binomially distributed.

$$
\Pr(k) = {60 \choose k} p^k (1-p)^{60-k}
$$
}

\problempart Suppose the detector is on for one minute.
For what values of $k$ is the probability of getting exactly $k$
$\pi$-mesons greater than the probability of getting exactly $k-1$
$\pi$-mesons?  For what values of $k$ is it less?  What value of $k$
is the most likely number of $\pi$-mesons?

\solution{Consider the ratio of the probability of $k$ $\pi$-mesons  over the
probability of $k-1$ $\pi$-mesons.

\begin{eqnarray*}
\frac{{60 \choose k}p^k(1-p)^{60-k}}{{60 \choose {k-1}}p^{k-1}(1-p)^{60-k+1}}
& = &\frac{\frac{60!}{k!(60-k)!}p}{\frac{60!}{(k-1)!(60-k+1)!}(1-p)} \\
& = & \frac{(60-k+1)p}{k(1-p)}
\end{eqnarray*}

This quantity is greater or equal to $1$ if and only if $(60-k+1)p \geq k(1-p)
\Longleftrightarrow 61p \geq k$. 
So, for $k \leq 61p$ the probability increases from $k-1$ to $k$, and
for $k \geq 61p$, the probability decreases.  The value of $k$ that
maximizes the probability is thus $\lfloor 61p \rfloor$. 
%(Note: at the maximum value, the probability might change).

}

\problempart
Suppose that we keep observing until $m$ $\pi$-mesons are observed. Find the
probability distribution for the time $T$ to see $m$
$\pi$-mesons. What is the expected value of $T$?

\solution{
Consider the event $\{T = l\}$.  This means that there was one $\pi$-meson
observed in the $l$th second, and there were $m-1$ $\pi$-meson
arrivals on the previous $l-1$ seconds.

Since the arrivals at each second are independent, we have:

\begin{eqnarray*}
\Pr(T = l) & = & \Pr(\text{$m-1$ arrivals in $l-1$ seconds})P(\text{1 arrival 
on the $l$th second})\\
& = & {l-1 \choose m-1} p^{m-1}(1-p)^{l-m} p\\
& = & {l-1 \choose m-1} p^{m}(1-p)^{l-m}\\
\end{eqnarray*}

Let $X$ be the time to observe one $\pi$-meson.  Since future arrivals are 
independent of past arrivals, the time to see two $\pi$-mesons is $X+X = 2X$,
and more generally the time to see $m$ $\pi$-mesons is $mX$.
Therefore $E[T] = mE[X] = {m \over p}$.
}
\end{problemparts}
\end{problem}
