Random walk: gambler's ruin and hitting probabilities
On a finite line, the probability you hit the right wall before the left is just your distance from the left over the total distance. Symmetric and clean.
A walker on the integers steps $\pm 1$ each tick. Two questions dominate interviews: (a) probability of hitting one boundary before another, and (b) expected number of steps to absorption. First-step analysis turns both into one-line recurrences with closed-form solutions.
β Intro Β· expand
Try first (productive failure)
Before the worked example: spend 60 seconds taking your best shot at this.
A guess is fine β being briefly wrong about a problem makes the explanation
land harder when you read it. This appears once per tutorial; skip
if you already know the trick.
60s
β Try first Β· expand
Worked example
A symmetric random walk starts at $50 and steps Β±$1 each turn until it hits $0 (ruin) or $100 (win). What is the probability of reaching $100 first?
β Worked example Β· expand
Practice 1 of 3Type a fraction, decimal, or expression β mathjs parses it.
β Practice Β· expand
Reflection
What changes about the answer when the walk becomes biased even slightly, and why does the ratio $r = q/p$ enter exponentially? In what real-life process does “gambler's ruin” show up that isn't a casino?