Grade by Grade
B. Probability Distributions · Discrete Probability Distributions

The Hypergeometric Distribution: Dependent Trials

B1.5About 75 minutes
Learning goals
  • I can recognize situations with dependent trials (sampling without replacement) that give a hypergeometric distribution.
  • I can calculate hypergeometric probabilities with combinations and check them with a tree diagram.
  • I can find the possible values of X and the expected value E(X) = nr/N.
  • I can represent a hypergeometric distribution in a table and a probability histogram.

Words to know

dependent trials
Trials where earlier results change the probabilities for later ones, as when you draw items without putting them back.
hypergeometric distribution
The distribution of X = number of successes in a sample of n items chosen without replacement from N items, of which r are successes.
population size N
The total number of items you are choosing from.
sample size n
The number of items chosen.
number of successes r
The number of items in the population that count as successes.

When the trials depend on each other

A box holds 20 batteries, and 4 of them are dead. You take 5 batteries out to put in a game controller. How many dead ones will you get?

This looks like a binomial problem, but it is not. Once you take out a dead battery, there are fewer dead ones left, so the probability changes on the next pick. The trials are dependent. When we sample without replacement from a finite group and count successes, we get the hypergeometric distribution.

In Permutations and Combinations you solved problems like "choose 5 marbles without replacement" one at a time. The hypergeometric distribution organizes all of those answers into one distribution.

Drawing 3 from 10 cards (4 hearts), hearts every time:1st drawP(heart) = 4/10×2nd drawP(heart) = 3/9×3rd drawP(heart) = 2/8(4/10)(3/9)(2/8) = 24/720 = 1/30. The probability changes on every draw: the trials are dependent.
Without replacement, each draw changes the probability for the next one. In a binomial experiment the probability would stay the same on every draw.

The formula

Suppose a population has N items, r of which are successes (and N − r failures). Choose n items without replacement, all samples equally likely. Let X = number of successes in the sample.

To get exactly k successes, choose k of the r successes and n − k of the N − r failures. By the multiplicative counting principle:

P(X = k) = C(r, k) · C(N − r, n − k) / C(N, n)

The denominator C(N, n) counts all possible samples.

Possible values: k cannot be more than n or more than r, and you cannot take more failures than exist, so n − k ≤ N − r. In most problems, X goes from 0 up to the smaller of n and r.

population: N = 20 batteries✕✕✕✕r = 4 dead (✕), N − r = 16 goodchoosen = 5one possible sample: X = 1 dead✕P(X = k) = C(4, k) · C(16, 5 − k) ÷ C(20, 5)dead ways × good ways ÷ all samples
The formula counts samples: ways to choose the dead batteries, times ways to choose the good ones, divided by all possible samples of 5.
Worked example

Example 1: Dead batteries

A box has 20 batteries, 4 of them dead. You choose 5 at random. Let X be the number of dead batteries. Find the probability distribution of X.

  1. N = 20, r = 4, n = 5. X can be 0, 1, 2, 3 or 4. Total samples: C(20, 5) = 15 504.
  2. P(X = 0) = C(4, 0)C(16, 5)/15 504 = 1 × 4368/15 504 ≈ 0.2817.
  3. P(X = 1) = C(4, 1)C(16, 4)/15 504 = 4 × 1820/15 504 = 7280/15 504 ≈ 0.4696.
  4. P(X = 2) = C(4, 2)C(16, 3)/15 504 = 6 × 560/15 504 = 3360/15 504 ≈ 0.2167.
  5. P(X = 3) = C(4, 3)C(16, 2)/15 504 = 4 × 120/15 504 = 480/15 504 ≈ 0.0310.
  6. P(X = 4) = C(4, 4)C(16, 1)/15 504 = 16/15 504 ≈ 0.0010.
  7. Check: 4368 + 7280 + 3360 + 480 + 16 = 15 504. ✓

P = 0.2817, 0.4696, 0.2167, 0.0310, 0.0010 for x = 0 to 4. The most likely result is 1 dead battery.

