Derivatives Foundation puzzles, solved step by step
- Puzzles
- 100
- Traced to a firm
- 66
- Topics
- 12
- Hard
- 29
019You roll a fair die again and again until the first six appears. What is the expected total of all the numbers rolled, including the final six?Jane StreetNew York · 2026
Try it first
Commit to a number first: the expected total, six included, is
Show the worked solution
21. A six comes up one time in six, so you expect six rolls, and each roll averages 3.5; by Wald's identity the expected total is 6 x 3.5 = 21. From the other side: the five expected rolls before the six can only be 1 to 5, so each averages 3, giving 15, and the closing six makes 21. The tempting 5 x 3.5 + 6 = 23.5 forgets that the earlier rolls cannot be sixes.
Why is 23.5 wrong when every roll averages 3.5?
Count people walking through a door until the first one in a red shirt arrives. The people before that one are, by the way you counted, not in red; nobody would estimate their shirts from the whole crowd. Conditioning on a roll not being a six changes its average from 3.5 to 3, and every roll before the stopping roll carries that condition. So the honest split is five expected rolls at 3 each, which is 15, plus the six that ends the game. The slip to 23.5 counts the sixes twice: once in the 3.5 of the earlier rolls, and again as the final roll.
The five expected rolls before the first six can only show 1 to 5, so they average 3 and total 15, and with the closing six the expected total is 21, the same as six expected rolls at 3.5 each, while the tempting 23.5 wrongly lets the earlier rolls average 3.5; a seeded simulation of 200,000 games gives 20.92. Why does 6 x 3.5 still give the right answer?
Because of Wald's identity, and it is worth naming in the room. If the decision to stop depends only on rolls you have already seen, the expected total equals the expected number of rolls times the average roll. Before any roll is made, each one is a fresh die with average 3.5; the stopping rule only decides how many of them you take, and it cannot peek ahead. The two routes agree because the missing sixes in the early rolls are exactly balanced by the guaranteed six at the end. A one-line check also works: the first roll averages 3.5, and five times in six the game restarts.
The relationshipS the total of all rolls, six included N the number of rolls until the first six, with E[N] = 6 X one roll of the die, with E[X] = 3.5 5/6 the chance the first roll is not a six and the game starts afresh What it says in wordsConditioning on the first roll gives the same 21 as multiplying the expected number of rolls by the average roll.Where does this reasoning show up on a desk?
Any rule of the form trade until something happens. A rule such as take profit once up 2% cannot change the expected P&L of a fair bet, for the same reason: a stopping rule that only looks backwards changes when you stop, not the average of what you collect per step. The limitation to state is that Wald needs the expected number of steps to be finite; a rule like keep going until you are ahead can break it. A sharp follow-up the interviewer may use: given that every roll was even, what is the expected number of rolls? The answer is 1.5, not 3, and the same conditioning idea explains it.
Where candidates lose it
The common answer is 23.5: five rolls at the familiar 3.5, plus the six. It sounds careful because it treats the last roll separately, and it is wrong because the earlier rolls are conditioned on not being sixes.
The second loss is getting 21 from 6 x 3.5 and not being able to say why it is allowed. The interviewer will push: the number of rolls depends on the rolls, so why can you multiply? The answer is that the stop depends only on the past, which is Wald's identity.
What the interviewer asks next
- Given that every roll in the game was even, what is the expected number of rolls?
- What is the expected total if you stop at the first roll of 5 or 6, counting that roll?
- You are paid the total but must pay Rs 4 per roll. Would you play, and at what cost per roll is the game fair?
Asked at Jane Street, Investment Operations, New York, 2026 (Wall Street Oasis):
First interview was testing simple math brainteasers (e.g. expected value of dice throws, etc.)
029A point is dropped uniformly at random inside a unit square. What is the expected distance from the point to the nearest edge?Hudson River TradingNew York · 2024
Try it first
Pick the expected distance before you integrate.
Show the worked solution
One sixth. The distance to the nearest edge exceeds t only when the point lands inside the inner square of side 1 minus 2t, which has area (1 - 2t)^2. The expected value of a non-negative quantity is the integral of its tail probability, so E[D] is the integral of (1 - 2t)^2 from 0 to 1/2, which is 1/6, about 0.167. One axis alone would give 1/4; the second axis trims it.
Why work with the chance of being further than t, rather than the distance itself?
Suppose you want the average waiting time at a counter, and the only thing you can observe is, for each t, the fraction of people still waiting after t minutes. That is enough: add up the survival fractions over all t and you have the average wait. For any non-negative quantity, the expected value equals the area under its tail curve, and here the tail curve is easy to see: the point is further than t from every edge exactly when it lands inside the inner square of side 1 minus 2t. That inner square has area (1 - 2t)^2, and it shrinks to nothing at t equal one half, the centre of the square. Writing the density of the minimum of four dependent distances directly is far messier.
A random point is further than t from every edge only when it lands in the inner square of side 1 minus 2t, so the tail probability is (1 - 2t)^2, and the area under that curve from 0 to 1/2 is the expected distance of one sixth, confirmed by a 0.1667 Monte Carlo estimate. How does the integral come out to exactly 1/6?
Substitute u = 1 - 2t. As t runs from 0 to 1/2, u runs from 1 down to 0, and dt is minus du over 2. The integral becomes one half of the integral of u squared from 0 to 1, which is one half times one third. The answer is 1/6 because a squared tail integrates to a third and the half-width of the square halves it again. A sanity check: the median distance is where (1 - 2t)^2 equals a half, which is t = 0.146, a little below the mean, as you expect for a distribution with a long right tail reaching 0.5.
The relationshipD the distance from the point to the nearest edge (1 - 2t)^2 the area of the inner square where every edge is further than t away u the side of that inner square, 1 - 2t What it says in wordsThe expected distance is the area under the tail curve, and the tail curve is the area of a shrinking inner square.What is the fast cross-check that shows you understand the structure?
Do one axis first. The distance to the nearer of the left and right edges is min(x, 1 - x), a triangle-shaped quantity with mean 0.25. The nearest edge of the square is the smaller of two such independent quantities, one per axis, and taking the smaller of two pulls the mean down from 1/4 to 1/6. Say 1/4 for one axis, then 1/6 for two, and the interviewer hears that you see the minimum of independent pieces rather than a formula. The same structure gives 1/8 for a unit cube, where the tail is (1 - 2t)^3, and it shows the limitation of the method: it works because the inner region stays the same shape as it shrinks, which fails for a disc, where the nearest point on the boundary is not along an axis.
Where candidates lose it
The common loss is answering 1/4, the one-axis answer, forgetting that the nearest of four edges is smaller on average than the nearest of two. The second axis is independent and matters.
The other is trying to write the density of the minimum directly and running out of time. The tail curve is one line, (1 - 2t)^2, and the expected value is its integral. Learn that identity; it solves half the expected value questions a desk asks.
What the interviewer asks next
- What is the expected distance to the nearest face for a point dropped in a unit cube?
- What is the expected distance to the nearest edge in a 2 by 1 rectangle?
- What is the expected distance from the point to the centre of the square? Why is that a different kind of integral?
- Two points are dropped. What is the chance that both are further than 0.1 from every edge?
Asked at Hudson River Trading, Campus Algo Dev Interview, New York, 2024 (Wall Street Oasis):
expected value question involving the expected value among distance to an edge, with a randomly placed object
034A card is drawn from a 52-card deck. You may bet Rs 100 at even money on red or on black. How much would you pay to be told first whether the card is a heart?OptiverChicago · 2025
Try it first
What is the tip worth, at most?
Show the worked solution
Up to Rs 50. Without the tip the bet is a coin flip worth zero. With it: one time in four the card is a heart, you bet red and win Rs 100 for certain. Three times in four it is not a heart, which leaves 13 red and 26 black cards, so you bet black and win 100 with probability 2/3 and lose 100 with probability 1/3, an expected Rs 33.33. The average, 25 + 25, is Rs 50, and that is the most the information is worth.
Why is a tip about hearts worth anything for a bet on colour?
A friend who will tell you whether it is raining in one of the four districts of a city is not telling you the weather everywhere, but if you have to bet on whether it rains in the city at all, the tip changes your odds. The heart tip never names the colour, but every heart is red, so a yes makes red certain and a no tilts the remaining deck two to one towards black. Both answers leave you with a bet that has an edge, where before you had none. Information is worth the gap between what you can earn with it and what you could earn without it, and here that gap is the whole value, because without the tip the best you can do is zero.
Without the tip a bet on red or black has an expected value of zero, while with it a heart lets you win Rs 100 for certain and a non-heart lets you bet black at 26 to 13 for an expected Rs 33.33, so the tip is worth a quarter of 100 plus three quarters of 33.33, which is Rs 50. How do you set the calculation out so it cannot go wrong?
Price the decision in each branch, then weight the branches by how likely each answer is. If the answer is yes, probability 13/52, the card is red: bet red, expected gain 100. If the answer is no, probability 39/52, there are 39 cards left of which 13 are red diamonds and 26 are black: bet black, expected gain 100 x 26/39 minus 100 x 13/39, which is 33.33. The value of the tip is the probability-weighted average of the best you can do after each answer, minus the best you could do with no answer at all. That is 1/4 x 100 + 3/4 x 33.33 = 50, minus zero. Pay less than Rs 50 and the deal is in your favour; pay exactly 50 and you are indifferent.
The relationship13/52 the chance the card is a heart 100 a certain win on red once you know it is a heart 26/39, 13/39 the chance of black and of red among the 39 non-hearts 0 the value of the bet with no information What it says in wordsWeight the best decision after each possible answer by the chance of that answer, and subtract what the bet was worth before.What does this have to do with a trading desk?
The question is a small model of paying for data. Being told the colour outright would be worth Rs 100, the full value of perfect information; the heart tip, which answers a narrower question, is worth exactly half of that. A piece of information is worth what it changes in your best decision, not how interesting it sounds: a tip that the card is an ace would be worth nothing here, because it leaves red and black at even money. The limitation to say out loud is that the Rs 50 is an expected value: on any single hand you could pay 50 and lose 100, so a desk with a limited bankroll should pay less than the full value, by the same logic that sizes bets below the edge.
Where candidates lose it
The common loss is answering 25 by reasoning that hearts are a quarter of the deck, so the tip is right a quarter of the time. The tip is informative in both of its answers: a no still tilts the deck two to one.
The second is pricing only the yes branch and forgetting to re-count the deck after a no. Thirty-nine cards remain, thirteen of them red, and that recount is where the second Rs 25 lives.
What the interviewer asks next
- How much is it worth to be told whether the card is an ace?
- How much is it worth to be told whether the card is a face card or a heart?
- You can bet Rs 100 on the suit at 3 to 1 instead. What is the heart tip worth now?
- Why should a desk with a small bankroll pay less than Rs 50 for this tip?
Asked at Optiver, Quantitative Research, Chicago, 2025 (Wall Street Oasis):
Valuing information, taking directional bets when not plus EV.
048You may roll a fair die up to three times, stopping whenever you like, and you are paid the value of the last roll. What is the optimal stopping rule and the value of the game?RBC Capital MarketsToronto · 2025
Try it first
On the first roll you get a 4. Do you stop?
Show the worked solution
Stop on 5 or 6 on the first roll, on 4 or more on the second, and take the third; the game is worth 14/3, about 4.67. Work backwards. One roll left is worth 3.5. With two left, keep anything above 3.5, so 4, 5 or 6, which makes the game worth 15/6 + 3/6 x 3.5 = 4.25. With three left, keep anything above 4.25, so 5 or 6, which gives 11/6 + 4/6 x 4.25 = 14/3.
Why start from the last roll?
If you are flat-hunting and can see three flats, one a week, you take the first only if it beats what you expect from the remaining two, and you can only know that by thinking about the last week first. Every stop-or-continue decision compares the number in hand with the value of continuing, and the value of continuing is only known once you have solved the rounds after it, so you solve from the end. With one roll left there is no choice: you take whatever comes, worth 3.5 on average. That number becomes the bar for the roll before it, and the value of that roll becomes the bar for the one before that.
Read from right to left, the last roll is worth 3.5, so with two rolls left you keep 4 or more and the game is worth 4.25, so with three rolls left you keep only 5 or 6 and the game is worth 14/3, about 4.67. How do the two thresholds come out?
With two rolls left, you keep the first of them if it beats 3.5, so 4, 5 or 6 are kept, each with probability 1/6, and on 1, 2 or 3 you roll once more for 3.5. The value is (4 + 5 + 6)/6 + (3/6) x 3.5 = 2.5 + 1.75 = 4.25. With three rolls left, the bar rises to 4.25, so a 4 is no longer good enough: keep only 5 or 6, and the value is (5 + 6)/6 + (4/6) x 4.25 = 11/6 + 17/6 = 14/3. The thresholds rise as more rolls remain, because the option to keep rolling is worth more when there are more chances left. Notice that the threshold is a value, not a face: you keep a face only if it is strictly greater than the value of carrying on.
The relationshipV n the value of the game with n rolls left, played optimally max(f, V n-1) on rolling face f you keep it or carry on, whichever is worth more the sum over f the average over the six equally likely faces What it says in wordsThe value with n rolls left is the average, over the faces, of the better of keeping the face and rolling on.What do the follow-ups test?
They test whether you can re-run the recursion. With more rolls the value climbs towards 6 but slowly: 4 rolls give 4.944, 6 give 5.275, 10 give 5.650. A cost per roll lowers each continuation value and drops the thresholds. Keeping a 4 on the first roll costs you: that rule is worth 4.625 against 4.667, a small gap that an interviewer will still ask you to explain. A simulation of 300,000 games of the optimal rule gives 4.666. The desk link is direct: an American option is a stopping problem of exactly this shape, exercise when the value in hand beats the value of holding on, and a binomial tree solves it by the same backward pass.
Where candidates lose it
The common loss is keeping a 4 on the first roll because it beats 3.5. The right comparison is with the value of continuing, which with two rolls left is 4.25, not 3.5.
The second is solving forwards, trying to guess the first-roll threshold before knowing what the later rolls are worth. Say the last roll is worth 3.5, then build up; the answer arrives in two lines.
What the interviewer asks next
- What is the game worth with four rolls, and what are the thresholds?
- Each roll after the first costs 0.25. How do the thresholds change?
- You are paid the square of the final roll. Does the stopping rule change?
- How is this related to exercising an American option?
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).
073You roll a die and are paid the face value in rupees, but you may reject the first roll and roll once more, taking whatever the second roll shows. When should you reroll, and what is the game worth? Now the reroll costs Rs 1. What changes?Wolverine TradingChicago · 2016Old Mission CapitalNew York · 2018
Try it first
Free reroll. What is the game worth?
Show the worked solution
Reroll any 1, 2 or 3; keep a 4, 5 or 6; the game is worth 4.25. With a Rs 1 fee, keep a 3 as well and the value falls to 3.83. A fresh roll is worth 3.5, so you reroll only faces below it. The value is (4 + 5 + 6)/6 + (3/6) x 3.5 = 4.25. With the fee, a fresh roll nets 2.5, so a 3 is now worth keeping, and the value is (3 + 4 + 5 + 6)/6 + (2/6) x 2.5 = 23/6.
Why is the threshold the value of a fresh roll?
You are offered a mango from a basket; you can keep the one in your hand or swap it blind for another. You swap only if the one you hold is worse than the average mango. The reroll replaces a known face with the average of an unknown one, so you take it exactly when the face you hold is below that average, which is 3.5 for a fair die. Faces 1, 2 and 3 are below, so reroll them; 4, 5 and 6 are above, so keep them. There is no face equal to 3.5, so there is no tie to argue about.
With a free reroll you keep 4, 5 or 6 and reroll anything lower, for a value of 4.25; with a Rs 1 fee a fresh roll nets only 2.5, so a 3 is kept too and the value drops to 3.83. How does the fee change the decision and the value?
The fee lowers what a fresh roll is worth, from 3.5 to 2.5, and the threshold moves with it. A 3 was worth rerolling for free, since 3 is below 3.5, but with the fee a 3 beats the 2.5 a reroll now nets, so you keep it, and only a 1 or a 2 is rerolled. The value becomes (3 + 4 + 5 + 6)/6 + (2/6) x 2.5 = 3 + 0.833 = 3.83. Check the alternative: keeping only 4 and above with the fee gives 2.5 + (3/6) x 2.5 = 3.75, which is worse, so the threshold really does move. The fee costs you 0.42 of value in total, less than the Rs 1 charge because you pay it only a third of the time.
The relationshipt the smallest face you keep, one above the value of a fresh roll c the cost of a reroll, zero or one rupee 3.5 - c what a reroll is worth net of its cost What it says in wordsYou keep any face worth more than a reroll, and the value of the game is the kept faces plus the chance of rerolling times the net value of a fresh roll.What is the general pattern a desk is looking for?
Backward induction. Value the last decision first, then use that value as the threshold for the decision before it; with two rerolls the second-stage value of 4.25 becomes the bar for the first roll, so you keep only a 5 or a 6 and the game is worth (5 + 6)/6 + (4/6) x 4.25 = 4.67. This is how an American option is priced on a tree, with exercise now compared against the continuation value. The limitation is that the puzzle has a known distribution; real stopping problems have to estimate the continuation value, and a wrong estimate moves the threshold.
Where candidates lose it
Candidates say the game is worth 3.5 because a die averages 3.5. The reroll is an option, exercised only when it helps, and options are worth something. Say the threshold, then the value.
With the fee, the loss is keeping the same threshold and only subtracting the cost. The threshold moves: a 3 is now kept. Compute both ways if you are unsure and pick the higher.
What the interviewer asks next
- You get two rerolls instead of one, both free. Threshold and value?
- The reroll costs Rs 2. Does the threshold move again, and what is the game worth?
- How much would you pay for the right to one free reroll?
- How does this relate to the exercise decision on an American option?
Asked at Wolverine Trading, Prop Trading, Chicago, 2016 (Wall Street Oasis):
If you had to roll a dice and then roll another, what would be the value I would need in order to roll another dice?
Asked at Old Mission Capital, Finance, New York, 2018 (Wall Street Oasis):What is the expected value of rolling a fair dice? What if you can re-roll? What if the re-roll cost 1 dollar
096A game flips a fair coin until the first tail and pays Rs 2^n if the first tail comes on flip n, but the house can pay at most Rs 1,024. What is the fair price, and why does the uncapped game break the idea of a fair price?Market makingProp trading firms
Try it first
How much does each possible flip contribute to the expected payout, below the cap?
Show the worked solution
Rs 11. A first tail on flip n pays 2^n with probability 1/2^n, so each of flips 1 to 10 contributes exactly Rs 1, Rs 10 in all. Reaching flip 11 or later has probability 1/1,024 and pays the cap of Rs 1,024, adding one more rupee. Without the cap every flip keeps adding Rs 1 and the expected value is infinite, yet nobody would pay much to play, which shows expected value alone cannot price a bet on outcomes the payer cannot honour.
Why does every flip add exactly one rupee?
Think of a raffle where each ticket in the next bundle is half as likely to win but the prize is twice as large. Every bundle is worth the same to you. Here the first tail on flip 1 pays Rs 2 half the time, on flip 2 pays Rs 4 a quarter of the time, on flip 3 pays Rs 8 an eighth of the time. The payout doubles exactly as the probability halves, so each flip contributes 2^n x 1/2^n = Rs 1 to the expected value, and the fair price is simply the number of flips before the cap bites, plus the capped tail. Ten flips reach Rs 1,024; anything later is paid at the cap, worth 1,024 x 1/1,024 = Rs 1.
Each flip from 1 to 10 contributes payout times probability of exactly Rs 1, and reaching flip 11 or later adds the capped Rs 1,024 times a 1 in 1,024 chance, another Rs 1, for a fair price of Rs 11, while without the cap the Rs 1 contributions would carry on forever. What goes wrong without the cap?
Remove the cap and the sum is 1 + 1 + 1 + ... with no end, an infinite expected value. Yet the game pays Rs 8 or less seven times in eight, and more than Rs 11 only one time in eight. The infinite value lives entirely in outcomes so rare and so large that no house could pay them, so the cap is not a detail; it is the price. Raising the cap barely moves it: a cap of Rs 1 crore makes the game worth only about Rs 24.19, because each doubling of the cap adds one rupee. That is the market maker's answer to the paradox: price what the counterparty can actually pay.
The relationship2^n the payout if the first tail comes on flip n 1/2^n the chance the first tail comes on flip n 1/1024 the chance the first ten flips are all heads What it says in wordsTen rupees from the flips the cap does not touch, and one more from the capped tail.Mention the other classic resolution, then put it in its place. Economists answer the paradox with diminishing utility: a doubling of wealth is worth less to you than the first rupee, so a risk-averse player pays little. True, but on a desk the binding constraint is usually the counterparty's balance sheet, not your utility. The limitation of the Rs 11 is the same as any fair value: it is an average over many plays. Played once, the price feels steep because 87.5% of the time you get Rs 8 or less.
Where candidates lose it
The common loss is computing an infinite expected value and stopping there, or saying the cap makes the game worth Rs 1,024. The cap removes the infinity but adds only one rupee for the capped tail.
The second loss is getting the boundary wrong: counting 11 flips below the cap, or forgetting the capped tail entirely and saying Rs 10. Write the n = 10 payout, Rs 1,024, next to the cap and the count is obvious.
What the interviewer asks next
- What is the fair price if the house can pay at most Rs 1 crore?
- What is the median payout of the uncapped game?
- Make me a market on this capped game, and say which side you would rather be on if the house's credit were in doubt.

