Expected Steps for a Random Walk to Leave a Band
Last updated: November 29, 2026
Quick Overview
A metric performs a symmetric random walk on the integers, starting at 0 and moving up or down by 1 each step with probability 1/2. What is the expected number of steps until it first reaches +N or -N?
0
0
0 solved
A metric performs a symmetric random walk on the integers, starting at 0 and moving up or down by 1 each step with probability 1/2. What is the expected number of steps until it first reaches +N or -N?
Random walk exit times are a common Google onsite step up from simple expectations. The interviewer checks first-step analysis on a boundary value problem, or a martingale argument, and the scaling intuition that distance grows like the square root of time.
What the Interviewer Expects
- Set up E_k = 1 + (E_{k-1} + E_{k+1})/2 with boundaries
- Solve the quadratic to get E_k = N^2 - k^2
- Answer N^2 from the center
- Give the martingale S_n^2 - n argument
- Connect to sqrt(n) scaling of random walks
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 exit time from an asymmetric band, from 0 to reach +a or -b?
- How does a drift change the expected exit time?
- What is the probability of hitting +N before -N from position k?
- How does this relate to alerting thresholds on noisy metrics?
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 random walk , steps with probability . Stop at . We want , and more generally starting from position ....
Approach
Two methods. First-step analysis gives a second order recurrence with boundaries . Alternatively, is a martingale, and optional stopping gives ....