# Roll a dice infinite times BUT pay $1 to play - strategy? I am stuck with a question related to the optimal strategy of rolling a dice. Its an extension of the problem "Roll a dice and take either the amount on the dice or re-roll (a maximum of twice)". Heres the link to the basic version and solution: The expected payoff of a dice game So the idea is you roll a 6 sided dice, and you can EITHER take the money shown on the dice, OR pay \$$1 and play again. You can now re-roll as many times as you like. What is the optimal strategy and whats the fair value of the game? I tried to use the same approach by working backwards as the basic case above, but after a few iterations, it seems to be never ending. This doesn't make sense intuitively, because after 6 rolls, you have spent \$$6$ to play and can only win a maximum of \$$6 on your next roll, so it would never be optimal to roll more than 6 times! • You also need to add an actual question to this post. – msm Commented Dec 31, 2016 at 10:44 • Your claim that it's never optimal to roll more than 6 times is false. If you roll a 1, it's always correct to pay \1 and roll again, regardless of how many consecutive 1's have occurred. Commented Dec 31, 2016 at 10:45 • @quasi Sunk cost principle? :p Commented Dec 31, 2016 at 10:56 • Also question, do you pay 1\$$ before starting the game too? Commented Dec 31, 2016 at 11:07
• @gowarth: In my answer. I assumed the payment is only for a re-roll. Commented Dec 31, 2016 at 11:33

This answer is longer than it needs to be because I wanted to make a general argument. This will work for any sided die. I could have generalized it slightly more in terms of how much you have to pay to roll again but I got lazy. Feel free to ask clarifying questions!

At every point in the game, your strategy should be irrespective of your previous rolls. To see why this is, think about it like this. Whatever you rolled previously has no effect on you right now. That is, no matter how much you have lost or won, if this current roll you are about to do is profitable, you should do it whether you have already won a million dollars or lost a trillion, because at this current moment in time, it is absolutely profitable. Your past earnings play no roll in the decision.

Our strategy will be to choose a cutoff number above which we will accept the winnings and stop. For this cutoff, we will develop a way to calculate the expected winnings and maximize them.

Let $n$ be the number of sides on the dice and $k$ be the cutoff. We will calculate the expected value of this strategy ($S_k$) as:

$$E[S_k] = p(x \geq k)\cdot E[ x\vert x \geq k] + (1-p(x\geq k))\cdot \left(E[S_k]-1\right)$$

That is, we have agreed if our roll is greater than the cutoff we will stop and if it is less we will roll again. So if our roll is greater than $k$ (which will happen with $p(x \geq k)$), then we calculate the expected value of the values of $x \geq k$ and multiply this by the probability. If however, our roll is less than the cutoff, then we are back where we started except we have lost a dollar so the expected value is $E[S_k] - 1$.

Rearranging the equation gives us:

\begin{align} E[S_k] &= p(x \geq k)\cdot E[ x\vert x \geq k] + (1-p(x\geq k))\cdot \left(E[S_k]-1\right) \\ E[S_k]\cdot p(x\geq k) &= p(x \geq k)\cdot E[ x\vert x \geq k] - (1-p(x\geq k)) \\ E[S_k] &= \frac{p(x \geq k)\cdot (1 + E[ x \vert x \geq k]) - 1}{p(x\geq k)} \\ E[S_k] &= 1 + E[ x \vert x \geq k] - \frac{1}{p(x\geq k)} \\ \end{align}

Let us calculate $p(x \geq k)$ and $E[x \vert \geq k]$. There are $n-k+1$ rolls greater than or equal to $k$ and since there are $n$ possible rolls, we get:

$$p(x \geq k) = \frac{n + 1 - k}{n}$$

As for $E[x \vert x \geq k]$, the numbers $k, k+1, \ldots n$ are all greater than or equal to $k$ and occur with equal probability. So the expected value of these is just there average i.e.:

$$E[x \vert x \geq k] = \frac{n + k}{2}$$

Combining these, we finally get:

$$E[S_k] = 1 + \frac{n + k}{2} - \frac{n}{n + 1 - k} \\$$

We want to maximize this function. We can do this easily by computing when the derivative is $0$:

$$\frac{\partial}{\partial k} E[S_k] = \frac{1}{2} - \frac{n}{(n + 1 - k)^2} \\$$

and so, we compute when this is $0$:

\begin{align} (n + 1 - k)^2 - 2n &= 0\\ k^2 + k(-2 n - 2) + n^2 + 1 &= 0 \\ k &= \frac{2n + 2 \pm \sqrt{(2n+2)^2 - 4(n^2 + 1)}}{2} \\ k &= n + 1 \pm \sqrt{2n} \\ k &= n + 1 - \sqrt{2n} \end{align}

So, plugging in your values for $n = 6$, your final answer is $k = 3.53$ so as soon as you roll above $3$ in the game, you should stop :)

Just for completeness, the more general version, where you have to pay $p$ dollars to roll again is given by:

Optimum cutoff: $$k = n + 1 - \sqrt{2np}$$

In case you wanted some evidence, here are the graphs of average money earned after stopping as soon as a roll of $x$ or higher is seen.

$n = 6$. Note how the optimal value is when $x = 3$ or $x = 4$ are the cutoffs:

$n = 50$. Note how max is at $51 - \sqrt{100} = 41$, exactly as the formula predicts:

• Brilliant, Thanks! Commented Dec 31, 2016 at 15:07
• In the above graph payoff for stopping at 3 is slightly higher than at 4, so why should we do "as soon as you roll above 3 in the game, you should stop" Commented Aug 8, 2018 at 19:15

Let $v_k$ be the value of the game if you accept a roll of $k$ or more, re-roll otherwise. Then

\begin{align} v_1&=(1/6)(1 + 2 + 3 + 4 + 5 + 6) &\Rightarrow \qquad v_1 &= 7/2 < 4 \\ v_2&=(1/6)(v_2-1)+(1/6)(2 + 3 + 4 + 5 + 6) &\Rightarrow \qquad v_2 &= 19/5 < 4 \\ v_3&=(2/6)(v_3-1)+(1/6)(3 + 4 + 5 + 6) &\Rightarrow \qquad v_3 &= 4 \\ v_4&=(3/6)(v_4-1)+(1/6)(4 + 5 + 6) &\Rightarrow \qquad v_4 &= 4 \\ v_5&=(4/6)(v_5-1)+(1/6)(5 + 6) &\Rightarrow \qquad v_5 &= 7/2 < 4 \\ v_6&=(5/6)(v_6-1)+(1/6)(6) &\Rightarrow \qquad v_6 &= 1 < 4 \\ \end{align}

Thus, there are two equally optimal strategies:

1. Accept on 3 or more, re-roll on 2 or less.
2. Accept on 4 or more, re-roll on 3 or less.

• Thats a very nice approach. However, why does the strategy have to be fixed on every role? This assumes the same strategy to be used for any given role. Why not have a mixed strategy? Commented Dec 31, 2016 at 13:03
• The game has no opponent, and the game has no memory, so the choice of strategy can be fixed, depending only on the value of the current roll. It doesn't matter if it's an initial roll or a re-roll. The value of the roll is all that matters for making the choice, hence can be decided in advance, as in my analysis. Commented Dec 31, 2016 at 13:13
• @gowrath: Thanks for the suggested edit -- much better looking. I'm just learning MathJax. Commented Dec 31, 2016 at 13:38
• @quasi No worries :) Align environment is useful for stuff (y) Commented Dec 31, 2016 at 13:40
• @quasi Thanks for your input! Commented Dec 31, 2016 at 15:08