0.00.10.20.30.40.50.281700.469610.216720.031030.00104xP(X = x)X = dead batteries in a sample of 5E(X) = 5 × 4/20 = 1
The probability histogram for the dead batteries is skewed right with mode 1. Its balance point is E(X) = 1.

Expected value

A fraction r/N of the population are successes, so in a sample of n you expect that same fraction:

E(X) = n · r/N

This is the same as the binomial np with p = r/N. For the batteries, E(X) = 5 × 4/20 = 1. Check with the table: 0(0.2817) + 1(0.4696) + 2(0.2167) + 3(0.0310) + 4(0.0010) = 0.4696 + 0.4334 + 0.0930 + 0.0040 = 1.0000. ✓

The mean matches the binomial mean, but the spread is smaller. Sampling without replacement cannot keep picking the same rare items, so extreme values are a little less likely. Lesson 9 compares the two distributions side by side.

Worked example

Example 2: Hearts in a poker hand

Five cards are dealt from a standard 52-card deck. Let X be the number of hearts. Find P(X = 2), P(X ≥ 1) and E(X).

  1. N = 52, r = 13 hearts, n = 5. C(52, 5) = 2 598 960.
  2. P(X = 2) = C(13, 2)C(39, 3)/C(52, 5) = 78 × 9139/2 598 960 = 712 842/2 598 960 ≈ 0.2743.
  3. P(X = 0) = C(39, 5)/C(52, 5) = 575 757/2 598 960 ≈ 0.2215.
  4. P(X ≥ 1) = 1 − 0.2215 = 0.7785.
  5. E(X) = 5 × 13/52 = 1.25.

P(X = 2) ≈ 0.274; P(X ≥ 1) ≈ 0.778; E(X) = 1.25 hearts

Worked example

Example 3: Checking the formula with a tree

A deck of 10 cards has 4 hearts. Draw 3 without replacement. Find P(X = 3) both ways, where X is the number of hearts.

  1. Tree: P(heart, heart, heart) = (4/10)(3/9)(2/8) = 24/720 = 1/30.
  2. Formula: C(4, 3)C(6, 0)/C(10, 3) = 4 × 1/120 = 4/120 = 1/30. ✓
  3. For X = 2 the tree needs 3 paths (HHN, HNH, NHH), each (4 × 3 × 6)/(10 × 9 × 8) = 72/720, for 216/720 = 3/10. The formula gives C(4, 2)C(6, 1)/120 = 36/120 = 3/10. ✓

P(X = 3) = 1/30. Trees and combinations agree; combinations are much faster for larger samples.

Worked example

Example 4: Capture and recapture

Biologists tag 10 fish from a pond that is known to contain 50 fish, then release them. Later they catch 6 fish (without replacement). Find the probability that exactly 2 are tagged, and the expected number tagged.

  1. N = 50, r = 10, n = 6.
  2. P(X = 2) = C(10, 2)C(40, 4)/C(50, 6) = 45 × 91 390/15 890 700 = 4 112 550/15 890 700 ≈ 0.2588.
  3. E(X) = 6 × 10/50 = 1.2.

P(X = 2) ≈ 0.259; E(X) = 1.2 tagged fish. In real studies the logic runs the other way: the number of tagged fish caught is used to estimate the unknown population N. Fisheries biologists use capture-recapture methods like this to monitor fish populations.

Spreadsheet help

A spreadsheet can do the counting: COMBIN(n, k) gives C(n, k). For example, P(X = 2) for the batteries is =COMBIN(4,2)*COMBIN(16,3)/COMBIN(20,5). (Excel also has HYPGEOM.DIST, and graphing calculators and online tools can compute hypergeometric probabilities directly.)

Just for fun

The name "hypergeometric" sounds like a dinosaur or a roller coaster. It is actually named after a kind of series from higher mathematics that these probabilities are connected to. No roller coasters were harmed.

Hands-on activity

Without replacement, with a deck of cards

