expected number of gold you can collect.
you have a six sided dice and n points 1 to n. there some golds in any points. initially you are in position 1. if you reach any point you can collect all the golds of that point. now you start the game with throwing the dice. if dice gives x you should add x from your current position.for example if you are in position i and dice gives you x then your current position will be i+x. if i+x>n , you have to stay in i. as soon as you reach the nth position the game will over. now you have to calculate what is the expected number of golds you can collect. if n=3 and the golds 3, 6 ,9 in position 1,2,3 respectively. the answer is 15 but how?
Initially you are in position 1 so you get the 3 gold there. Rolling 3, 4, 5 or 6 won't change anything since you can't move. So you will end up either rolling 1 or 2, both with a probability of $1/2$. In the first case (rolling 1), you pick up the 6 gold in position 2 and later the 9 gold in position 3. In the second case (rolling 2), you pick up the 9 gold in position 3 and the game ends.
So the expected number of gold is $$\frac{1}{2} \cdot (3 + 6 + 9) + \frac{1}{2} \cdot (3 + 9) = 9 + 6 = 15.$$