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 β mathjs parses it.
β 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?