Interview problem: dice game

Problem: 
(1) Toss a dice. You can get face value in dollars or you can choose to try again twice. What is the expected payoff according to the best strategy?

(2) Compare the payoff in (1) to the expectation of the maximum face value of two tosses without calculation.

(3) What if you can try again at most 50 times? Estimate the number to the 3 decimal.

(4) What if you can try again for infinite times but each toss will cost you 1 dollar? The first toss is free.





Solution:

(1) Let $f(n)$ be the expected payoff when we can roll at most $n$ times, $f(1)=(1+2+3+4+5+6)/6=3.5$. 
For $f(n+1)$, the strategy is to try again if the face value is less than $f(n)$, otherwise take the face value: \begin{equation}f(n+1) = \frac{1}{6}\sum_{i=1}^6\max\left[i, f(n)\right]\,.\tag{1}\end{equation} As a result, $f(2)=(3.5 + 3.5 + 3.5 + 4+5+6) / 6=4.25$.

(2) The payoff in (1) should be smaller since we cannot take the face value of the previous roll.

(3) We continue to calculate (1): $f(3)=4.67$, $f(4)=4.94$ and $f(5)=5.13>5$. Therefore, for $n\geq 5$, we have $f(n+1) =\frac{5}{6} f(n) + 1$, and thus $f(n)=\left[f(5)-6\right]\left(\frac{5}{6}\right)^{n-5}+6$. Finally, $f(50)\approx 5.999$.

(4) The payoff of the last trial is $3.5$. Since the first trial is free, we can roll at most 4 times. 
Let $g(n)$ be the expected net profit before the $n$-th roll, we have $g(4)=3.5-3=0.5$ and for $n<4$, \begin{equation} g(n)=\frac{1}{6}\sum_{i=1}^6 \max\left[i-(n-1), \,g(n+1)\right]\,.\end{equation} As a result, $g(3)=(0.5+0.5+1+2+3+4)/6=1.83$, $g(2)=(1.83 + 1.83 + 2+3+4+5)/6=2.94$, and finally $g(1)=(2.94+2.94+3+4+5+6)/6=3.98$. 

Comments

Popular posts from this blog

529 Plan

How to offset W2 tax

Revocable Living Trust