Skip to content
Family Table Math

Hypergeometric Distribution

Deal 55 cards and count the hearts. Pick a committee of 44 from a club and count the Grade 12s. In both cases, once something is chosen it can’t be chosen again, so the trials are dependent and the binomial formula doesn’t apply. The hypergeometric distribution handles this kind of counting: sampling without replacement.

A random variable XX has a hypergeometric distribution when:

  • you choose nn items without replacement from a population of NN items;
  • aa of the NN items are “successes” and the other N−aN - a are “failures”;
  • XX is the number of successes you choose.

Because nothing is put back, the probability of a success changes from one pick to the next. That’s what makes the trials dependent.

P(X=k)=(ak)(N−an−k)(Nn)P(X = k) = \frac{\dbinom{a}{k} \dbinom{N - a}{n - k}}{\dbinom{N}{n}}

This is just probability with counting:

  • (Nn)\binom{N}{n} counts all the ways to choose nn items from NN (the sample space);
  • (ak)\binom{a}{k} counts the ways to choose kk of the successes;
  • (N−an−k)\binom{N - a}{n - k} counts the ways to choose the remaining n−kn - k items from the failures.

The possible values of kk go from 00 up to nn, but you can’t choose more successes than there are (k≤ak \le a) or more failures than there are (n−k≤N−an - k \le N - a). For impossible values, the formula gives 00.

Technology: a spreadsheet has =HYPGEOM.DIST(k, n, a, N, FALSE) for P(X=k)P(X = k). On a calculator without a hypergeometric function, compute the three combinations with nCr.

E(X)=naNE(X) = \frac{na}{N}

The fraction of successes in the population is aN\tfrac{a}{N}, so in a sample of nn you expect n×aNn \times \tfrac{a}{N} of them. It’s the same idea as E(X)=npE(X) = np for the binomial, with p=aNp = \tfrac{a}{N}.

BinomialHypergeometric
Samplingwith replacement (or independent trials)without replacement
Trialsindependentdependent
Probability of successstays at ppchanges after each pick
Expected valuenpnpnaN\dfrac{na}{N}

Suppose 40%40\% of a population are successes and you choose 55 items. The figure compares the two distributions for a small population and a large one.

Choosing 5 items when 40% of the population are successes. Left: population of 20 with 8 successes; the hypergeometric bar is clearly taller at k = 2 and shorter at k = 0, 4 and 5 than the binomial bars. Right: population of 400 with 160 successes; the two sets of bars are almost identical. 0.0 0.1 0.2 0.3 0.4 0.5 0 1 2 3 4 5 population N = 20 number of successes, k P(X = k) 0.0 0.1 0.2 0.3 0.4 0.5 0 1 2 3 4 5 population N = 400 number of successes, k binomial (with replacement), n = 5, p = 0.4 hypergeometric (without replacement)
Choosing 55 items when 40%40\% of the population are successes. With N=20N = 20 the two distributions differ; with N=400N = 400 they’re nearly identical.

Two things to notice:

  • Both distributions have the same expected value: 5(0.4)=25(0.4) = 2 and 5(8)20=2\tfrac{5(8)}{20} = 2.
  • Without replacement, extreme results (like 00 or 55 successes) are less likely, so the hypergeometric histogram is a bit narrower and taller in the middle.

When the population is large compared with the sample, removing a few items barely changes the probability of success, so the hypergeometric and binomial distributions are almost the same. That’s why surveys of a few hundred people out of millions can be treated as binomial.

A club has 1212 members: 77 in Grade 12 and 55 in Grade 11. A committee of 44 is chosen at random. Let XX be the number of Grade 12 students on the committee. Make the probability distribution, draw a conclusion from its histogram, and find E(X)E(X).

Solution. Here N=12N = 12, a=7a = 7, n=4n = 4, and (124)=495\binom{12}{4} = 495.

P(X=k)=(7k)(54−k)495P(X = k) = \frac{\binom{7}{k} \binom{5}{4 - k}}{495}
kk0011223344
Ways (7k)(54−k)\binom{7}{k}\binom{5}{4 - k}1×5=51 \times 5 = 57×10=707 \times 10 = 7021×10=21021 \times 10 = 21035×5=17535 \times 5 = 17535×1=3535 \times 1 = 35
P(X=k)P(X = k)0.01010.01010.14140.14140.42420.42420.35350.35350.07070.0707

Check: 5+70+210+175+35=4955 + 70 + 210 + 175 + 35 = 495. ✓

The histogram would have its tallest bar at k=2k = 2, with k=3k = 3 close behind. An all-Grade-11 committee (k=0k = 0) is very unlikely: about 1%1\%.

