Problem #10 from A Collection of Dice Problems by Matthew M. Conroy, is:
Suppose we can roll a $6$-sided die up to $n$ times. At any point we can stop and that roll becomes our score. The goal is to get the highest score possible, on average. How should we decide when to stop?
I approached this by thinking as follows. Suppose I roll a $5$, then the only way I can best that score is by rolling a $6$, which has probability $\frac{1}{6}$. The expected number of rolls to see a 'success' here is $\frac{1}{\frac{1}{6}} = 6$ so I would reroll if I had at least that many rolls left.
This disagrees with the answer given in the site above (see pages 17-18) whose approach was different and whose summary is as follows:
(...) We can summarize the strategy as follows:
- If there are at least 5 rolls left, stick only on 6.
- If there are 4, 3, or 2 rolls left, stick on 5 or 6.
- If there is only 1 roll left, stick on 4, 5 or 6.
I don't get what is wrong with my line of reasoning though.
What's wrong with your approach is that it has almost nothing to do with the game.
If you roll a $5$ and decide to roll again, you cannot go back and claim that $5$ as your score. So the question is not, "Will I roll a six in the remaining rolls?" Rather, the question is, "If I decide to roll again and play the remaining rolls optimally, what is my expected final score?"
The expected final score includes not only the possibility that you might roll a $6$, but also the possibility that you might end up with a score of $1$. Or $2$, or $3$, or $4$, or $5$. We get the expected value by multiplying each score by the probability that you will end up with that score, and add up the resulting numbers to get your expected value.
The expected value is generally considered a good way to take into account the fact that you might lower your score by deciding to roll again, a possibility that (as a comment pointed out) your approach does not account for. In that sense, your approach is unrealistically optimistic about rolling again.
On the other hand, the expected wait until the next $6$ takes into account the possibility that it might take $7$ rolls, or $8$, or $9$ until a six appears, each of those possibilities multiplied by its own probability. But if you only have six rolls left, it doesn't make any difference to you whether it would take $7$, $8$, $9$, or more rolls to get a six, because you cannot make those rolls. In that sense, your approach is unrealistically pessimistic about rolling again.
So not only does your approach not tell us exactly how many rolls must remain to make it worthwhile to re-roll on a $5$, it does not even give us either a lower or upper bound for the number of rolls. The required number of rolls might be more or less than six depending on whether your algorithm's error on the optimistic side outweighed its error on the pessimistic side, or vice versa.
TLDR: The waiting time until the next $6$ doesn't tell us anything about how to play this game.