I came across an interesting dice roll game that involved expected values and wanted to know if my approach and answer were correct, and if there are other ways to solve this.

Problem statement:

You're playing a game, as follows. On the table is a pile of money, currently containing a single dollar. On every turn, you have two options. The first option is to simply take the money on the table, ending the game. The second option is to roll a die. If you roll a 6, all the money on the table disappears and the game ends. Otherwise, a dollar gets added to the pile on the table and the game continues.

What's the optimal strategy for this game?

Let $f(x)$ represent the expected payoff from this game after $x$ rolls of the dice. Using this, I can calculate a few values:

If we choose not to roll the dice at all, the payoff is just $\$1$. Thus, $f(0) = 1$.

If we choose to roll the dice once, there is a $\frac{5}{6}$ chance our payoff is $\$2$ and a $\frac{1}{6}$ chance our payoff is $\$0$ if we roll a 6. As a result, $f(1) = \frac{10}{6}$.

If we choose to roll the dice twice, there is a $\frac{25}{36}$ chance that we get two non-sixes in which case our payoff is $\$3$, and it is $\$0$ for all other cases. Therefore, $f(2) = \frac{75}{36}$.

Based on this pattern, I can come up with a general expression:

$$f(x) = \left(\frac{5}{6}\right)^x (x+1)$$

To determine the optimal strategy, I should seek to find the number of dice rolls $x$ that maximizes $f(x)$. The obvious way to do so is to take the derivative with respect to $x$ and set it equal to $0$:

$$f'(x) = \left(\frac{5}{6}\right)^x \ln\left(\frac{5}{6}\right)(x+1) + \left(\frac{5}{6}\right)^x = 0.$$ $$\ln\left(\frac{5}{6}\right)(x+1) = -1$$ $$x = \frac{-1}{\ln\left(\frac{5}{6}\right)} - 1 \approx 4.4848.$$

The closest integers are $4$ and $5$ and on further inspection, $f(4) = f(5)$. Thus, the optimal strategy is to roll the dice either $4$ or $5$ times.

Is this a correct/valid way to approach this problem? Is there another way? Thank you.

  • $\begingroup$ Looks good to me $\endgroup$
    – QC_QAOA
    Commented Feb 11, 2022 at 0:47

1 Answer 1


Alternative approach:

Find $k$ such that you stop after $k$ dollars are on the table.

Your possible profit in rolling one more time, and then stopping is $~\displaystyle \frac{5}{6}.$

Your potential loss is $\frac{1}{6} \times k$. Therefore $k = 5$.

As your analysis indicated, if you roll one more time, when there are exactly $5$ dollars on the table, then your last roll is a break even situation.

  • $\begingroup$ That is an elegant way to solve this, did not think of this. Thank you $\endgroup$
    – Dhruv Kapu
    Commented Feb 11, 2022 at 2:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .