When to Stop Re-Rolling the d100
A 100-sided die shows the faces 1 to 100, each with probability 1/100. After a roll you may take the face value in dollars, or pay 1 dollar and roll again, as often as you like. Optimal play is a threshold rule: accept the first roll of or higher.
Conditioning on the first roll turns the value of the threshold- policy into a closed form:
def value(t):
p = (101 - t) / 100
return (t + 100) / 2 - (1 - p) / p
print(max(range(1, 101), key=value))
What integer does this print?
Answer format: enter an integer.
Sign in to answer questions and track your progress
Sign In