A move in a game brings rewards over the coming steps. A reward you get one step later is worth patience (between 0 and 1) of the same reward right now: you have to wait for it, and things can go wrong on the way. Write worth(rewards, patience): what the whole list of rewards is worth right now.
A move pays 10, two steps from now, with patience 0.9: a reward one step later is worth 0.9 of the same reward now. Carry it back to right now and drop it in the jar. What is the jar worth?
worth(rewards, patience)| rewards | the reward at each coming step, starting with right now | e.g. [5] |
| patience | what a reward one step later is worth, as a share of the same reward now (0 to 1) | e.g. 0.9 |
| returns | what the whole list is worth right now | |