Quant puzzles, solved step by step
- Puzzles
- 100
- Traced to a firm
- 71
- Topics
- 12
- Hard
- 30
003Speed round, ninety seconds: you draw three cards from a well-shuffled 52-card deck without replacement. What is the probability that all three are of different suits?Quant tradingProp trading firms
Try it first
Closest answer, fast.
Show the worked solution
About 39.8%. The first card can be anything. The second must come from one of the three other suits: 39 of the 51 cards left. The third must avoid both suits already seen: 26 of the 50 left. Multiply: 39/51 x 26/50 = 1,014/2,550, just under 40%. Drawing with replacement would give 3/4 x 1/2 = 37.5%.
Why does the first card cost nothing?
Picture three guests arriving at a party with four dress colours in the wardrobe, and you want no two to match. The first guest cannot clash with anyone. A condition about the cards differing only bites from the second card on, so the first card contributes a factor of 1 and you start counting from card two. Candidates who write 13/52 for the first card have fixed a particular suit and then have to multiply by the number of suit orders to recover, which is where the slips happen.
The first card is free, the second must avoid one used suit with 39 of 51 cards still good, and the third must avoid two with 26 of 50 still good, so three different suits happen with probability 39.8%. How do you check it a second way in the time?
Count unordered hands. Choose which three suits appear, 4 ways, then one card from each, 13 cubed, and divide by all three-card hands, 52 choose 3. That is 4 x 2,197 = 8,788 over 22,100, which is the same 0.3976. In a speed round you do not have time for both, but knowing the counting route exists lets you sanity-check the product: 0.765 x 0.52 is a little under 0.40.
The relationship39/51 cards of a new suit among those left after one draw 26/50 cards of a third suit after two draws \binom{52}{3} the number of possible three-card hands What it says in wordsSequential dodging and direct counting give the same 39.8%.What is a speed round actually testing?
Thirty questions in forty-five minutes cannot all be worked in full. The skill being tested is choosing the shortest correct route and estimating the product well enough to pick from the options. Here, 39/51 is about 0.76 and 26/50 is 0.52; 0.76 x 0.52 is about 0.40, which eliminates every other option before you finish the exact fraction.
Where candidates lose it
The fast wrong answer is 37.5%, from treating the draws as if cards go back in the deck. It feels close enough, and in a multiple choice round it sits right next to the correct option on purpose.
The other slip is starting with 13/52 for the first card, which silently fixes that card's suit. You then need to multiply by 4 for the suit choice, and under time pressure most people forget.
What the interviewer asks next
- What is the probability that four cards are all of different suits?
- What is the probability that three cards share a suit?
- Draw until you have seen all four suits. What is the expected number of cards?
033There are 21 matches on the table. Two players alternate taking 1, 2 or 3 matches, and whoever takes the last match loses. Would you rather go first or second, and what is your strategy?Quant tradingProp trading firms
Try it first
First or second?
Show the worked solution
Go second. The player facing 1, 5, 9, 13, 17 or 21 matches loses against good play, and 21 is on that list. Whatever your opponent takes, take 4 minus that, so every round removes exactly 4. They then face 17, 13, 9, 5 and finally 1, and are forced to take the last match.
How do you find the losing positions?
Start from the end of the game, the way you would plan the last few stops of a journey before the first. With 1 match in front of you, you must take it and lose. With 2, 3 or 4, you take enough to leave exactly 1 and win. With 5, every move leaves 2, 3 or 4, each a winning spot for the other player, so 5 loses. A position is losing when every move from it hands your opponent a winning position, and here that happens every 4 matches: 1, 5, 9, 13, 17, 21.
Counting down from 21, the positions 21, 17, 13, 9, 5 and 1 lose for the player about to move; moving second and answering each take of k with 4 minus k keeps the opponent on those positions until they must take the last match. Why does answering with 4 minus k always work?
Your opponent can take 1, 2 or 3; you can always take 3, 2 or 1 in reply. The pair of moves removes exactly 4 matches whatever they chose, so you control the count at the end of every round. From 21 the rounds end at 17, 13, 9 and 5, and then your opponent faces a single match. The number 4 is the maximum take plus one; that is where the period comes from.
A short check you can say aloud: the game has only 21 positions, and marking each as winning or losing from the bottom up, a position wins if any move reaches a losing one, reproduces the list 1, 5, 9, 13, 17, 21. If the pile had been 20, you would go first and take 3 to leave 17. This type of game has a backward inductionSolving a game by working out the best move at the last step first, then the step before, back to the start. solution, and the interviewer mainly wants to hear you build it from the end.
Where candidates lose it
The usual loss is playing forward: taking a few matches and hoping to spot the pattern mid-game. Under time pressure that becomes guessing. Work back from one match and the period of 4 appears in three steps.
The other slip is copying the rule for the version where taking the last match wins. There the losing spots are multiples of 4, and 21 means you should go first and take 1. Read which way the last match counts before you answer.
What the interviewer asks next
- What if taking the last match wins instead?
- What if each player may take 1 to 4 matches?
- What if there are two piles and you may take any number from one pile?
