Hedge Funds puzzles, solved step by step
- Puzzles
- 100
- Traced to a firm
- 38
- Topics
- 14
- Hard
- 30
061How many flips of a fair coin do you expect to need before you see two heads in a row? Why is the answer different if you wait for a head followed by a tail?Squarepoint CapitalLondon · 2025
Try it first
What are the expected waits for HH and for HT?
Show the worked solution
Six flips on average for two heads in a row, and four for a head then a tail. Track how far along the pattern you are. For HH, a tail at any point sends you back to the start, including right after a head. For HT, a head after a head keeps you one step away, so progress is never lost. Solving the two small chains gives 6 and 4.
Why do two equally likely patterns take different times?
Think of two ladders where a slip costs you differently. On one, slipping from the first rung drops you to the ground; on the other, you can only ever slip back to the first rung. Both patterns are equally likely in any given pair of flips, but after one head the wrong next flip costs you everything for HH and nothing for HT. A head then a tail breaks HH and restarts it; a head then a head is still a perfect start for HT.
In the HH chain a tail from the one-head state falls back to the start, so the expected wait is 6 flips; in the HT chain a head from the one-head state stays where it is, so progress is never lost and the wait is 4 flips. How do you solve the chain?
Let E0 be the expected flips still needed from the start and E1 after one head. For HH, E0 = 1 + E1/2 + E0/2 and E1 = 1 + E0/2, because a tail from one head sends you back, and these solve to E1 = 4 and E0 = 6. For HT, the one-head state just waits for a tail, which takes 2 flips on average, and reaching the first head takes 2 more, giving 4. Say the states out loud before the algebra; the interviewer wants to hear them named.
The relationshipE0 expected flips still needed from the start E1 expected flips still needed after one head 1 the flip you are about to make What it says in wordsEach state's expected wait is one flip plus the average wait from wherever that flip sends you.What is the general pattern?
Patterns that can fail back to nothing take longer. The expected wait for n heads in a row is 2 to the power n + 1, minus 2: 2, 6 and 14 flips for one, two and three heads. This is a Markov chainA process whose next step depends only on the current state, not on how it got there, so it can be solved state by state. at heart, and the same state-by-state method handles anything that depends on a path: a streak, a barrier, a drawdown rule on a trading book.
Where candidates lose it
The usual wrong answer is 4 for both, reached by noting that each pattern has a one-in-four chance in a pair of flips. That treats the flips as separate pairs, which they are not: a pattern can start at any flip, and what happens after a failure depends on the pattern.
The second loss is setting up one equation instead of two. Name the states, start and one head, and write one equation for each.
What the interviewer asks next
- How many flips do you expect to need for three heads in a row?
- Two players race: one wins at the first HH, the other at the first HT. Who is more likely to win?
- With a coin that lands heads 60% of the time, how long do you expect to wait for HH?
Asked at Squarepoint Capital, Quantitative Research, London, 2025 (Wall Street Oasis):
statistical problems e.g. # of throws expected to get 2 heads in a row
