Solution
St. Petersburg with a Finite Bank
Show the problem again
A fair coin is flipped until it first lands heads. If the first heads occurs on flip k, the casino owes you 2^k dollars. However, the casino has only 2^20 = 1,048,576 dollars, so whenever it owes more than that, it pays you 2^20 dollars instead. What is the expected payout, in dollars? Give an exact number.
Worked solution
The answer is 21 dollars. The first heads occurs on flip k with probability 2^(−k). For k = 1, ..., 20 the casino pays the full 2^k, so each of these twenty values contributes exactly 2^k × 2^(−k) = 1 to the expectation, for a total of 20. For k ≥ 21 the payout is capped at 2^20, and these cases have total probability 2^(−20), contributing 2^20 × 2^(−20) = 1. So the expected payout is 20 + 1 = 21 dollars. The famous infinite expectation grows only like the base-2 logarithm of the bank: a casino a million times richer would add only about 20 more dollars to the value of the game.
Source: Variant of the St. Petersburg paradox (Nicolaus and Daniel Bernoulli, 18th century). Statement written for AxiomIQ.