Derivatives Foundation puzzles, solved step by step
- Puzzles
- 100
- Traced to a firm
- 66
- Topics
- 12
- Hard
- 29
038Box A holds 3 red and 1 black ball, box B holds 1 red and 3 black. You pick a box at random and draw a red ball. You then draw again from the same box without replacement. What is the probability the second ball is red?Prop trading firmsMarket making
Try it first
Pick the probability of a second red before you compute.
Show the worked solution
Exactly 1/2. The first red is evidence: box A produces a red with probability 3/4, box B with 1/4, so after seeing red the odds are 3 to 1 for A, a posterior of 3/4. Then update the contents. Box A has 2 red of 3 left, so a second red has probability 2/3; box B has 0 red of 3, probability 0. Average over the updated boxes: 3/4 x 2/3 + 1/4 x 0 = 1/2. Forgetting the update gives 1/3, which is wrong.
Why does the first red change which box you think you hold?
If a friend's cooking is spicy three times out of four and yours one time in four, and a dish picked at random from one of you turns out spicy, you would guess it was your friend's, and you would be right three times in four. The first red ball is the same clue: it comes from box A three times as easily as from box B, so the box you are holding is A with probability 3/4, not 1/2. The arithmetic is Bayes. The weight for A is 1/2 x 3/4 = 3/8, for B it is 1/2 x 1/4 = 1/8, and A's share of the total 1/2 is 3/4. The question is built so that candidates who skip this update get a clean wrong answer.
After a red first draw the box is A with posterior 3/4 and B with 1/4, box A has 2 red of 3 left and box B none, so the chance of a second red is 3/4 x 2/3 plus 1/4 x 0, which is exactly one half. What has to be updated besides the belief about the box?
The box itself. One red ball has left it. Box A now holds 2 red and 1 black, so a red is 2/3; box B now holds 0 red and 3 black, so a red is impossible. Both updates matter and they pull in opposite directions: believing more in A pushes the answer up, removing a red from A pushes it down, and here they land on exactly 1/2. Say that out loud, then check it by counting. Imagine 8 rounds, 4 with each box. Box A yields a first red in 3 of its 4 rounds and box B in 1 of its 4: four red first draws in all. In the three from A the second draw is red 2/3 of the time, 2 rounds; in the one from B, never. Two of four is 1/2.
The relationshipR1, R2 the first and second draws are red P(A | R1) the posterior that the box is A after one red, 3/4 P(R2 | A, R1) a second red from box A with one red already gone, 2/3 What it says in wordsWeight each box's chance of a second red by how likely that box is after the first red.How do the variants separate candidates who understand from those who memorised?
Put the first ball back and the box contents do not change but the belief still does: 3/4 x 3/4 + 1/4 x 1/4 = 5/8, which is above 1/2 because the posterior leans to A and A stays rich in red. Forget the belief update and keep the contents update, and you get 1/2 x 2/3 + 1/2 x 0 = 1/3. The gap between 1/3, 1/2 and 5/8 is the whole lesson: the first draw tells you about the box and changes the box, and you need both. If a second red does appear, the posterior for A becomes 1, since B has no reds left, and a third red is then 1/2. The limitation is the usual one for Bayes: the 1/2 prior for each box is given here, and in a trading setting the prior is the thing you are least sure of.
Where candidates lose it
The common loss is 1/3: keeping the 1/2 prior on each box and only updating the contents. The first red is evidence about the box, and leaving it out throws away half the information in the question.
The second is 2/3: updating to box A and then forgetting that B is still possible with probability 1/4, or forgetting that A has lost a red. Carry both boxes through to the end, then average.
What the interviewer asks next
- The first ball is put back before the second draw. What is the probability now?
- The second ball is also red. What is the probability the box is A, and that a third draw is red?
- Box B held 0 red and 4 black instead. What changes, and what is the answer?
- A trader sees one winning trade from a new signal. What is the analogue of the box update?
064A bag holds 9 fair coins and 1 coin with heads on both sides. You pull one out at random and flip it 5 times, getting 5 heads. What is the probability it is the two-headed coin, and what is the probability the next flip is heads?Quant tradingHedge funds
Try it first
Five heads in a row from a coin that is two-headed one time in ten. How likely is it the two-headed one?
Show the worked solution
78.0% that it is the two-headed coin, and 89.0% that the next flip is heads. Prior odds are 1 to 9. The two-headed coin gives a head with certainty and a fair coin with chance 1/2, so each head multiplies the odds by 2; after five heads the odds are 32 to 9, which is 32/41. The next flip is heads with chance 32/41 x 1 + 9/41 x 1/2 = 73/82.
Why work in odds rather than probabilities?
A doctor who sees the same symptom five mornings running does not recompute the whole diagnosis each day; each new observation multiplies the odds of the condition by one fixed factor. In odds form, Bayes' rule is a multiplication: posterior odds equal prior odds times the likelihood ratio of each observation, and here every head has the same ratio of 1 to 1/2, which is 2. So the odds on the two-headed coin go 1:9, 2:9, 4:9, 8:9, 16:9, 32:9. Convert at the end: 32 divided by 32 plus 9 is 32/41. Doing it in probabilities means dividing by a different normaliser five times, which is where people slip.
Each head doubles the odds on the two-headed coin, lifting the probability from 10% to 78% after five heads, and the chance the next flip is heads, 89%, mixes a certain head from the two-headed coin with a coin flip from a fair one. Why is the next flip not simply 78% heads?
Because the fair coin also produces heads. The next flip is heads if the coin is two-headed, with chance 32/41, or if the coin is fair and lands heads, with chance 9/41 times 1/2, and the two routes add to 73/82, about 89%. Candidates who answer 78% have confused the probability of the hypothesis with the probability of the outcome. The gap between the two is the fair coin's half chance of a head, weighted by the 22% chance you are holding a fair coin.
The relationship1/9 the prior odds of drawing the two-headed coin (1 / (1/2))^5 the likelihood ratio of five heads, two to the fifth 73/82 the chance of a sixth head, mixing both coins What it says in wordsFive heads multiply the prior odds by thirty-two, giving thirty-two to nine, and the next flip mixes a sure head with a fair flip in those proportions.How many heads would it take to be nearly sure, and what does a desk take from this?
Each head doubles the odds, so after 10 heads the odds are 1,024 to 9, about 99.1%, and after 5 you are only at 78%. Evidence that is merely consistent with a hypothesis moves you slowly when the alternative also produces it often, which is why five good months from a new trading strategy prove far less than people feel they do. The limitation is the prior: if the bag held 99 fair coins and one two-headed, five heads would leave you at 32 to 99, still under 25%, and no amount of looking at the flips alone tells you the composition of the bag.
Where candidates lose it
The fast wrong answer is 1 minus 1/32, about 97%, which is the chance a fair coin would not have done this. That number ignores that there are nine fair coins for every two-headed one. Start from the prior odds and double.
The second loss is giving 78% for the next flip. The next flip is a mixture: a certain head from the two-headed coin and a half chance from a fair one.
What the interviewer asks next
- After how many heads does the probability it is the two-headed coin pass 99%?
- The sixth flip is tails. What is the probability it is the two-headed coin now?
- The bag has 99 fair coins and one two-headed coin. What are the two answers after five heads?
- Why is the probability of the next head always between the fair coin's 1/2 and 1?
