In a game there is a 20-sided die. At the start of the game it is on the table and the 1 face is facing upright. In each of the 100 rounds you have 2 options: you can either roll the dice or you can take a number of dollars equal to the current face. How would you play this game to maximize the expected profit and how much money could you win on average?
First, let's notice that it does not make sense to reroll after taking money, because if you admit it's profitable to take x dollars on turn i, it is also profitable to take them on turn i+1. So the best strategy would be to roll up to something "good enough" and then take it for the rest of turns.
I have thought about 3 things that could be useful (though I am not sure if they are):
- Let $(U_1,U_2,...,U_{100})$ be i.i.d. r.v. ~ Unif{1,..,20}, representing the randomness for rolls.
Let $(Y_1,Y_2,...,Y_{100}) \in {0,1}$ : $Y_i = 0 <=> $ we decide to roll on turn $i$, $Y_i = 1 <=> $ we decide to take money on turn $i$.
Let $(X_0,X_1,X_2,...,X_{100})$ be r.v. representing the current face of the dice. $X_i$ - the face of the dice on the turn $i$ ($X_0=1)$: $$X_n = Y_nX_{n-1} + (1-Y_n)U_n = \prod_{i=1}^{n}Y_i +\sum_{i=1}^{n}[(\prod_{j=i+1}^{n}U_j )U_i(1-Y_i)] $$
Finally, let $(S_0,S_1,S_2,...S_{100})$ be r.v. such that $S_i$ - the money you have after turn $i$. $S_0 = 0$, $\forall n \geq 1:$ $$S_n = S_{n-1}+Y_nX_{n-1}=\sum_{i=1}^{n}Y_iX_{i-1} = \sum_{i=1}^{n}Y_i(\prod_{k=1}^{i-1}Y_k +\sum_{k=1}^{i-1}[(\prod_{j=k+1}^{i-1}U_j )U_k(1-Y_k)])$$
Now we want to maximize $\mathbb{E}[S_{100}]$, and that is the moment I am stuck on. Should we somehow use that $X_n$ is a Markov chain? Or should we somehow find a suitable Martingale, which could help us to calculate this expectation be applying Doob's optional sampling theorem?
- For each turn $i$ $ \exists K_i \in$ {1,..,20} such that:
If $X_{i-1} \geq K_i$, then for all turns $j : 100 \geq j \geq i$ we take $X_i$ and do not roll again ($Y_j = 1$) ;
If $X_{i-1} < K_i$, then we reroll on turn i ($Y_i = 0$).
Let's notice that $K_i$ is a fixed number, not a random variable. So if we get to calculate $K_i$ for each turn $i$, we will solve the task and find the best strategy.
Let $T := inf\{i \in (1,...,100) | X_{i-1} \geq K_i \}$ be a r.v. representing the turn on which we start taking money (T is a stopping time).
Then $Y_1=Y_2=...=Y_{T-1}=0$, $Y_T=...=Y_{100}=1$.
And $X_1 = U_1, ..., X_{T-1} = U_{T-1}$, $X_T=...=X_{100}=X_{T-1}=U_{T-1} \geq K_T$.
And $S_1=...=S_{T-1}=0$, $S_T = X_{T-1}, S_{T+1} = 2X_{T-1},...,S_{100}=(101-T)X_{T-1}$.
Again, if only we could build a Martingale from $S_n$...
- $K_i = min \{k_i: (101-i)k_i \geq \mathbb{E}[S_{100} | T \geq i+1] \} $ : by definition, $K_i$ is the smallest roll that would still bring more money $(101-i)k_i$ than rerolling .
$$\mathbb{E}[S_{100} | T \geq i+1] = \mathbb{E}[(101-T)X_{T-1}| T \geq i+1] = \sum_{j=i+1}^{100} \{\mathbb{E}[(101-T)X_{T-1}| T \geq i+1, T=j] \mathbb{P}[T=j]\} = \sum_{j=i+1}^{100} \{\mathbb{E}[(101-j)X_{j-1}] \mathbb{P}[U_{j-1} \geq K_j, U_{j-2} < K_{j-1},...,U_1<K_2]\} = \sum_{j=i+1}^{100} \{\mathbb{E}[(101-j)X_{j-1}] \frac{K_2-1}{20}...\frac{K_{j-1}-1}{20}\frac{21-K_j}{20}\} = \sum_{j=i+1}^{100} \{ \sum_{n=1}^{20}\{\mathbb{E}[(101-j)X_{j-1} | X_{j-1}=n]\mathbb{P}[X_{j-1}=n]\} \frac{K_2-1}{20}...\frac{K_{j-1}-1}{20}\frac{21-K_j}{20}\} = \sum_{j=i+1}^{100} \{(101-j) \sum_{n=1}^{20}\{\frac{n}{20}\} \frac{K_2-1}{20}...\frac{K_{j-1}-1}{20}\frac{21-K_j}{20}\} = $$$$ \frac{21}{2} \sum_{j=i+1}^{100} \{(101-j) \frac{K_2-1}{20}...\frac{K_{j-1}-1}{20}\frac{21-K_j}{20}\}$$
The player of the game is right now in the situation he sees $x$ (between $1$ and $20$) and has $k$ more rounds to go, denote by $$ W(x,k) $$ the expected win with the optimal strategy. He can either take $x$ dollars, or else take a new face, and in the last case the expected win is the mean of the $W(y,k-1)$ for all $20$ possibilities of $y$. Thus we have to compute recursively (from the end to the start) the numbers $W(x,k)$ determined recursively by: $$ \begin{aligned} W(x,1) &=x\ ,&&\text{one more round, take the money, }\\ W(x,k+1) &=\max\left(x+W(x,k),\ \underbrace{\frac 1{20}\sum_yW(y,k)}_{w(k)}\right)\ ,&& \text{ponder both decisions, take max .}\\ \end{aligned} $$ Let us cover some first steps manually.
This goes on in the same manner till all $100$ steps are computed. Since the problem is a very special bet-and-win story, no number theory, i decided to implement, instead of searching for an exact formula. Note that during the backwards recursion we have at each step some cases when the expected win at best decision is $kx$ (when facing $x$ and having $k$ further steps to go), so let us put a terminology on this collect the money-set, it is the "support" at step $k$.
Code:
This delivers:
And at this point,
W[1]contains the needed expected win:(Code was manually rearranged.)