Die game with two rerolls
Asked at Optiver, SIG
You roll a fair six-sided die and get paid its face value in dollars. After the first or second roll you may choose to reroll; you must accept the third roll if you take it. (Up to rolls total.)
What is the fair value of the game under optimal play?
Show a hint
Solve the one-reroll game first, then use its value as the continuation value for the first roll.