Derivatives Foundation puzzles, solved step by step
- Puzzles
- 100
- Traced to a firm
- 66
- Topics
- 12
- Hard
- 29
033We play chess repeatedly. Half the games are draws; of the decisive games I win two thirds. The match ends when someone wins three games in a row, and a draw resets both streaks. What is the probability that I win the match?Old Mission CapitalChicago · 2018
Try it first
Before setting anything up: roughly how likely am I to win the match?
Show the worked solution
86/99, about 86.9%. Per game I win with probability 1/3, you win with 1/6 and we draw with 1/2. The match has five live states: no streak, my streak of one or two, your streak of one or two. Writing my chance of winning the match from each state as an unknown, each state's equation is a weighted average of its neighbours, and solving the five equations gives 86/99 from the start. The naive ratio of (1/3)^3 to (1/6)^3 gives 89% and is wrong.
Why does the match need states rather than a single formula?
A tennis game at deuce is the everyday version: whoever is a point ahead is in a different position from level, and the chance of winning the game from deuce is best found by naming the positions and linking them. What matters here is not the game count but the current streak, and only five positions are possible before the match ends: no streak, me on one, me on two, you on one, you on two. Every game moves the match from one of those positions to another, with the same three probabilities each time, so the match is a Markov chain and the answer is a small linear system rather than a series. Three in a row sounds like it needs a long sum over all the ways the match can go; the states collapse that sum into five unknowns.
From the no-streak start my chance of winning the match is 86/99, about 86.9%; on my streak of one or two it rises to 87.9% and 90.9%, on your streak of one or two it falls to 84.8% and 72.7%, and every draw returns the match to the start. How do you write and solve the equations?
Call my winning chance x from no streak, a1 and a2 from my streaks, b1 and b2 from yours. From any state a draw, probability 1/2, takes you to x. From no streak a win takes you to a1 and a loss to b1, so x = x/2 + a1/3 + b1/6. From a1 a win takes you to a2 and a loss to b1. From a2 a win ends the match in my favour, worth 1. From b1 a loss takes you to b2 and a win takes you to a1; from b2 a loss ends it, worth 0. Five equations in five unknowns, and the structure is friendly: substitute the draw term first, since x/2 appears everywhere, and the system reduces by hand in a few lines. The solution is x = 86/99, a1 = 29/33, a2 = 10/11, b1 = 28/33, b2 = 8/11. A simulation of 200,000 matches gives 0.869, which confirms the fraction.
The relationshipx my chance of winning the match with no streak live a1, a2 my chance when I have won one or two in a row b1, b2 my chance when you have won one or two in a row 1/2, 1/3, 1/6 the per-game chances of a draw, my win and your win What it says in wordsEach state's value is the average of the values of where the next game can send it, weighted by the chance of each result.Why is the naive ratio wrong, and in which direction?
The tempting shortcut compares the chance of three straight wins for me, (1/3)^3, with three straight for you, (1/6)^3, and takes my share: 8 over 9, 88.9%. That treats the match as a single race from scratch, but a broken streak is not a reset to equal footing: when you beat me on my streak of two, you start a streak of one, and the shortcut ignores every such hand-over. Those hand-overs favour the weaker player a little, which is why the true 86.9% sits below 88.9%. It is also worth saying that the draws change nothing about who wins: they only lengthen the match, which lasts about 33.9 games on average, because every draw sends both streaks back to zero.
Where candidates lose it
The common loss is the ratio shortcut, (1/3)^3 against (1/6)^3, which gives 8/9. It is close enough to sound right and the interviewer will ask you to defend it, at which point the missing hand-over of streaks becomes obvious.
The second is setting up too many states, tracking game counts or draw counts. Only the current streak matters. Five states, five equations, and the draw term is the same in every one.
What the interviewer asks next
- How long does the match last on average?
- The match now ends at two in a row. Does my chance go up or down, and why?
- Draws no longer reset the streaks, they are simply ignored. What is my chance now?
- Write the transition matrix and show which states are absorbing.
Asked at Old Mission Capital, Prop Trading, Chicago, 2018 (Wall Street Oasis):
You and I play chess. 1/2 games end in draws and in the other half I win with 2/3 probability and you win with 1/3
039You start with Rs 2 and bet Rs 1 at a time on a coin that falls your way 60% of the time. You stop when you reach Rs 5 or go broke. What is the probability you reach Rs 5?Two SigmaNew York · 2023
Try it first
Roughly how likely are you to reach Rs 5 before going broke?
Show the worked solution
135/211, about 64.0%. Let r be q over p, which is 0.4 / 0.6 = 2/3. The probability of reaching N from a stake of i is (1 - r^i) / (1 - r^N). With i = 2 and N = 5 that is (1 - 4/9) / (1 - 32/243) = (5/9) x (243/211) = 135/211. A fair coin would give 2/5 = 40%; the 60% edge lifts it to 64.0%. The game lasts about 6.0 bets on average.
Why is the answer not simply 2 out of 5?
With a fair coin the answer is 2/5, because a fair game cannot create or destroy expected money: you start with Rs 2, you finish with Rs 5 or Rs 0, so the chance of Rs 5 must be 2/5 to keep the average at 2. With a 60% coin each bet gains you Rs 0.20 on average, so the walk drifts upward and the chance of hitting the top is higher than the fair-coin fraction; what you need is a quantity that is still conserved under the biased coin. That quantity is (q/p) to the power of your stake. A win multiplies it by q/p, a loss by p/q, and weighted by their probabilities the two moves cancel: p x (q/p) + q x (p/q) = q + p = 1. Because that quantity is conserved, its starting value must equal its average finishing value, and that one line gives the formula.
The relationshipr the loss probability over the win probability; below 1 when the coin favours you i the starting stake, Rs 2 N the target, Rs 5 P i the chance of reaching the target before going broke What it says in wordsSet the conserved quantity r to the stake equal to its average at the end, and solve for the chance of reaching the target.The chance of reaching Rs 5 before Rs 0 rises along a curve above the fair-coin straight line, reaching 0.640 from a starting stake of Rs 2 against 0.4 for a fair coin, because each rupee of stake multiplies the odds of ruin by q over p, two thirds. How do you derive it from the states if you forget the formula?
Write P_i for the chance of reaching 5 from a stake of i. Then P_0 = 0, P_5 = 1, and in between P_i = 0.6 P_(i+1) + 0.4 P_(i-1), one equation per state. That is a second-order linear recurrence whose solutions are of the form A + B r^i with r = q/p, and the two boundary conditions fix A and B. Solving the five equations directly gives P_1 = 81/211, P_2 = 135/211, P_3 = 171/211 and P_4 = 195/211, and the recurrence is the thing to write on the whiteboard first, because it works for any rule change. A simulation of 200,000 games gives 0.639, agreeing with the fraction to three places. The same system with a 1 on the right-hand side of each interior equation gives the expected duration, about 6.0 bets from Rs 2.
What does the biased formula tell you about trading with an edge?
Let the target go to infinity. With a fair coin the chance of never going broke is zero: any finite stake is eventually lost. With the 60% coin it is 1 minus r to the stake, which from Rs 2 is 1 - 4/9 = 5/9, about 56%, and from Rs 10 it is above 98%. An edge does not protect a thin stake: with Rs 2 behind a 60% coin you still go broke 44% of the time, and the cure is not a better coin but a bigger stake relative to the bet. That is why a desk with a genuine edge still caps position size, and why the question sits next to the Kelly one. The limitation is that the bets here are of fixed size; once you can resize the bet with your capital, the ruin arithmetic changes completely.
Where candidates lose it
The common loss is answering 2/5, the fair-coin answer, or guessing that 60% means roughly 60%. The edge changes the structure, and the interviewer wants to hear q over p.
The second is writing the formula with p/q instead of q/p, which gives a number below 40% for a coin that favours you. Sanity check the direction: an edge in your favour must raise the chance above the fair-coin 2/5.
What the interviewer asks next
- What is the chance of reaching Rs 5 from Rs 2 with a fair coin, and why is it exactly 2/5?
- The target is Rs 10 instead of Rs 5. What is the chance now?
- There is no target: you play until you go broke or forever. What is the chance you never go broke?
- How long does the game last on average from Rs 2?
Asked at Two Sigma, Research, New York, 2023 (Wall Street Oasis):
Biased gamblers ruin problems; Markov Chain problems; sampling uniformly from triangle
074What is the expected number of fair coin flips needed to see two heads in a row? And how many to see a head followed by a tail?Squarepoint CapitalLondon · 2025
Try it first
HH and HT each have probability 1/4 on any two flips. Do they take the same expected time to appear?
Show the worked solution
6 flips for HH and 4 flips for HT. Track one state: whether the last flip was a head. For HH, a tail after a head sends you back to the start, so E(start) = 1 + E(one H)/2 + E(start)/2 and E(one H) = 1 + E(start)/2, giving 6. For HT, a head after a head leaves you still holding a head, so E(one H) = 1 + E(one H)/2 = 2 and E(start) = 2 + 2 = 4.
Why do two patterns with the same probability take different times?
Two queues at a counter: in one, a mistake sends you to the back; in the other, a mistake keeps your place. Both queues move at the same speed, but one is a much longer wait. Waiting for a pattern is a race with restarts, and what matters is how much progress a failure destroys: a tail after a head destroys everything for HH, while a head after a head destroys nothing for HT. That asymmetry, not the probability of the pattern, sets the expected time. It is also why HT and TH take 4 while HH and TT take 6.
Waiting for HH takes 6 flips because a tail after a head sends you back to the start, while waiting for HT takes 4 because a second head after a head still counts as a first head, so no progress is lost. How do you set up and solve the equations in the room?
Two states, two equations, each saying one flip plus the average of what remains. For HH: from the start, a head takes you to one H and a tail keeps you at the start, so E0 = 1 + E1/2 + E0/2; from one H, a head finishes and a tail returns you to the start, so E1 = 1 + E0/2; substitute to get E1 = 4 and E0 = 6. For HT the second equation changes to E1 = 1 + E1/2, since a head keeps you at one H, giving E1 = 2, and the first equation gives E0 = 2 + E1 = 4. The first equation is the same in both problems; only the failure branch differs.
The relationshipE_0 expected flips remaining from the start, no useful progress E_1 expected flips remaining once the last flip was a head 1/2 the chance of a head or a tail on each flip What it says in wordsThe pattern whose failures throw away progress takes six flips on average, and the pattern whose failures keep progress takes four.What is the quick check, and where does this matter beyond coins?
There is a general rule: the expected time to a pattern is the sum of 2 to the k over every length k at which the pattern overlaps itself. HH overlaps itself at lengths 1 and 2, so 2 + 4 = 6; HT overlaps only at its full length 2, so 4. The same arithmetic prices a bet on which of two patterns appears first, and it shows up on a desk whenever a signal needs a run of confirmations: a rule that resets on any contradicting tick waits far longer than one that keeps partial progress. The limitation is the fair coin; with a biased coin the overlap rule still holds but the powers of two become products of the relevant probabilities.
Where candidates lose it
The common answer is that HH and HT take the same time because each has probability 1/4. The interviewer is testing whether you see that waiting time depends on what a failure costs, not on the pattern's probability.
The second loss is setting up the HT chain with a return to the start after a second head. A head after a head is still one head; the state does not change.
What the interviewer asks next
- What is the expected number of flips to see three heads in a row?
- Which appears first on average, HHT or HTH, and why are their waiting times different?
- The coin lands heads with probability 0.6. Expected time to HH?
- You flip until you see HT and I flip until I see HH. What is the chance you finish first?
Asked at Squarepoint Capital, Quantitative Research, London, 2025 (Wall Street Oasis):
a few siimple questions on statistical problems e.g. # of throws expected to get 2 heads in a row
084Orders join a queue at a limit price at random at 2 a minute and are filled at random at 3 a minute. What fraction of the time is the queue empty, and how many orders are in it on average?DRWNew York · 2026
Try it first
What fraction of the time is the queue empty?
Show the worked solution
The queue is empty one third of the time and holds 2 orders on average. With arrivals at 2 a minute and fills at 3, the fill process is busy a fraction 2/3 of the time, so the queue is empty 1/3 of the time. Balancing flow across each arrow of the chain gives share(n + 1) = (2/3) share(n), a geometric ladder starting at 1/3, whose mean is (2/3)/(1/3) = 2.
Why does balancing flow across one arrow solve the whole chain?
Picture a ticket counter with one clerk. Over a long day, the number of times the queue grows from 3 people to 4 must equal the number of times it shrinks from 4 to 3, because you cannot go up through that boundary twice without coming back down through it once. In the long run the flow of arrivals across each boundary equals the flow of fills back across it, which pins the share of time in each state to the share in the state below. Arrivals push at 2 a minute times the share of time at n; fills pull at 3 a minute times the share at n + 1. Equal flows mean share(n + 1) = (2/3) share(n).
Arrivals at 2 a minute push the queue one state to the right and fills at 3 a minute pull it one state to the left, and balancing the two flows across every boundary makes the long-run share of each queue length two thirds of the one before, starting at one third for an empty queue and averaging 2 orders. How do the shares add up to one, and what is the mean?
The shares form a geometric series: share(0), share(0) x 2/3, share(0) x 4/9 and so on. They must sum to 1, and a geometric series with ratio 2/3 sums to 3 times its first term, so share(0) = 1/3. The mean number in the queue is the sum of n times share(n), which for a geometric ladder is the ratio over one minus the ratio: (2/3)/(1/3) = 2. A queue fed at two thirds of its capacity holds two orders on average, and because the mean is rho/(1 - rho) it explodes as arrivals approach fills. At 2.7 arrivals a minute the average would be 9; at 3 it is unbounded.
The relationshiplambda the arrival rate, 2 a minute mu the fill rate, 3 a minute pi_n the long-run share of time with n orders in the queue L the mean number of orders in the queue What it says in wordsEach queue length is two thirds as likely as the one below it, the empty state has share one third, and the average length is two.Two sentences that show you can use it. Little's law says time in the system equals mean number over arrival rate, 2/2 = 1 minute, so an order joining this queue expects to wait a minute to be filled, which is what a market maker deciding whether to post at this price wants to know. The limitation: the chain assumes memoryless arrivals and fills and no cancellations, and real order books have cancellations that depend on queue position, so the geometric shape is a first model, not a description.
Where candidates lose it
Candidates write the balance equations for every state at once and try to solve a system, then run out of time. The cut across a single boundary is the whole method: flow up equals flow down, so each share is a fixed multiple of the one below.
The second loss is answering zero for the empty fraction because orders keep arriving. Fills outpace arrivals, so the queue drains to empty regularly; it is empty exactly the fraction of time the fill process is idle.
What the interviewer asks next
- How long does an order expect to wait from joining to being filled?
- What happens to the average queue if arrivals rise to 2.7 a minute?
- Now orders can also be cancelled at 1 a minute each. How does the chain change?
Asked at DRW, Quantitative Research, New York, 2026 (Wall Street Oasis):
one on birth death chains
