Rolling dice – win if the sum of rolls is exactly $n$

probability

This question was asked during my interview: Suppose you have a fair dice (6 faces as usual). You can pick a positive integer $n$. Then you can repeatedly roll a dice until the sum of the rolls exceeds or equals to $n$. If the sum is exactly $n$, it is a win. Otherwise, you lose. Find $n$ that maximizes your chance of winning.

Let $P(n)$ be probability of win when the value is $n$. Then,
$$P(n) = \sum_{i=1}^6 \frac{1}{6}P(n-i)$$

However, solving this recurrence seems complicated and tedious. Is there an easier way to solve this?

Best Answer

As you remark, for $n>6$ the probability that you land on $n$ is the average of the $6$ predecessor probabilities. As such, it can never exceed the maximum of those $6$.

It is clear that $n=6$ has the greatest probability of the first six values (easy to check this by hand, of course). Thus no value beyond $6$ can be more likely, as iterated averages must lower the maximum. Thus the maximum value occurs for $n=6$, for which the probability is just a little greater than $.36$

It's not even close. $P(5)\approx .30877$ and $P(n)<.3$ for all $n\neq 5,6$. The limiting value, for large $n$ is $\frac 1{3.5}\approx .28571429$ since the average toss of the die is $3.5$ This limit is reached fairly quickly, as $P(26)\approx .28574$