Quant puzzles, solved step by step
- Puzzles
- 100
- Traced to a firm
- 71
- Topics
- 12
- Hard
- 30
019A casino flips a fair coin until the first head appears and pays 2 to the power n rupees if that happens on flip n. Its bank holds only 2 to the power 20 rupees, so it pays at most that. What is the fair price of the game?Hudson River TradingNew York · 2020
Try it first
What is the fair price with the bank capped at 2 to the 20 rupees?
Show the worked solution
Rs 21. Flip n pays 2 to the n with probability 1/2 to the n, so each of flips 1 to 20 contributes exactly 1 rupee: 20 rupees. Beyond flip 20 the casino pays its whole bank, 2 to the 20, and the chance of getting that far is 1/2 to the 20, which adds 1 more. The famous infinite value collapses to 21 as soon as the payer's bank is finite.
Why is the uncapped game worth infinity?
Each extra flip halves the chance and doubles the prize, so each flip adds the same 1 rupee to the average, forever. An expected value is a sum over outcomes of prize times chance, and when every term is 1 and there are infinitely many terms, the sum has no limit. That is the St Petersburg paradox, discussed by Daniel Bernoulli in the eighteenth century: the mathematics says pay anything, and nobody would pay more than a modest sum.
Every flip up to the twentieth contributes exactly 1 rupee to the expected value, and the capped payouts beyond it add up to just 1 more, so a casino with a bank of 2 to the 20 rupees offers a game worth Rs 21. What exactly does the cap remove?
Picture a lottery that promises to double your prize every day for ever, run by a shop with a small safe. The later promises are worth nothing because the shop cannot keep them. The cap turns every term after flip 20 from 1 rupee into 2 to the 20 divided by 2 to the n, which is 1/2, 1/4, 1/8 and so on, and those add up to exactly 1. So the tail that made the value infinite is now worth a single rupee. The bank is Rs 10,48,576 and the game is worth Rs 21.
The relationship2^n the payout if the first head arrives on flip n 2^{-n} the chance the first head arrives on flip n 2^{20} the bank, which caps every later payout What it says in wordsTwenty flips worth a rupee each, plus a capped tail worth one rupee.What does this teach about pricing a payoff?
Doubling the bank adds only one rupee to the fair price: a bank of 2 to the 30, about Rs 107 crore, makes the game worth Rs 31. The value grows with the logarithm of what the counterparty can pay, so the realistic price of a lottery-like payoff depends on who stands behind it. The same idea appears in trading as counterparty risk: a contract's promised payout in extreme states is only worth what the other side can deliver in those states.
Where candidates lose it
Candidates recite the St Petersburg paradox and answer infinity, missing the cap in the question. The interviewer has changed one word to see whether you hear it.
The second loss is getting 20 by stopping at the cap and forgetting the tail. Every sequence of 20 tails still pays the full bank, and that last piece is worth exactly one more rupee.
What the interviewer asks next
- How big must the bank be for the game to be worth Rs 50?
- How much would a player with logarithmic utility pay for the uncapped game?
- If you could play the capped game a million times, how would the average payout behave?
Asked at Hudson River Trading, Prop Trading, New York, 2020 (Wall Street Oasis):
Questions on EV for coin tosses, law of large numbers, Bayes theorem
064You may roll a fair die up to three times. After each roll you either stop and are paid the face showing, or roll again; if you reach the third roll you must take it. What is your optimal stopping rule, and what is the game worth?RBC Capital MarketsToronto · 2025
Try it first
On the first roll you see a 4. What do you do?
Show the worked solution
Keep a 5 or 6 on the first roll, a 4, 5 or 6 on the second, and take whatever the third gives; the game is worth 14/3, about 4.67. Work backwards. The last roll is worth 3.5. With two rolls left, keep anything above 3.5: (4 + 5 + 6)/6 + (1/2)(3.5) = 4.25. With three, keep anything above 4.25: (5 + 6)/6 + (2/3)(4.25) = 14/3.
Why start from the last roll?
Think of house hunting with three viewings booked: whether to accept the first flat depends on what the remaining viewings are likely to offer, and you only know that once you know how you would behave at the last one. The value of continuing at any point is defined by what you would do later, so the only roll whose value you know outright is the last one, and every earlier decision is built on it. That is backward induction, and the interviewer wants to hear the words before any numbers.
Solving from the last roll upwards, the third roll is worth 3.5, so the second roll keeps 4, 5 or 6 and is worth 4.25, so the first roll keeps only 5 or 6 and the whole game is worth 14/3, about 4.67. How do the values build up?
On the last roll you take the face, worth 3.5. On the second roll, stop if the face beats 3.5, which means 4, 5 or 6; otherwise you get 3.5 from the last roll. The value is the average of the faces you keep plus the chance you continue times the value of continuing: (4 + 5 + 6)/6 + (3/6)(3.5) = 4.25. On the first roll, the bar to beat is now 4.25, so only 5 and 6 are kept: (5 + 6)/6 + (4/6)(4.25) = 11/6 + 17/6 = 14/3, about 4.667.
The relationshipV_n the value of the game with n rolls still available max(f, V_n) keep the face f if it beats rolling on, otherwise take the value of continuing What it says in wordsEach extra roll is worth the average of the better of the face and the value of carrying on.What does the common shortcut cost, and where does this lead?
The shortcut is to keep anything above the single-roll average of 3.5 at every stage. On the first roll that keeps a 4, which gives 4.625 instead of 4.667. The threshold rises with the number of rolls left, because each spare roll is an option, and an option is worth more the longer it lives. With six rolls the value is 5.27, and with many rolls it approaches 6, since you can wait for a six. The same structure prices an American option: exercise early only when the payoff beats the value of holding on.
Where candidates lose it
The trap is the fixed threshold: stopping on 4 at the first roll because 4 beats 3.5. It ignores that the comparison is with the value of continuing, which is 4.25 with two rolls left, not 3.5.
The second loss is computing forwards, trying to enumerate all paths from the first roll. Say backward induction, solve the last roll, and build up; three lines of arithmetic do the whole job.
What the interviewer asks next
- What is the game worth with four rolls?
- You now pay Rs 1 for each reroll. How does the rule change?
- If you are paid the square of the final face, what is the first-roll rule?
Asked at RBC Capital Markets, Quantitative Trading, Toronto, 2025 (Wall Street Oasis):
Best way to maximize EV across 3 chosen dice rolls (can choose to continue or not).
