\problemdata                                                             
        {probability-k-events-1} % latex-friendly label for the prob.
        {K-events; coin flipping} % The topic(s) of the problem content.  
        {?} % Source (if known)                                          
        {S02 PS9; S00 PS8} % Usage (list ones you are aware of). 
        {Tina Wang, S02} % Last revision info (author, date).   
                                                                         
                                                                         
\begin{problem}
A biased coin has probability $p$ of heads and probability $1-p$ of tails.
Suppose we flip this coin $n$ times.

\begin{problemparts}

\problempart For what values of $k$ is the probability of getting exactly
$k$ heads greater than the probability of getting exactly $k-1$ heads?
For what values of $k$ is it less?  What value of $k$ is the most likely
number of heads?

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

\begin{align*}
\frac{ \tbinom{n}{k} p^k (1-p)^{n-k}}{\tbinom{n}{k-1} p^{k-1}(1-p)^{n-k+1}}
&= \frac{\cfrac{n!}{k!(n-k)!} p}{\cfrac{n!}{(k-1)!(n-k+1)!} (1-p) } \\
&= \frac{ (n-k+1) p}{k (1-p)}
\end{align*}

This quantity is greater than 1 if and only if $(n-k+1)p>k(1-p)$.
Simplifying, we have $np+p>k$.  So, for $k<np+p$ the probability increases
as $k$ increases, and for $k>np+p$, the probability decreases as $k$
increases.  The value of $k$ the maximizes the probability is thus
$\lfloor np+p \rfloor$.}

\problempart
Show that if $p=1/n$ then the probability of getting no heads
$\longrightarrow 1/e$ as $n \longrightarrow \infty$.

\solution{
The probability of no heads is $(1-p)^n= (1-1/n)^n$.  For
large $n$, this expression approaches $1/e$.  

The probability of exactly one head is $\binom{n}{1}p(1-p)^{n-1} =
(1-1/n)^{n-1}$.  Forming the ratio, we find the probability of
no heads over the probability of exactly one head is $1-1/n$,
which is the probability of a tail. 
}
\end{problemparts}
\end{problem}

                                 