Limited rerolls, want last roll to be as high as possible. When do you settle?

40 Views Asked by At

Suppose you are playing a singleplayer game with a 20-sided die. You roll the die, then look at the number, and decide whether to roll again or stop. Your score is the value of your last roll, and you want it to be as high as possible. But you can only roll the die up to 3 times, so if you continue to the 3rd roll and then get a 2, you're stuck with it.

On your first roll, you roll an 11, which is slightly above-average for a 20-sided die. Is it better to keep this score, or should you reroll and shoot for something better?

More generally, if you have a K-sided die, and you have N rerolls left (not including this current roll), what is the formula for the boundary between scores you should keep and scores you should reroll?