## d20 rolling puzzle

A forum for good logic/math puzzles.

Moderators: jestingrabbit, Moderators General, Prelates

DataGenetics
Posts: 24
Joined: Sat Jan 01, 2011 1:12 am UTC
Location: Seattle

### d20 rolling puzzle

I have a single (fair and unbiased) d20. We play a game.

You roll the die, and can elect to bank, or roll again. If you bank, you walk away with the dollar amount shown on the die, and the game ends.

If you elect to re-roll, it costs you \$1 for each new roll. You can re-roll as often as you like. (Your first roll is free).

What is the optimal strategy to adopt to maximize expected return?, and what is this expected return?

DataGenetics
Posts: 24
Joined: Sat Jan 01, 2011 1:12 am UTC
Location: Seattle

### Re: d20 rolling puzzle

This is a great little problem because it's so simple, and you can test your hypothesis with a simple Monte Carlo Simulation.

Once you think you have a good 'strategy' write a few lines of code and test it out by running it a few million times with a random number generator.

zukenft
Posts: 44
Joined: Mon Dec 20, 2010 11:34 am UTC

### Re: d20 rolling puzzle

in your own blog you said
Spoiler:
to continue rolling until you got a 15 or above.

now what about a general solution? for different entry/play costs, and for different sided dice?

EDIT : is this is basically roulette? well, except for the fair payout...

DataGenetics
Posts: 24
Joined: Sat Jan 01, 2011 1:12 am UTC
Location: Seattle

### Re: d20 rolling puzzle

Yes. If the price to re-roll is constant, *and* there is no limit to the number of times you are allowed to re-roll, then the optimal strategy will be a fixed limit stopping strategy. You can use the technique in the blog to find out what this is depending on the cost/dice-range.

If there is a limit to the number of re-rolls allowed (or the price to re-roll is variable) then the stopping condition will be a function of the number of rolls in and the current count (For example of how to calculate this, look two articles earlier in my blog for the puzzle about rolling the d6).