Expected Steps for a Fair Random Walk to Drift N Units Away
Last updated: November 29, 2026
Quick Overview
A daily budget pacing error moves up or down by one unit each step with equal probability, starting at zero. What is the expected number of steps until the error first reaches plus or minus N, and from a starting point i between 0 and N, how long until it hits 0 or N?
Meta
November 29, 20260
0
0 solved
A daily budget pacing error moves up or down by one unit each step with equal probability, starting at zero. What is the expected number of steps until the error first reaches plus or minus N, and from a starting point i between 0 and N, how long until it hits 0 or N?
This question tests martingale reasoning, which Meta data scientists use when thinking about drift in pacing, sequential tests and random walk models. The interviewer wants the $N^2$ answer, a proof via optional stopping or first-step analysis, and an intuition about diffusive scaling.
What the Interviewer Expects
- Recognize $S_t^2 - t$ as a martingale
- Apply optional stopping to get $E[T] = N^2$
- Solve the boundary problem $D_i = i(N - i)$ by first-step analysis
- Verify by simulation
- Explain the square root scaling of random walk distance
Key Topics to Cover
How to Approach This
- Define your hypotheses (H0 and H1) clearly before performing any test.
- Calculate required sample size BEFORE running an experiment, using power analysis.
- Remember the Central Limit Theorem: sample means become approximately normal with large n.
- Watch for Simpson's paradox. Always segment data by key dimensions.
- Distinguish between statistical significance and practical significance.
Possible Follow-up Questions
- What is the expected time for a biased walk?
- Why must optional stopping conditions be checked here?
- How does this square root scaling show up in sequential testing?
- What is the expected time to hit +N alone, with no lower barrier?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Browse Statistics QuestionsSample Answer
Clarify
Simple symmetric walk with , steps with probability 1/2. . We want , and for barriers 0 and starting at , the expected duration ....
Approach
Use the martingale : , so subtracting makes it fair. Stop at , where exactly. Alternatively solve the first-step recursion with...