[Math] Maximizing Winnings – Dice Roll Strategy

diceexpectationprobability

Let’s consider a simple dice game. Two fair 6-sided dice are rolled. Let $X$ is the sum of the two dice. If $X = 7$, then the game ends and you win nothing (winnings = 0). If $X \neq 7$, then you have the option of either stopping the game and receiving $X$ (what you rolled on your last roll) or starting the whole process over again.

Now consider this strategy to play: pick a number $i$, where $2 \leq i \leq 12$, and stop playing the first time that a value greater than or equal to $i$ is rolled (or until you are forced to stop as a result of rolling a 7). Define $Y_i = $ winnings when you use this strategy with chosen value $i$. We are interested in the value $i$ that maximizes the expected winnings $\mathbb{E}[Y_i]$ over the all possible choices of $i$. To make a long story short, it turns out that the value of $i$ that maximizes the expected winnings $\mathbb{E}[Y_i]$ for the game is $i = 8.$

For this problem, what we actually want is for you to explicitly compute the expected winnings $\mathbb{E}[Y_i]$ for $i = 5, 6, 8$ and $9$ to show why the expected winnings is maximized when $i = 8$. You do not need to consider the cases where $i = 2, 3, 4, 10, 11$ or $12$.

Attempt:
Tried Expressing

$\mathbb{E}[Y_i \mid X = 7] = \text{-Winnings}$

$\mathbb{E}[Y_i \mid X < i, X \neq 7] = X + \mathbb{E}[Y_i]$

$\mathbb{E}[Y_i \mid X \geq i, X \neq 7] = X$

$\mathbb{E}[Y_i \mid X = 7] = -(\mathbb{E}[Y_i | X < i, X \neq 7] + \mathbb{E}[Y_i | X \geq i, X \neq 7])$

But no matter what I do, I'm getting an incorrect answer as $8$ should be the maximum, but it's not… Please help!

Best Answer

Let $p(n)$ be the probability of rolling a sum of $n$ on a single roll, so $$p(n)=\frac{1}{6}-\frac{|n-7|}{36}.$$ Then the expected value $e_i$ of the winnings while using the strategy that we stop only when we hit a sum of $i$ or greater is $$ e_i = \sum_{j=i,j \neq 7}^{12} p(j)\cdot j + \left(1-\frac{1}{6}-\sum_{j=i,j\neq 7}^{12} p(j) \right)e_i $$ Solving for $e_i$, we find $$e_2 = 35/6$$ $$e_3 = 208/35$$ $$e_4 = 202/33$$ $$e_5 = 19/3$$ $$e_6 = 85/13$$ $$e_7 = 20/3$$ $$e_8 = 20/3$$ $$e_9= 25/4$$ $$e_{10}=16/3$$ $$e_{11}=34/9$$ $$e_{12}=12/7$$ so the maximum occurs at $i=8$, which is the same as $i=7$.

Here is a python simulation for extra verification.

import math
import random

games = 10000000

strat= 2 # stop on strat or more
tots = 0

for i in range(games):
    done=0
    while(done=strat):
            done=1
    winning =0
    if (sum!=7):
        winning=sum

    tots = tots+winning

    if (i % 1000==0) and i>0:
        print i," ",tots*1./i

print tots*1./games

You can try it: output agrees with the exact calculated values above to very high precision.

Related Question