User:Bender2k14, CC BY-SA 3.0 · CC-BY-SA-3.0 · Wikimedia Commons
When a process wanders between states and stops when it hits one of a few “sinks” (gambler’s ruin, random walks on a graph, “flips until pattern X”), don’t track every path. Define $f(i)$ = the answer starting from state $i$. At each interior state, $f$ satisfies one simple equation: take one step, then average $f$ over where you land. We’ll show this on a small bankroll trying to reach a target.
โ 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 gambler starts with $3 and repeatedly bets $1 on a fair coin flip โ win takes them up $1, loss takes them down $1. They stop when they hit $0 (broke) or $5 (target). What is the probability they reach $5 before going broke?
โ Worked example ยท expand
Practice 1 of 3Type a fraction, decimal, or expression.
โ Practice ยท expand
Reflection
When you read a problem, what cues tell you to reach for first-step analysis rather than (say) recursion or a complement argument? In your own words, why does defining $f$ on <em>every</em> state โ not just the start state you care about โ make the problem easier, not harder?