Random Walk on a Table -- Expected Steps to Fall Off

Expectation · Medium · Free problem
A robot is placed on a one-dimensional table of length $L$ cm, at a distance $x$ cm from the left edge (so it is $L - x$ cm from the right edge). At each step, the robot moves 1 cm to the left with probability $p$ and 1 cm to the right with probability $q = 1 - p$. The robot falls off when it reaches either edge. 1. Find the expected number of steps $E_x$ until the robot falls off, as a function of $x$, $L$, $p$, and $q$. 2. Simplify for the symmetric case $p = q = 1/2$. 3. Verify your formula with a sanity check: what happens at $x = 0$, $x = L$, and $x = L/2$ in the symmetric case?

Open the full interactive solver, hints, and worked solution →