Quant Memo
Foundational

Hypergeometric Draws From a Deck

The probability distribution for drawing without replacement from a fixed population — worked out for cards, where every 'how many aces in your hand' question actually lives.

Prerequisites: Counting Poker Hands

If you flip a coin ten times, the number of heads follows the binomial distribution — each flip is independent, so getting a head doesn't change the odds of the next flip. But if you deal five cards from a deck and ask "what's the probability I got exactly two aces," the deck doesn't reset between cards. Every card you draw changes the composition of what's left. That's a different distribution, called the hypergeometric, and it's the one that governs essentially every "how many of a certain kind of card ended up in my hand" question you'll be asked.

The setup

You have a deck of NN cards, of which KK are "special" (say, aces, so K=4K=4), and you draw nn cards without putting any back. The probability of getting exactly kk special cards among your nn draws is

P(X=k)=(Kk)(NKnk)(Nn).P(X = k) = \frac{\binom{K}{k}\binom{N-K}{n-k}}{\binom{N}{n}} .

In plain English: the numerator counts the ways to pick kk aces out of the 4 available and the remaining nkn-k cards out of everything that isn't an ace, and the denominator is the total number of ways to pick any nn cards from the deck at all. It's the same "count the favorable ways, divide by the total ways" combinatorics as any poker-hand question — the hypergeometric distribution is just this ratio written as a formula you can reuse instead of re-deriving each time.

Worked example 1: exactly two aces in a five-card hand

With N=52N=52, K=4K=4 aces, n=5n=5 cards drawn, and k=2k=2:

P(X=2)=(42)(483)(525)=6×17,2962,598,960=103,7762,598,9603.99%.P(X=2) = \frac{\binom{4}{2}\binom{48}{3}}{\binom{52}{5}} = \frac{6 \times 17{,}296}{2{,}598{,}960} = \frac{103{,}776}{2{,}598{,}960} \approx 3.99\% .

So roughly 1 in 25 five-card hands contains exactly two aces. Notice this differs from what a (wrong) binomial approximation would give if you treated each of the 5 draws as an independent 4/524/52 chance — that ignores that the deck shrinks and the ace count changes with each card drawn, and it would overstate how "spread out" the count of aces should be.

Worked example 2: the expected number of aces

A useful shortcut: for a hypergeometric draw, the expected count of special cards is

E[X]=nKN.E[X] = n \cdot \frac{K}{N} .

This matches the intuitive "proportion" answer even though the individual draws aren't independent — linearity of expectation doesn't need independence. For a 5-card hand, E[X]=5×4520.385E[X] = 5 \times \frac{4}{52} \approx 0.385 aces on average. If instead you ask "how many aces do I expect in my hand given I know 3 of the other players already showed no aces in their 15 combined cards," you're really asking a hypergeometric question on a shrunk deck of 5215=3752 - 15 = 37 cards with the same 4 aces still unseen — the same formula applies, just update NN (and possibly KK) to reflect what's already been revealed.

Distribution · binomial
mean 0.4012345outcomes (k) →
mean 0.39std dev 0.60peak at k = 0

Drag nn and pp in the explorer above to see how the shape compares to a true hypergeometric count of aces in a 5-card hand (here approximated with p=4/520.077p = 4/52 \approx 0.077) — for a deck this large relative to the hand size, the binomial approximation is visually close, which is why it's often used as a fast mental shortcut even though the exact answer is hypergeometric.

Draws without replacement from a fixed population of NN items with KK "successes," when you take nn of them, follow the hypergeometric distribution P(X=k)=(Kk)(NKnk)/(Nn)P(X=k) = \binom{K}{k}\binom{N-K}{n-k} / \binom{N}{n}, with expectation nK/Nn K/N that matches simple proportional intuition even though the draws aren't independent.

The classic trap is applying the binomial formula (independent draws, replacement) to a without-replacement card problem. It's often close numerically when nn is small relative to NN, but it's the wrong model, and interviewers will ask you to justify why the deck's shrinking composition doesn't change the expectation but does change the variance and higher-order probabilities.

Related concepts

Practice in interviews

Further reading

  • Ross, A First Course in Probability, ch. 6
ShareTwitterLinkedIn