Hedge Funds puzzles, solved step by step
- Puzzles
- 100
- Traced to a firm
- 38
- Topics
- 14
- Hard
- 30
004A risk system estimates a full covariance matrix for a 50-stock book. How many distinct correlations must it estimate, and how many parameters in total?Quant and systematic fundsProp and quant trading firms
Try it first
Quick: how many distinct correlations are there among 50 stocks?
Show the worked solution
1,225 correlations and 1,275 parameters in all. A covariance matrix is symmetric, so only the cells above the diagonal carry new information: one per pair of stocks, 50 x 49 / 2 = 1,225. The diagonal holds the 50 variances. The count grows with the square of the number of names, which is why large books estimate risk through a handful of factors instead.
Why do you count pairs rather than cells?
In a class of 50, how many handshakes happen if everyone shakes everyone else's hand once? Each person shakes 49 hands, but every handshake has been counted twice, once from each side, so it is 50 x 49 / 2 = 1,225. A correlation is a handshake: it belongs to a pair, and the pair A and B is the same pair as B and A. The diagonal is each stock paired with itself. Its correlation is 1 and needs no estimating, but the diagonal of the covariance matrix holds each stock's variance, which does.
In a 50 by 50 covariance matrix only the 1,225 cells above the diagonal and the 50 on it need estimating, 1,275 parameters in all, against 315 for a five factor model; at 500 names the full matrix needs 125,250, more than a year of daily returns supplies. The relationshipN the number of stocks, here 50 N(N-1)/2 the number of distinct pairs What it says in wordsPairs plus the diagonal gives the full count of numbers a covariance matrix needs.Why does the count become a problem for a big book?
Because it grows with the square of the names. Ten times as many stocks needs about a hundred times as many correlations: 500 names need 124,750 of them plus 500 variances, 125,250 parameters. A year of daily returns on 500 names is 250 x 500 = 125,000 numbers, fewer than the parameters being estimated. With fewer days than stocks the sample matrix is singular: some combinations of positions appear to carry zero risk, and an optimiser will pile into exactly those.
What does a factor model buy you?
A factor model says each stock's return is driven by a few shared drivers, such as the market, its sector and its size, plus noise of its own. With 5 factors, 50 stocks need 250 loadings, 50 specific variances and 15 factor covariances: 315 numbers instead of 1,275. At 500 names it is 3,015 instead of 125,250. The limitation is worth saying: any risk the factors do not name is assumed independent across stocks, and in a crowded unwind that assumption is the first to break.
Where candidates lose it
The quick wrong answer is 2,500, the number of cells. It double counts every pair and treats the diagonal as correlations. The interviewer expects the handshake formula in one breath.
The bigger miss is stopping at the number. The question is really about why nobody estimates this matrix directly for a large book; if you never reach the squared growth and the factor model, you have answered the arithmetic but not the question.
What the interviewer asks next
- How many days of data do you need before the sample covariance matrix of 50 stocks can even be inverted?
- What is shrinkage, and why does it help here?
- How many parameters does a 3-factor model need for 200 stocks?
079Five cards are dealt from a well-shuffled 52-card deck. What is the probability that the hand holds at least one ace?Quant and systematic fundsProp and quant trading firms
Try it first
Which route gets you to the answer fastest and safely?
Show the worked solution
About 34.1%. Count the opposite. A hand with no ace is five cards from the 48 non-aces: 1,712,304 hands out of 2,598,960, or 65.9%. So at least one ace comes up about 34.1% of the time. Adding up exactly one, two, three and four aces reaches the same 886,656 hands, but takes four calculations instead of one.
Why count the hands without an ace?
If someone asks whether at least one of your five friends will be late to dinner, you do not add the chances of exactly one late, exactly two late and so on. You ask the chance that everyone is on time and subtract it from one. At least one is a collection of four separate cases, while none is a single case, so the complement turns four calculations into one.
Deal the cards one at a time. The first card misses the aces with chance 48/52, the second with 47/51, and so on down to 44/48. Multiply the five fractions and you get 0.6588. The same number is C(48,5) over C(52,5), which is 1,712,304 over 2,598,960.
Adding the hands with exactly one, two, three and four aces gives 886,656 of 2,598,960 hands, 34.1%; counting the 1,712,304 hands with no ace and subtracting from one gives the same 34.1% in a single step. The relationshipC(48,5) the number of five-card hands drawn only from the 48 cards that are not aces C(52,5) the number of all possible five-card hands What it says in wordsThe chance of at least one ace is one minus the share of hands that contain none.Why is 5 x 4/52 wrong, and what does it actually measure?
Five times 4/52 is 38.5%, and it sounds reasonable. It adds up the chance that each card is an ace, which counts a hand with two aces twice and a hand with four aces four times. What it really gives is the expected number of aces in the hand, 0.385, which is always at least the chance of seeing one. The two drift further apart as the hand grows: deal fourteen cards and the same method gives more than 100%.
How do you check the answer the long way?
Exactly one ace: 4 ways to pick the ace times C(48,4) = 194,580 for the rest, 778,320 hands. Two aces: 6 x 17,296 = 103,776. Three: 4 x 1,128 = 4,512. Four: 48. The four cases sum to 886,656 hands, 34.1% of 2,598,960, matching the complement. Offer this as the check if there is time, never as the first route.
Where candidates lose it
The common loss is 5 x 4/52, about 38.5%, said quickly and with confidence. It is the expected number of aces, not the probability of at least one, and the interviewer will follow up with fourteen cards, where the same method gives more than 100%.
The second loss is starting on the direct sum and running out of time on the three-ace and four-ace terms. Reach for the complement the moment you hear the words at least one.
What the interviewer asks next
- What is the probability of exactly two aces?
- How many cards must you deal before at least one ace is more likely than not?
- What is the expected number of aces in a five-card hand, and why is it larger than the chance of at least one?
