3.6 Hypergeometric Distribution
3.6.1 Main Idea
The hypergeometric distribution models the number of items from a group of interest when a sample is selected without replacement from a finite population.
Suppose the population contains
\(N\) total items;
\(K\) items in the group of interest;
\(N-K\) items in the other group.
A sample of size \(n\) is selected without replacement. Define
The word success is often used for the group being counted. It does not
have to mean a desirable outcome. For example, in quality control, a
defective item may be called a success if defectives are what \(X\)
counts.
A common notation is
Some textbooks instead write the parameters as the size of the first group, the size of the second group, and the sample size. The \(N,K,n\) notation will be used here because it makes the population structure explicit.
3.6.2 Conditions for a Hypergeometric Experiment
A hypergeometric experiment has the following structure:
The population is finite and contains two groups.
One group is designated as the group of interest.
A fixed sample of size \(n\) is selected.
Sampling is without replacement.
The selections are therefore dependent.
The last point distinguishes a hypergeometric experiment from repeated Bernoulli trials.
A single draw can still be classified as success or failure, but the sequence is not a Bernoulli sequence because the probability of success changes after each draw.
For example, suppose a box contains 4 red and 6 black cards. Initially,
If the first card is red and is not replaced, then
The probability changed because the composition of the population changed.
The figure illustrates the key point: after an item is removed, both the numerator and denominator can change. Thus, later selections depend on the earlier selections.
3.6.3 Parameters and Possible Values
For
we use
\(N\): population size;
\(K\): number of successes in the population;
\(N-K\): number of failures in the population;
\(n\): sample size;
\(X\): number of successes in the sample.
The possible values of \(X\) are not always simply \(0,1,\ldots,n\).
The largest possible number of successes is
because we cannot select more successes than the sample size or more than the number available in the population.
The smallest possible number is
Therefore,
Note
Support of a Hypergeometric Random Variable
For example, if only 10 defective laptops exist in the population, then a sample cannot contain 11 defective laptops even if the sample size is larger than 10.
3.6.4 Deriving the Hypergeometric PMF
Suppose we want exactly \(x\) successes in a sample of size \(n\).
A sample with exactly \(x\) successes must contain
\(x\) items chosen from the \(K\) successes;
\(n-x\) items chosen from the \(N-K\) failures.
The number of ways to choose the successes is
The number of ways to choose the failures is
Therefore, the number of samples having exactly \(x\) successes is
The total number of samples of size \(n\) that can be selected from \(N\) items is
Because each subset of \(n\) items is equally likely under simple random sampling without replacement,
Note
Hypergeometric PMF
The numerator counts the favorable samples: choose \(x\) objects from the group of interest and \(n-x\) from the other group. The denominator counts all samples of size \(n\).
This is a counting argument rather than a product of independent Bernoulli probabilities.
3.6.5 Example: Inspecting Laptops
A shipment contains 100 laptops, of which 10 are known to be defective. An inspector randomly selects 12 laptops without replacement.
Let
Then
The possible values are
The upper limit is 10, not 12, because only 10 defective laptops exist in the entire shipment.
Suppose we want the probability that at most two sampled laptops are defective:
Using the hypergeometric PMF,
The three probabilities are approximately
Therefore,
Thus, there is about a \(90.19\%\) probability that the sample contains at most two defective laptops.
The darker bars represent the event \(X\leq2\). The distribution is centered near \(1.2\), the expected number of defectives in a sample of 12.
3.6.6 Deriving the Mean
The mean has a simple form even though the draws are dependent.
For draw \(i\), define the indicator variable
The total number of successes is
Before any particular draw position is observed, every population item is equally likely to occupy that position. Therefore,
Hence,
Using linearity of expectation,
Thus,
Note
Mean of a Hypergeometric Distribution
If we define the population success proportion as
then the same result is
Notice that this has the same form as the binomial mean.
For the laptop example,
An expected value of 1.2 does not mean that a sample can contain 1.2 defective laptops. It is the long-run average number of defectives over many samples.
3.6.7 Deriving the Variance
The variance differs from the binomial variance because the draws are not independent.
Let
For each indicator \(I_i\),
For two different draw positions \(i\) and \(j\),
Therefore,
Substituting gives
After simplifying,
The covariance is negative: if one draw is a success, there is one fewer success available for a later draw.
Now
so
There are \(n\) variance terms and \(\binom n2\) covariance pairs. Thus,
Since
we obtain
Factor \(npq\):
Therefore,
Note
Variance of a Hypergeometric Distribution
The factor
is the finite population correction. It reduces the variance because sampling without replacement creates negative dependence.
The standard deviation is
For the laptop example,
Thus,
and
3.6.8 Probability Language and the CDF
As with other discrete distributions, probability statements should first be translated into events involving \(X\).
Exactly two means
At most two means
At least two means
The hypergeometric CDF is obtained by summing PMF values:
There is no need to memorize a separate closed-form expression. The important idea is that cumulative probabilities are sums of hypergeometric PMF values.
Complements are often convenient. For example,
3.6.9 Hypergeometric Versus Binomial
The random variable may look the same in both models: both can count the number of successes in a sample. The sampling mechanism determines the model.
Feature |
Binomial |
Hypergeometric |
|---|---|---|
Number sampled |
Fixed \(n\) |
Fixed \(n\) |
Outcomes per draw |
Two categories |
Two categories |
Replacement |
With replacement or effectively unchanged |
Without replacement |
Success probability |
Constant \(p\) |
Changes across draws |
Draws |
Independent |
Dependent |
Random variable |
Number of successes |
Number of successes |
The two means have the same form,
but the variances differ:
whereas
Because
when \(n>1\), the hypergeometric distribution is less variable than the corresponding binomial distribution with the same \(n\) and \(p\).
3.6.10 Binomial Approximation
If the population is very large relative to the sample, removing one item has only a small effect on the success probability.
In that situation, the hypergeometric distribution can sometimes be approximated by
A common introductory rule of thumb is
When the sampling fraction is small, the finite population correction is close to 1, so the hypergeometric and binomial variances are also close.
This is an approximation, not an exact equality.
3.6.11 Example: Selecting a Committee
A committee of four is selected randomly from six men and five women. Let
Then
The probability that exactly two committee members are men is
Therefore,
The expected number of men is
3.6.12 A Simple Modeling Procedure
For a possible hypergeometric problem:
Identify the finite population.
Confirm that sampling is without replacement.
Define the group of interest as
success.Identify \(N\), \(K\), and \(n\).
Define \(X\) as the number of successes in the sample.
Determine the valid range of \(X\).
Translate the requested probability into notation.
Apply the hypergeometric PMF or sum PMF values as needed.
3.6.13 Common Mistakes
Do not use a binomial model merely because the problem counts successes. Check whether sampling is without replacement from a finite population.
Do not treat the draws as independent. The population composition changes after every selection.
Do not confuse \(N\) and \(n\):
\(N\) is the population size;
\(n\) is the sample size.
Do not forget that the number of failures in the population is
Do not assume that \(X\) always ranges from \(0\) to \(n\). Use
3.6.14 Summary
The hypergeometric distribution models the number of successes in a fixed-size sample selected without replacement from a finite population.
For
its PMF is
The mean is
The variance is
The key modeling question is:
Is the sample taken without replacement from a finite population?
If yes, the hypergeometric distribution should be considered before the binomial distribution.