Random walks & martingales: interview questions and key results

Gambler's ruin, optional stopping. The results to know for quant trading interviews, then a worked example of each of the 4 question types. Free, no sign-up.

Practise endless questions like these

Key results

Worked examples (4)

Try each one before opening the solution. In the app, every type generates fresh numbers each time.

Fair gambler's ruin

A gambler starts with $12 and bets $1 on fair coin flips until reaching $13 or going broke. What is the probability of reaching $13?

Answer and worked solution

Answer: 12/13 ≈ 0.92308

Wealth is a martingale (fair game). By optional stopping, E[final] = 12 = 13·P + 0·(1−P), so P = 12/13 = 0.92308.

Expected ruin duration

Starting at $16, you bet $1 on fair coin flips until you hit $0 or $17. What is the expected number of flips?

Answer and worked solution

Answer: 16

Di = 1 + ½Di−1 + ½Di+1 with D0 = D17 = 0 gives Di = i(17−i) = 16. You can also get this from the martingale Sn² − n.

Biased gambler's ruin

You start with $3 and bet $1 per round, winning each round with probability 0.55. You stop at $0 or $6. What is the probability of reaching $6?

Answer and worked solution

Answer: 0.64612

With r = q/p = 0.81818, P = (1 − r3) / (1 − r6) ≈ 0.64612. (Fair game: 0.5.) A small per-bet edge compounds, which is why edge matters so much in trading.

Return to origin

A simple symmetric random walk starts at 0 (±1 each step, equally likely). What is the probability it is back at 0 after 20 steps?

Answer and worked solution

Answer: 0.1762

You need exactly 10 up-steps out of 20: C(20,10)/220 ≈ 0.1762. Stirling gives ≈ 1/√(π·10) = 0.17841.

Other topics

Dice & coins · Cards & combinatorics · Conditional & Bayes · Expected value & games · Markov chains & order statistics · Options · Classic brainteasers · Number sequences · Distributions · Variance & covariance · Estimation & testing · Regression & correlation · Returns, risk & sizing · Time series

Preparing for a specific firm? See the firm guides.