a friend of mine asked me about a certain game mechanic in a videogame and how many tries it would take for him (on average) to reach his goal. In abstract form, it can be explained as follows:
- You start with the number 4
- The lowest you can go is 0
- Once you reach 6, you win
- You flip coins (50/50 distribution) one after another. If you get heads, you add 1 to your number, if it's tails, you subtract 1
-> How many tries will it take to reach 6?
My main problem is, that you have an unlimited number of tries and that there is actually an upper and lower bound on your "score".
Can someone help me out?

Hint: Starting at position $4$, you have, in one flip, a fifty-fifty chance of going to position $3$ or position $5$. So $E_4=1+\frac12 E_3+\frac12 E_5$ (where $E_k$ is the expected number of flips to get from position $k$ to the end of the game (position $6$)). You can develop a bunch of equations like this and solve the resulting system using the fact that $E_6=0$. Note: You have to be a bit careful with the equation for $E_0$ since you have a fifty-fifty chance of staying at $0$ or moving to $1$.