E(X)=naN=4(7)12=73≈2.33E(X) = \frac{na}{N} = \frac{4(7)}{12} = \frac{7}{3} \approx 2.33

Five cards are dealt from a standard deck. Find the probability of exactly 22 hearts.

Solution. N=52N = 52, a=13a = 13 hearts, n=5n = 5, k=2k = 2.

P(X=2)=(132)(393)(525)=78×91392 598 960=712 8422 598 960≈0.2743P(X = 2) = \frac{\binom{13}{2}\binom{39}{3}}{\binom{52}{5}} = \frac{78 \times 9139}{2\,598\,960} = \frac{712\,842}{2\,598\,960} \approx 0.2743

A box of 2020 phone chargers contains 33 defective ones. An inspector tests 44 chargers chosen at random. Find the probability that at least one is defective.

Solution. Use the complement, as with the binomial. N=20N = 20, a=3a = 3, n=4n = 4.

P(X=0)=(30)(174)(204)=23804845=2857P(X = 0) = \frac{\binom{3}{0}\binom{17}{4}}{\binom{20}{4}} = \frac{2380}{4845} = \frac{28}{57} P(X≥1)=1−2857=2957≈0.5088P(X \ge 1) = 1 - \frac{28}{57} = \frac{29}{57} \approx 0.5088

In the figure above, 55 items are chosen from a population that is 40%40\% successes. Find P(X=2)P(X = 2) three ways: binomial, hypergeometric with N=20N = 20 (and a=8a = 8), and hypergeometric with N=400N = 400 (and a=160a = 160).

Solution.

Binomial (with replacement), n=5n = 5, p=0.4p = 0.4:

P(X=2)=(52)(0.4)2(0.6)3=10×0.16×0.216=0.3456P(X = 2) = \binom{5}{2}(0.4)^2(0.6)^3 = 10 \times 0.16 \times 0.216 = 0.3456

Hypergeometric, N=20N = 20:

P(X=2)=(82)(123)(205)=28×22015 504≈0.3973P(X = 2) = \frac{\binom{8}{2}\binom{12}{3}}{\binom{20}{5}} = \frac{28 \times 220}{15\,504} \approx 0.3973

Hypergeometric, N=400N = 400:

P(X=2)=(1602)(2403)(4005)≈0.3478P(X = 2) = \frac{\binom{160}{2}\binom{240}{3}}{\binom{400}{5}} \approx 0.3478

With only 2020 items, sampling without replacement makes a big difference. With 400400 items, the answer is within 0.0030.003 of the binomial.

Using the binomial formula for sampling without replacement. If items aren’t put back and the population is small, the trials are dependent. Use the hypergeometric formula.

Mixing up n and N, or a and k. NN is the population, nn the sample; aa is the number of successes in the population, kk the number in the sample. Write all four down before you start.

Choosing the failures from the wrong group. The second combination is (N−an−k)\binom{N - a}{n - k}: the remaining n−kn - k items come from the N−aN - a failures. Check that the top numbers add to NN and the bottom numbers add to nn.

Forgetting that some values are impossible. With only 33 defective chargers, you can’t find 44. Then (34)=0\binom{3}{4} = 0, so P(X=4)=0P(X = 4) = 0.

Adding many terms for “at least one”. Just like the binomial, use 1−P(X=0)1 - P(X = 0).

1. (Warm-up) Binomial or hypergeometric?

  • (a) XX is the number of girls when 33 students are chosen at random from a class of 2525.
  • (b) XX is the number of 44s in 1010 rolls of a die.
  • (c) XX is the number of red cards when 66 cards are drawn from a deck, replacing each card before the next draw.
Solution

(a) Hypergeometric: students are chosen without replacement from a small class.

(b) Binomial: independent trials with p=16p = \tfrac{1}{6}.

(c) Binomial: with replacement, p=12p = \tfrac{1}{2} every time.

2. (Warm-up) A bag has 66 red and 44 green marbles. Three are drawn without replacement. Find the probability that exactly 22 are red.

SolutionP(X=2)=(62)(41)(103)=15×4120=60120=12P(X = 2) = \frac{\binom{6}{2}\binom{4}{1}}{\binom{10}{3}} = \frac{15 \times 4}{120} = \frac{60}{120} = \frac{1}{2}

3. (Warm-up) A sample of 1010 is chosen without replacement from a population of 5050 that includes 1515 successes. Find the expected number of successes.

SolutionE(X)=naN=10(15)50=3E(X) = \frac{na}{N} = \frac{10(15)}{50} = 3

4. (Core) A science club has 1010 members, 44 of them in Grade 9. Three members are chosen at random to go to a conference. Let XX be the number of Grade 9s chosen. Make the probability distribution of XX and find E(X)E(X).

