3 ms·
So, LeetCode? It's a dynamic programming problem. Working backwards, at round 100 you take the money, at earlier rounds if [remaining rounds] * [current readin
by WorkerBee28474 3y ago
So, LeetCode?
It's a dynamic programming problem. Working backwards, at round 100 you take the money, at earlier rounds if [remaining rounds] * [current reading] < average([EV at round+1]), then reroll, otherwise take the money.
- friend_and_foe 3y agoSo the max reading you can get is 20. This is an important consideration. Another consideration is that a take money can be done more than once in a row, so at some point it is optimal for you to take money for all subsequent rolls. The correct answer is, at any time if you roll a 20, take money for the remaining rounds. On average you'll get a 20 by round 20 if you just roll 20 times in a row, so in that scenario you'll get at least 1600. This makes 1600 the number to beat. So if remaining rounds * current reading > 1600, take the money for all the remaining rounds. This translates to 17 or higher rolls 1-5, 18 or higher rolls 6-11 19 rolls 12-15 and 20 onwards. That's only the first game in a series of 3 in the video, the remaining ones surprisingly have much simpler answers even though there are more considerations. Second game is if you take money your next round must be to roll, third game is that but if you take money, the casino gets to re roll before you do at its option, it is left ambiguous if the casino roll counts as one of your turns, which makes it 2 games to solve.