Learn / Library / Expected value
Bankroll random walk
You start with a bankroll of . Each round a fair coin is flipped independently: heads wins , tails loses . You stop as soon as the bankroll reaches or . What is the expected number of rounds played?
Checking an answer needs JavaScript. The hint and the solution open without it.
Hint
Look for a function of the bankroll that drops by exactly on average each round and vanishes at both boundaries.
Solution
- Let be the expected remaining rounds from bankroll , with .
- For , .
- Try . The average of neighbours is , which fits the recurrence, and it vanishes at both ends.
- So .
- The expected number of rounds is .
Answer: