Hypergeometric Distribution: Sampling Without Replacement

April 13, 2026

Problem

A standard deck has 13 hearts. Draw 5 cards without replacement. What is P(exactly 2 hearts)? Show the sampling and the full hypergeometric formula.

Explanation

When do we need the hypergeometric distribution?

When you sample without replacement from a finite population split into two categories ("successes" and "failures"), the probability of each draw changes as items are removed. The binomial distribution assumes with-replacement (or equivalently, each trial has the same pp), so it fails here.

The hypergeometric distribution handles this correctly.

The formula

Given:

  • NN = total population size
  • KK = number of successes in the population
  • nn = sample size
  • kk = observed successes

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

The numerator counts: ways to choose kk successes from the KK available, times ways to choose nkn - k failures from the NKN - K available. The denominator is the total number of samples.

Step-by-step solution

Setup: N=52N = 52 cards, K=13K = 13 hearts, n=5n = 5 cards drawn, k=2k = 2 hearts wanted.

Step 1 — Count favorable outcomes (2 hearts, 3 non-hearts):

  • Choose 2 hearts from 13: (132)=13122=78\binom{13}{2} = \dfrac{13 \cdot 12}{2} = 78
  • Choose 3 non-hearts from 39: (393)=3938376=9139\binom{39}{3} = \dfrac{39 \cdot 38 \cdot 37}{6} = 9139
  • Multiply: 789139=712,84278 \cdot 9139 = 712{,}842

Step 2 — Count total outcomes (any 5 cards from 52): (525)=52515049485!=2,598,960\binom{52}{5} = \dfrac{52 \cdot 51 \cdot 50 \cdot 49 \cdot 48}{5!} = 2{,}598{,}960

Step 3 — Divide: P(X=2)=712,8422,598,9600.2743P(X = 2) = \dfrac{712{,}842}{2{,}598{,}960} \approx \boxed{0.2743}

So there's about a 27.4% chance of drawing exactly 2 hearts.

Sanity check

The mean of a hypergeometric is E(X)=nKN=51352=1.25E(X) = n \cdot \dfrac{K}{N} = 5 \cdot \dfrac{13}{52} = 1.25. Since 2 is close to 1.25, a 27% probability is plausible — around the mode of the distribution.

Hypergeometric vs. binomial

  • Hypergeometric (without replacement): the deck shrinks, probabilities shift after each draw.
  • Binomial (with replacement, or infinite population): fixed pp each draw.

When nn is tiny compared to NN, the two agree very closely. For our problem, the binomial approximation with p=13/52=0.25p = 13/52 = 0.25 gives (52)(0.25)2(0.75)30.2637,\binom{5}{2}(0.25)^2(0.75)^3 \approx 0.2637, close to but not equal to the exact hypergeometric answer.

Common mistakes

  • Using the binomial when drawing without replacement. It's almost right for large populations, but it's wrong for small ones like a deck.
  • Mismatching the categories. Keep careful track: KK and kk refer to successes; NKN - K and nkn - k refer to failures.
  • Forgetting (Nn)\binom{N}{n} in the denominator. Only normalizing by NnN^n or leaving it out entirely are common slips.

Try it in the visualization

Sliders for NN, KK, nn, and kk reshape the whole bar chart live. A deck of cards animates the draw, coloring hearts red as they are taken, showing why each subsequent probability changes.

Interactive Visualization

Parameters

52.00
13.00
5.00
2.00
Your turn

Got your own math or physics problem?

Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.

Sign Up Free to Try It30 free visualizations every day
Hypergeometric Distribution: Sampling Without Replacement | MathSpin