Q1
Question:
Suppose we play a game. I roll a die up to three times. Each time I roll, you can either take the number showing as dollars, of roll again. What is your expected winnings?
Solution:
Let random variable be the winnings for rolling a die up to k times.
The key is to formulate the following strategy: after rolling a dice, if the number showing is greater than the expected winnings of rollings the rest of the times, you should take the money. Expressing this with math:
(number for this toss,
Thus, working from the end:
Reflection:
This kind of problem is a little bit like DP - defining a subproblem, finding the relationship between subproblems, then starting from a base case and working upwards step by step.