
\begin{problems}

\problem An urn contains red and blue colored balls.  The fraction of red
balls is $r$ where $0 \leq r \leq 1$.  A gambler repeatedly pulls a ball
at random from the urn.  That is, at any point during succesive pulls,
each ball in the urn is equally likely to be the next one pulled.  The
gambler puts the ball back into the urn before making the next pull.  He
keeps pulling balls until he pulls \emph{two red balls in a row}.

The sequence of pulls by the Gambler can be regarded as a sequence of
\emph{tries}, where the first try begins with the first ball pulled.  Each
try consists of a sequence of pulled balls continuing until either a blue
ball, or two red balls in a row, are pulled.  For example, if the colors
of pulled balls are RBBBRBRR, then there are five tries which we indicate
with slashes: /RB/B/B/RB/RR/.  Note that each try consists of one or two
consecutive balls.

\bparts

\ppart What is the expected length of the $i$th try, assuming that there
are at least $i$ tries?

\solution{Given that there is an $i$th try, it is of length 1 iff it
starts with a blue ball.  It is of length 2 iff it consists of 2 red
balls.  Hence,
\[\expect{\mbox{length of $i$th try} \mid \mbox{there is an
$i$th try}} = 1\cdot (1-r) + 2 \cdot r = 1 + r.
\]}

\ppart What is the expected number of tries?

\solution{A series of tries ends iff only the last try consists
of two reds.  We know from lecture that the ``mean time to failure'' is
the reciprocal of the probability of failure, so $\expect{\mbox{num
tries}}$ is the $1/\pr{\mbox{2 reds}}= 1/r^2$.}

\ppart Write a simple expression in terms of your answers to the previous
parts of this problem for the expected number of balls pulled by the
Gambler.  Briefly justify your reasoning.

\solution{ Wald's Thm applies because $\expect{\mbox{length of $i$th try}
\mid \mbox{there is an $i$th try}}$ is the same expression from part
(a) for all $i$.  Hence,
\[
\expect{\mbox{num pulls}} = \expect{\mbox{pulls per
try}} \cdot \expect{\mbox{num tries}} = (1+r)\frac{1}{r^2}.
\]}

\eparts