Solution

N=10N = 10, a=4a = 4, n=3n = 3, and (103)=120\binom{10}{3} = 120.

kk00112233
Ways (4k)(63−k)\binom{4}{k}\binom{6}{3 - k}1×20=201 \times 20 = 204×15=604 \times 15 = 606×6=366 \times 6 = 364×1=44 \times 1 = 4
P(X=k)P(X = k)16≈0.1667\tfrac{1}{6} \approx 0.166712=0.5000\tfrac{1}{2} = 0.5000310=0.3000\tfrac{3}{10} = 0.3000130≈0.0333\tfrac{1}{30} \approx 0.0333

Check: 20+60+36+4=12020 + 60 + 36 + 4 = 120. ✓

E(X)=3(4)10=1.2E(X) = \frac{3(4)}{10} = 1.2

5. (Core) In a lottery, 66 numbers are drawn from 11 to 4949. You pick 66 numbers. Find the probability that exactly 33 of your numbers are drawn.

Solution

Think of the 66 drawn numbers as the “successes” among N=49N = 49. Your 66 picks are the sample.

P(X=3)=(63)(433)(496)=20×12 34113 983 816=246 82013 983 816≈0.0177P(X = 3) = \frac{\binom{6}{3}\binom{43}{3}}{\binom{49}{6}} = \frac{20 \times 12\,341}{13\,983\,816} = \frac{246\,820}{13\,983\,816} \approx 0.0177

6. (Core) A pond has 3030 fish, and 88 of them have been tagged. A biologist catches 55 fish (without putting any back until the end). Find the probability that at least 22 are tagged.

Solution

N=30N = 30, a=8a = 8, n=5n = 5, and (305)=142 506\binom{30}{5} = 142\,506. Use the complement.

P(X=0)=(80)(225)142 506=26 334142 506≈0.1848P(X = 0) = \frac{\binom{8}{0}\binom{22}{5}}{142\,506} = \frac{26\,334}{142\,506} \approx 0.1848P(X=1)=(81)(224)142 506=8×7315142 506=58 520142 506≈0.4106P(X = 1) = \frac{\binom{8}{1}\binom{22}{4}}{142\,506} = \frac{8 \times 7315}{142\,506} = \frac{58\,520}{142\,506} \approx 0.4106P(X≥2)=1−P(X=0)−P(X=1)≈0.4046P(X \ge 2) = 1 - P(X = 0) - P(X = 1) \approx 0.4046

7. (Core) Five cards are drawn from a standard deck. Find the probability of exactly 22 hearts if the cards are drawn with replacement. Compare with Example 2, and explain the difference.

Solution

With replacement, it’s binomial with n=5n = 5, p=1352=0.25p = \tfrac{13}{52} = 0.25:

P(X=2)=(52)(0.25)2(0.75)3=10×0.0625×0.421 875≈0.2637P(X = 2) = \binom{5}{2}(0.25)^2(0.75)^3 = 10 \times 0.0625 \times 0.421\,875 \approx 0.2637

Without replacement (Example 2), it’s about 0.27430.2743. The answers are close because 55 cards is a small part of the 5252-card deck. Without replacement, the results bunch a little more tightly around the expected value (1.251.25 hearts): values close to it, like 11 and 22, become slightly more likely, and extreme values like 00 or 55 become slightly less likely.

8. (Challenge) Thirteen cards are dealt from a standard deck. Find the probability that the hand contains at least one ace.

Solution

N=52N = 52, a=4a = 4 aces, n=13n = 13. Use the complement:

P(X=0)=(40)(4813)(5213)=632720 825≈0.3038P(X = 0) = \frac{\binom{4}{0}\binom{48}{13}}{\binom{52}{13}} = \frac{6327}{20\,825} \approx 0.3038P(X≥1)=1−632720 825=14 49820 825≈0.6962P(X \ge 1) = 1 - \frac{6327}{20\,825} = \frac{14\,498}{20\,825} \approx 0.6962

9. (Challenge) To estimate the number of fish in a lake, biologists catch, tag, and release 4040 fish. Later, they catch 5050 fish and find that 88 are tagged. Use the expected value of a hypergeometric distribution to estimate the number of fish in the lake.

Solution

In the second catch, n=50n = 50, a=40a = 40 tagged fish, and NN is unknown. Assume the number of tagged fish caught equals the expected value:

naN=8⇒50(40)N=8⇒N=20008=250\frac{na}{N} = 8 \quad\Rightarrow\quad \frac{50(40)}{N} = 8 \quad\Rightarrow\quad N = \frac{2000}{8} = 250

The lake has about 250250 fish. (This is called the capture–recapture method.)