Quant puzzles, solved step by step
- Puzzles
- 100
- Traced to a firm
- 71
- Topics
- 12
- Hard
- 30
071We play a matching game: each of us shows heads or tails at the same moment. If both show heads I pay you 3; if both show tails I pay you 1; if we mismatch you pay me 2. What mix should I use to make you indifferent, what mix should you use, and what is the game worth to you per round?Quant tradingQuant research
Try it first
What is the game worth to you per round?
Show the worked solution
I show heads 3/8 of the time; so should you; and the game is worth -1/8 to you per round. At my mix q, your heads pays 3q - 2(1 - q) and your tails pays -2q + (1 - q). Setting them equal gives q = 3/8, where both pay -1/8. By the same algebra your 3/8 mix makes my choices equal, so neither of us can improve: the table looks fair and is not.
Why do I randomise to make you indifferent, not to help myself?
Think of a penalty taker and a goalkeeper. If the taker shoots left more often than he should, the keeper dives left and gains; any pattern is exploited. In a zero-sum game, the mix that protects you is the one that leaves your opponent with nothing to exploit, which means making every one of their choices pay the same. So I do not pick my heads probability by looking at my own payoffs in isolation; I pick it so that your heads and your tails earn you equal amounts. Then it no longer matters what you do.
Your payoff from heads rises and your payoff from tails falls as my heads probability grows; they cross at 3/8, where each pays -1/8, so that is my equalising mix and the most you can secure per round. How do the two equations give 3/8 and -1/8?
Let q be my chance of heads. Your heads earns 3q - 2(1 - q) = 5q - 2 and your tails earns -2q + 1(1 - q) = 1 - 3q, and they are equal when 8q = 3, at q = 3/8. Plug back in: 5(3/8) - 2 = -1/8. For your side, let p be your chance of heads; my payoffs are the negatives of yours, and because the table is symmetric the same algebra gives p = 3/8. At those mixes, each cell's frequency is HH 9/64, TT 25/64 and the two mismatches 15/64 each: 3(9) + 1(25) - 2(30) = -8, over 64, is -1/8.
The relationshipq my probability of showing heads 5q - 2 your expected payoff from showing heads 1 - 3q your expected payoff from showing tails V the value of the game to you per round What it says in wordsMy heads probability is set where your two choices earn the same, and that common amount is what the game is worth to you.Why does a table with equal wins and losses favour me?
Because the cells are not played equally often. Your big win needs both of us on heads, and I can make that cell rare; the mismatches, where I win, happen 30 times in 64 at equilibrium. If I played heads half the time you could earn +1/2 by always showing heads, so a naive 50/50 from me would be a gift. In trading the same idea sets a market maker's quotes: they are placed so that the informed side has no choice that beats the others, not so that the market maker profits on any one trade.
Where candidates lose it
The trap is adding up the table, 3 + 1 against 2 + 2, and calling the game fair. Equilibrium frequencies are not a quarter each, so a table's totals tell you nothing about its value.
The second slip is solving for the mix that maximises your own payoff against a fixed opponent. In a mixed equilibrium each player's mix is pinned down by the other player's payoffs; say that sentence before the algebra.
What the interviewer asks next
- If I play heads half the time, what should you do and what do you earn?
- What payoff for both tails would make the game fair?
- How does the answer change if the mismatch payment is 3 instead of 2?
081A six-chamber revolver holds two bullets in adjacent chambers. The cylinder is spun, the interviewer pulls the trigger on himself and it clicks on an empty chamber. It is now your turn. Do you want him to spin the cylinder again first, or pull straight away?SchonfeldCentral · 2022
Try it first
Which gives you the better chance of surviving?
Show the worked solution
Do not spin: pulling straight away survives with probability 3/4, against 2/3 with a spin. The click tells you the hammer sat on one of the four empty chambers. Because the two bullets are adjacent, the four empties form a run, and only the last empty in that run is followed by a bullet. A spin throws that information away and resets you to 4 empties out of 6.
What does the click actually tell you?
Think of a row of six houses where two neighbours keep dogs. You knocked at a random house and no dog barked. If you now try the next house along, you are only in trouble if you had knocked on the one house sitting just before the dogs. The click narrows the hammer's position to the four empty chambers, and the question becomes how many of those four have a bullet immediately after them. With the bullets side by side, the empties run 3, 4, 5, 6 in firing order, and only chamber 6 hands over to a bullet.
With two adjacent bullets, only one of the four empty chambers is followed by a bullet, so pulling straight away after a click survives 75% of the time, while a fresh spin survives only 66.7%, four empties out of six. The relationshipempties followed by an empty chambers 3, 4 and 5 in firing order 4/6 the survival chance of a fresh, random chamber What it says in wordsWithout a spin you are conditioning on the click, which helps; a spin forgets it.Does the answer depend on the bullets being adjacent?
Completely, and that is the follow-up most interviewers ask. If the two bullets are not next to each other, the empties split into two runs, two empties now sit in front of a bullet, and pulling straight away survives only 1/2, worse than the 2/3 of a spin. The same count works for bullets one apart or directly opposite: in both cases two of the four empties are followed by a bullet. So the rule is not spin or do not spin; it is count the empties that border a bullet and compare with a fresh spin.
What is the general lesson for a trading interview?
A random reset destroys information, and information has value only if the structure of the problem lets you use it. Here the structure is clustering: the bullets sit together, so a safe chamber is likely followed by another safe one. Markets have the same feature in volatility: a calm day tends to be followed by a calm day, so conditioning on what just happened beats assuming each day is a fresh draw. Say that link in one line after the arithmetic.
Where candidates lose it
The common error is to treat both options as a fresh draw and say it makes no difference, or to say a spin is safer because it resets the odds. Both ignore the click, which is the one piece of information you were given.
The second loss is getting 3/4 without seeing that it hinges on adjacency. Say that with the bullets apart the answer flips to spin, and give the count, two bordering empties out of four.
What the interviewer asks next
- The two bullets are placed in random chambers, not necessarily adjacent. Spin or not?
- Three adjacent bullets and a click. Spin or not?
- After two clicks in a row without spins, what is your survival chance on the third pull?
Asked at Schonfeld, Quantitative Research, Central, 2022 (Wall Street Oasis):
Coding, requires to know DP and divde and conquer., Russian Roulette
093Three dice: red has faces 2, 6 and 7; green has 1, 5 and 12; blue has 3, 4 and 8, each face appearing twice. You and I each pick a die and roll once, and the higher number wins. Which die do you want, and does it matter who picks first?Belvedere TradingChicago · 2022
Try it first
Which die is best against the other two?
Show the worked solution
No die is best: red beats green, green beats blue and blue beats red, each with probability 5/9. So who picks first matters a great deal. Let me choose, then take the die that beats mine and win 5/9 of the time. If you are forced to pick first, every choice loses 5/9 of the time against an opponent who knows the cycle.
How do you work out who beats whom?
Each matchup has only nine equally likely pairs of faces, so write the 3 by 3 grid and count. Red against green: red's 2 beats only the 1, while its 6 and 7 each beat the 1 and the 5, for 1 + 2 + 2 = 5 wins out of 9. Do the same for the other two pairs and every matchup comes out 5 to 4: red over green, green over blue, blue over red. It is rock, paper, scissors built out of dice, and in rock, paper, scissors nobody asks which hand shape is best.
Counting the nine face pairs in each matchup shows red beats green, green beats blue and blue beats red, each in 5 of 9 cases, so the three dice form a cycle and the second player can always pick a die that wins 5/9 of the time. The relationshipP(R > G) the chance red's roll beats green's 1 + 2 + 2 the wins for red's faces 2, 6 and 7 in turn What it says in wordsCount, face by face, how many of the opponent's three faces each face beats, and divide by nine.Why does green lose to red when green has the higher average?
The averages are red 5, green 6 and blue 5. Winning is about how often, not by how much. Green's 12 wins every time it shows, but it shows only a third of the time, and green's other two faces, 1 and 5, lose to both of red's high faces. A higher mean and a higher chance of winning are different things, and the gap between them is the whole puzzle. Change the rules so the winner collects the difference between the two numbers, and green's expected margin against red is 6 - 5 = +1: now you want green against red, and blue against red is a dead heat at 0.
Where does a trader meet the same thing?
Head-to-head comparisons need not line up into a ranking. Strategy A can beat strategy B on more days than not, B can beat C, and C can beat A, whenever one of them earns its money in rare large wins, as green does. Before choosing between strategies, decide whether you care about how often you win or how much you make, because under the first a cycle like this one means there may be no best choice at all. The limitation of the puzzle is that it is one roll; over many rolls with the total score counted, the mean matters more and green's 12 starts to pay.
Where candidates lose it
The common slip is choosing green because its average, 6, is highest. The game pays for winning, not for margin, and green loses to red five times in nine.
The second loss is answering the first question and missing the second. Because the dice form a cycle, the real answer is strategic: insist that your opponent picks first. Saying that unprompted is what the interviewer is listening for.
What the interviewer asks next
- If each player rolls their die twice and adds the results, does the cycle still hold?
- Design three dice whose faces sum to the same total and still form a cycle.
- With three players each taking one die, can any die be favoured against both others?
Asked at Belvedere Trading, Prop Trading, Chicago, 2022 (Wall Street Oasis):
You have 3 dice: red has 2, 6, 7; green has 1, 5, 12; blue has 3, 4, 8.
