Tim Black's Blog
Back to Tim's homepage

Three reasons Riddler casino game has a beautiful value

Posted March 27, 2016

FiveThirtyEight's Riddler has presented a puzzle about an invented casino game. Here's the puzzle:

Suppose a casino invents a new game that you must pay $250 to play. The game works like this: The casino draws random numbers between 0 and 1, from a uniform distribution. It adds them together until their sum is greater than 1, at which time it stops drawing new numbers. You get a payout of $100 each time a new number is drawn. For example, suppose the casino draws 0.4 and then 0.7. Since the sum is greater than 1, it will stop after these two draws, and you receive $200. If instead it draws 0.2, 0.3, 0.3, and then 0.6, it will stop after the fourth draw and you will receive $400. Given the $250 entrance fee, should you play the game? Specifically, what is the expected value of your winnings?

They specifically ask for solutions that are elegant, pencil-and-paper solutions rather than computer approximations.

This puzzle is especially well-suited to elegant solutions because the value of the game is \(100e\) dollars, which is approximately $271.83. So, if you're not particularly risk averse, you should take the offer to play for $250. I'd like to submit three solutions that reflect three different definitions of / common uses of \(e\).

Solution 1: Infinite sum

Let's say the casino starts drawing numbers, writing down the sum, but only the part after the decimal place. So, if the casino drew the numbers 0.4, 0.2, 0.1, 0.5, it would calculate $$ \begin{align*} &0.4 &=& 0.4 \\ &0.4 + 0.2 &=& 0.6 \\ &0.4 + 0.2 + 0.1 &=& 0.7 \\ &0.4 + 0.2 + 0.1 + 0.5 &=& 1.2, \end{align*} $$ but it would only write down $$\_.4 \quad \_.6 \quad \_.7 \quad \_.2.$$ Two important observations:
  1. Given any item in the list, you can't predict the next; it's equally likely to be anything between _.00 and _.99.
  2. From this list, you can tell when the sum passed 1: it's the first place where the decimal-part decreases (from .7 to .2) instead of increases.
Observation 1 means that the casino's list of decimal-parts-of-sums is a list of random numbers chosen between 0 and 1 uniformly. Observation 2 means that the amount of money you get $100 for each nonnegative integer \(n\) such that the first \(n\) numbers are in increasing order. The probability that a list of $n$ numbers chosen from the same distribution is in increasing order is \(\frac{1}{n!}\). So, the total expected value of your earnings is $100 times $$\frac{1}{0!} + \frac{1}{1!} + \frac{1}{2!} + \frac{1}{3!} + \cdots.$$ This is a famous infinite sum, which converges to \(e\).

Solution 2: \(e^x\) is its own derivative

Let \(f(x)\) be the amount of money that you expect to make if the game stops once the sum passes \(x\) instead of once the sum passes \(1\). We want to find \(f(1)\). For \(x < 0\), the game is over before it starts, so \(f(x) = 0\). For \(x = 0\), the casino picks one number and you gain $100, but then the game ends, so \(f(0) = 100\). For \(x \geq 0\), when the casino picks a number, you gain $100, and then you find yourself playing the same game as before, but with the threshold reduced by a random amount between 0 and 1. This means that $$f(x) = 100 + \int_{x-1}^x \! f(t) \, \text{d}t.$$ Specifically for \(0 \leq x \leq 1\), this is equivalent to $$f(x) = 100 + \int_0^x \! f(t) \, \text{d}t.$$ Differentiating both sides (and using the Fundamental Theorem of Calculus), $$f'(x) = f(x).$$ Since \(f(x)\) is its own derivative, it must be a multiple of \(e^x\). In particular, since \(f(0) = 100\), we get \(f(x) = 100 e^x \). So your expected earnings are \(f(1) = 100e \).

Solution 3: Compound interest

Consider a magical enchanted $100 dollar bill with an amazing property: at a random point in the first year after its creation, it will produce a new magical $100 bill (which will itself reproduce at a random point in the first year of its own existence). If you start with one of these magical bills, newly-minted, how much money do you expect to have a year later?

This question is bizarre, but is in essence just a rephrasing of the original puzzle! The first number drawn by the casino is what fraction of a year it takes for the first bill to reproduce. The second number drawn is the fraction of a year it takes for the second bill to reproduce.

This setup wouldn't be weird or magical at all if instead of the bill reproducing all at once at a random time, it slowly and steadily reproduced over the course of the year. In fact, it's probably happening to money you have in the bank right now - it's earning interest. As far as expected value is concerned, it doesn't matter whether the new money is added at a random time or continuously throughout (if you started with a large number of magical bills, then the Law of Large Numbers says that you expect you money to grow fairly continuously).

If you start with $100 and you're paid 100% interest compounded continuously, then a year later you have \(100e\) dollars.

last updated 3.27.2016