You need: a standard deck of 52 cards, pencil and paper.

  1. Shuffle well and deal 5 cards. Record X = number of hearts. Put the cards back and shuffle again. Repeat 40 times.
  2. Make a frequency table for X = 0 to 5 and convert to relative frequencies.
  3. Compare with theory: P(0) ≈ 0.222, P(1) ≈ 0.411, P(2) ≈ 0.274, P(3) ≈ 0.082, P(4) ≈ 0.011, P(5) ≈ 0.0005.
  4. Find the mean of your 40 values of X. Compare it with E(X) = 1.25.
  5. Think about it: if you dealt 5 cards with replacement (put each card back before the next one), would X be binomial? With what n and p?

What to look for: you will probably see X = 1 most often, and X = 4 or 5 rarely or never. Your mean should be roughly between 1.0 and 1.5. With replacement, X ~ B(5, 1/4), which has the same mean, 1.25.

Your turn

1

Is this hypergeometric, binomial or neither? "Choose 4 students at random from a class of 25, of whom 10 play hockey. X = number of hockey players chosen."

2

For the class in the previous question, find P(X = 0).

3

A bag has 5 red and 7 blue marbles. Draw 4 without replacement. Find P(exactly 2 red).

4

For the bag in the previous question, find P(at least 1 red).

5

For the bag, find E(X) where X = number of red marbles.

6

A jury pool has 30 people, 8 of whom are retired. A panel of 5 is chosen at random. Find P(exactly 2 retired).

7

A box has 8 items, 5 of them good. You choose 6. What values can X = number of good items take?

More practice: warm-up

1

Do hypergeometric problems involve sampling with or without replacement?

2

In the hypergeometric formula, what does C(N, n) count?

3

N = 40, r = 10, n = 8. Find E(X).

4

Evaluate C(6, 2).

5

A bag has 3 green and 2 white balls. Draw 2. Find P(both green).

More practice: on your own

1

A shipment of 15 phones has 6 with scratches. An inspector checks 5. Find the distribution of X = number scratched. (Give each probability to 4 decimal places.)

2

For the phones, find E(X) and the mode.

3

A committee of 4 is chosen from 6 Grade 11 and 6 Grade 12 students. Find the probability that the committee has more Grade 12s than Grade 11s.

4

Explain why E(X) = nr/N makes sense without doing any algebra.

5

In 6/49-style lotteries, 6 numbers are drawn from 49. You picked 6 numbers. Find P(exactly 3 of yours are drawn).

Challenge

1

Show that the hypergeometric probabilities for N = 10, r = 4, n = 3 add to 1 using Vandermonde's idea: Σ C(4, k)C(6, 3 − k) = C(10, 3).

2

Capture-recapture: 30 fish are tagged and released in a lake with an unknown number N of fish. Later 40 fish are caught, and 6 are tagged. Use E(X) = nr/N to estimate N.

3

A box has 12 eggs, 2 of which are cracked. How many eggs must you take (without replacement) for the probability of getting at least one cracked egg to exceed 0.5?

Check your understanding

Quiz

1.

Which situation is best modelled by a hypergeometric distribution?

2.

N = 20, r = 4, n = 5. Which expression gives P(X = 2)?

3.

A sample of 6 is chosen from 30 items, 10 of which are defective. What is the expected number of defective items?

4.

A bag has 3 red and 5 blue marbles. Draw 2 without replacement. What is P(both red)?

5.

Why is sampling without replacement not binomial?

6.

A box has 7 items, 5 of them good. Choose 4. What is the smallest possible value of X = number of good items?

For parents and teachers

Big idea (B1.5): when you sample without replacement from a small group, each draw changes what is left, so the trials are dependent. The number of successes then follows the hypergeometric distribution, P(X = k) = C(r, k)C(N − r, n − k)/C(N, n), with mean nr/N.

How to help: use a deck of cards: deal 5 cards and count hearts, then ask how the chances would differ if each card were put back before the next draw. Ask your teen to name N, r and n before using the formula.

Common difficulties:

  • Using the binomial formula when sampling is without replacement.
  • Mixing up the roles of n (sample size) and r (successes in the population).
  • Forgetting that the failures must also be chosen: C(N − r, n − k).
  • Listing impossible values of X (for example 0 good items when there are not enough bad ones).