Let’s play a casino game. I am the dealer with a 20 sided die. You're going to have 100 rounds and in each round you have two options :—
You can either roll the die on the table replacing whatever it's currently showing with a new number ( but this won’t give you any money )
You can take a number of dollars from the casino equal to the current face ( After this, the dealer will take the die off the table, so you would have to use the next turn to roll the die)
The question is how would you play this game and how much money do you think you'll make on average ?
One valid sequence of turns will be :- Roll , Roll , Take Money, Roll, Take money …
This took 5 turns and note that the first turn will always be “Roll” and the turn after “Take money” will always be “Roll”
Try to solve this problem yourself before moving on to the solution below
.
.
.
.
.
Solution
These sort of problems are always open ended and you always have to start with a simple strategy and build up on top of it.
So the most basic one can be to roll a die and take whatever the number comes up.
That looks like Roll, Take money, Roll, Take money …
We don’t use any re-rolls and every number can come up with equal probability.
Expected value of a payoff = Average of all numbers from 1 to 20 = 10.5
Number of times we can play this game = 100 / 2= 50
Total Payoff = 10.5 * 50 = 525
So that’s the base strategy, let’s try to make one that pays more
Strategy II
Roll till a number “x” or above shows up and take money or re-roll. The probability that the number on die comes up to be “x” or greater is (21-x)/20
. The expected number of rolls it would take to get a number “x” or greater is 20/(21-x)
. Total turns used (including 1 to take the money ) would be (20/(21-x))+1
The payoff everytime should be the average of x to 20 =>
The number of payoffs we can have is given by =>
Hence the total payoff becomes
The equation seems daunting but is fairly simple, you can check by replacing x by 1 we get the result $ 525 !!!
Now the ideal way to solve is take the derivative and equate it to zero and perform a sanity check that the solution is indeed a maxima OR you can randomly try different values and get the highest result. Anyways, the key essence is to formulate the equation.
The highest comes around x = 6 that pays off around $ 557
That’s a big payday !
.
.
😃 Over to you: Were you able to solve this?
👉 If you liked this post, don’t forget to leave a like ❤️. It helps more people discover this newsletter on Substack and tells us that you appreciate solving these weekly questions. The button is located towards the bottom of this email.
👉 If you love reading this newsletter, feel free to share it with friends!
I got there an easier way.
Using the alternation strategy, the value per roll is 10.5/2=5.25. So having rolled once, it's only worth rolling again if you expect to improve the value by 5.25 or more. Since you can only take the current value, not the highest of your rolls, there's no point in replacing the current roll unless it is more than 5.25 below the expected value of your new roll (10.5), so reroll on 5 or lower.
P(r>5)=3/4, so expected number of rolls in a run (before taking the money) is then 4/3. New expected value at the end of a roll is 13 (mid of 6..20). Total cost of a run is (1+4/3) rolls. So expected result is 100*13/(1+4/3)=557 1/4.
The only additional nuance would be that when you are close to the end you might modify your strategy. With 1 turn remaining you must take the value, so with 2 remaining you must take an existing value of 6 or higher or roll-and-take (E=13 for these two rolls, for 13/2=6.5 average). On the 3rd turn from the end the options are roll roll take (E=13) or take roll take (E=r+10.5). So assuming we arrive at this roll with even chance of previously a roll or a take, then we can choose which of these paths.
If we have a previous roll, and it has a value of 3 or more, we take, otherwise we roll. Expected value then is average of 3..20=11.5, so now our last 3 turns expect 22 with probability 9/10 (for rolling 3 or more), or 13 with probability 1/10, or 21.1.
So if we had a take 4 from the end, our expected value is 13, and it was a roll our expected value is 21.1. Truncating at this point gives an expectation of 17.05 for the last 3 rolls, or a grand total of 557.5825.
I'm sure you could continue the analysis backward and maybe generalise an expression.
There is a better strategy that gets you en expected payoff of $560.62.
The basic idea is that suppose on the Nth roll you get an x. Now if you take the money you are left with N-2 moves and $x. If you were to roll again you would be left with N-1 moves. To calculate expected payoff you take the maximum of the two.
We can write a recursive relation for the payoff on the Nth roll.
En = summation of i from 1 to 20 [ max(En-1, i + En-2) ] / 20
with base case E1 = 0 and E2 = 10.5
I couldn't find a simplified formula but simulating it by code I got the expected payoff of $560.62!