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



%% old problem, Expectations, infinite expectations
\begin{problem}
The St.\ Petersburg Casino offers the following game: the gambler bets a
fixed wager, and then the dealer flips a fair coin (dealers do not flip
coins in US casinos, but they do in St.\ Petersburg) until it comes up
heads. The gambler receives \$1 if the coin shows heads the first time,
\$2 if it shows the first head at second toss, and in general $\$2^{k-1}$
if the dealer tosses the coin $k$ times to get the first head.

\begin{problemparts}
\problempart Suppose the fixed wager is \$10.  What is the expected amount of
money that the gambler will win in this game?  Suppose the fixed wager
is \$10,000?

\solution{
Let $V$ be the random variable corresponding to the amount of money
that the gambler is paid by the dealer. The distribution of
$V$ is as follows: for any $n\geq 1$,
\[
\prob{V= 2^{n-1}} = 2^{-n},
\]
where the probability refers to the event that the dealer
tosses $n-1$ tails followed by a head.
The average of $V$ is
\[
\expect{V} = \sum_{n=1}^{\infty} [2^{-n} 2^{n-1}]
= \sum_{n=1}^{\infty} 1/2 = \infty.
\]
So whatever the fixed wager, the gambler expects to win an infinite
amount.}

\problempart What is the probability that the gambler does not lose money in a
game when the fixed wager is \$10,000?

\solution{
The probability of recovering the
money of the wager is only
\begin {eqnarray*}
\prob{V \geq 10,000} & = & \prob{V \geq 2^{14}}\\
& = & \prob{\mbox{dealer flips at least 14 consecutive tails}}\\
& = & 2^{-14} = \frac{1}{16,384}
\end {eqnarray*}
}

\problempart In reality, it would not be reasonable for the gambler to play the
game with the fixed wager at \$10,000.  Why? (\hint Suppose the casino
goes bankrupt.)

\solution{

Above, we concluded that a \$$10,000$ wager still ``makes sense''
because the expected amount of money (payoff) that the gambler will get
from the casino is infinite. However, in reality, the casino can only
pay back a certain amount of money before it goes bankrupt. This
restriction has a dramatic impact on the expected value of the payoff. Consider,
for example, the following, more realistic setting: 
\begin{quote}
The gambler still receives \$$2^{k-1}$ if he flips $k-1$ tails before
flipping a head, but this only holds for profits up to \$$2^{30}$ (i.e. about a
billion dollars). If the gambler flips 31 tails or more before he gets a
head, he still only gets \$$2^{30}$.
\end{quote}

Notice that the probability of flipping 31 or more tails in a row is $2^{-31}$.

Under this scenario, the expected amount of money that the gambler will
receive from the casino is 
\begin{eqnarray*}
\expect{V} &=& \sum_{n=1}^{31} \frac{1}{2} + 2^{-31}\cdot 2^{30} \\
&=& 31\cdot\frac12 + \frac12 \\
&=& 16
\end{eqnarray*}

So, in our ``realistic'' scenario, the expected payoff is just \$$16$,
which is considerably less than infinity. The \$$10$ wager makes sense,
but not the \$$10,000$ one.

You should note that the infinite expectation we got in part (a) was due
to the (infinite) contribution of ridiculously high payoffs which, even
though they happen with inversely ridiculously low probability, still
contribute $\frac12$ \emph{each} to the sum. Since there is an infinite number
of (different) ridiculously high payoffs, we have an infinte number of
$\frac12$ terms in the sequence, which makes the sum infinite. 

\paragraph{Optional exercise:} Above, by setting the maximum payoff at
\$$2^{30}$, we brought the expected payoff down to just \$$16$. What
should the maximum payoff be for the expected payoff to be greater than
\$$10,000$, so that the \$$10,000$ wager makes sense?

\paragraph{Answer:} Around \$$2^{20,000}$. For comparison, note that there are
$2^{300}$ particles in the universe.
}
\end{problemparts}
\end{problem}
