Tutorials › Statistical Theory I - Probability and Distribution Theory › Hypergeometric Counts in Finite-Population Samples

Exact Sampling Distributions · Tutorial 792 of 994

Hypergeometric Counts in Finite-Population Samples

Learn how to count finite-population samples to obtain exact hypergeometric probabilities, and how the resulting category counts are related.

Advanced 12 min read

What You'll Learn

  • Derive the joint category-count probability by counting sample subsets
  • Identify the support and boundary cases of the multivariate hypergeometric law
  • Obtain a single-category hypergeometric distribution as a marginal
  • Calculate means, variances, and covariances of finite-population category counts
  • Distinguish dependence in nondegenerate samples from constant endpoint counts
  • Apply the formulas to exact sampling probabilities

Why Counts Change Without Replacement

When a sample is drawn without replacement from a finite population, the number selected from one category constrains how many can be selected from the others. The resulting count law is not the multinomial law for independent draws: every sample has a fixed size, and each population unit can appear at most once. Counting the possible samples gives the exact probabilities directly.

Suppose a population has \(N\) distinct units divided into \(r\) categories. Let category \(j\) contain \(K_j\) units, where \(\sum_{j=1}^r K_j=N\). A simple random sample of size \(n\) means that each of the \(\binom{N}{n}\) subsets of \(n\) population units is equally likely. Write \(X_j\) for the number of sampled units in category \(j\).

Definition: The vector \((X_1,\ldots,X_r)\) has a multivariate hypergeometric distribution with population category sizes \((K_1,\ldots,K_r)\) and sample size \(n\) if its probability at a vector of integer counts \((x_1,\ldots,x_r)\) is $$ P(X_1=x_1,\ldots,X_r=x_r) = \frac{\prod_{j=1}^r \binom{K_j}{x_j}}{\binom{N}{n}}, $$ provided \(0\leq x_j\leq K_j\) for every \(j\) and \(\sum_{j=1}^r x_j=n\). The probability is zero for all other count vectors.

The support conditions are essential: a count cannot exceed its category's population size, and the counts must add to the sample size. In particular, there is no freedom to choose each \(x_j\) independently. The denominator counts every possible sample, and the numerator counts the samples having exactly the specified category counts.

Deriving the Joint Count Law

Fix a feasible vector \((x_1,\ldots,x_r)\). To form a sample with these counts, choose \(x_1\) of the \(K_1\) units in category 1, \(x_2\) of the \(K_2\) units in category 2, and so on. These choices concern disjoint categories, so their number is the product \(\prod_j\binom{K_j}{x_j}\). Each resulting choice is one distinct sample subset of size \(\sum_jx_j=n\). Since all \(\binom{N}{n}\) sample subsets are equally likely, dividing gives the stated probability.

This counting argument also verifies that the formula is normalized. Every sample subset has exactly one vector of category counts. Consequently, grouping all \(\binom{N}{n}\) subsets according to their count vectors partitions the set of possible samples. The number of subsets in each group is the numerator above; summing those numerators over feasible vectors therefore gives \(\binom{N}{n}\), and the probabilities sum to one.

Worked Example: A Two-Category Hypergeometric Probability

An inventory contains \(N=12\) components: \(K=5\) are defective and \(12-5=7\) are not. Four components are chosen by simple random sampling without replacement. Find the probability of exactly two defective components.

Let \(X\) be the number of defective components selected. To have \(X=2\), choose 2 of the 5 defective components and 2 of the 7 nondefective components. There are \(\binom{5}{2}\binom{7}{2}=10\cdot21=210\) such samples. The total number of samples is \(\binom{12}{4}=495\). Thus

$$ P(X=2)=\frac{\binom{5}{2}\binom{7}{2}}{\binom{12}{4}} =\frac{210}{495}=\frac{14}{33}\approx 0.4242. $$

The support is \(0\leq X\leq4\): at most four can be selected, and there are at least four nondefective components available. The value \(2\) is in this support, as required.

The Marginal Hypergeometric Distribution

For any one category, combine all the other categories into a single “not in category \(j\)” group. This gives the ordinary hypergeometric distribution. Its support makes explicit both ways a proposed count can fail: there may not be enough units in the category, or there may not be enough units outside it to fill the remaining sample places.

Result: If category \(j\) has size \(K_j\), then \(X_j\) has the hypergeometric probability mass function $$ P(X_j=k)= \frac{\binom{K_j}{k}\binom{N-K_j}{n-k}}{\binom{N}{n}}, \qquad \max\{0,n-(N-K_j)\}\leq k\leq \min\{n,K_j\}, $$ for integer \(k\). Outside this range, the probability is zero.

Indeed, to get exactly \(k\) members of category \(j\), choose \(k\) of its \(K_j\) units and \(n-k\) of the \(N-K_j\) units outside it. Those choices account for every sample with \(X_j=k\), without overlap. The lower support limit is \(n-(N-K_j)\) when that quantity is positive, because the sample cannot contain more than \(N-K_j\) units from outside the category.

Worked Example: A Multivariate Count Probability

A population of \(N=10\) items has three categories with sizes \(K_1=4\), \(K_2=3\), and \(K_3=3\). A sample of size \(n=3\) is drawn without replacement. Find the probability that the counts are \((X_1,X_2,X_3)=(2,1,0)\).

The proposed counts are feasible: they are nonnegative, no count exceeds its category size, and \(2+1+0=3\). The number of samples with these counts is \(\binom{4}{2}\binom{3}{1}\binom{3}{0}=6\cdot3\cdot1=18\). There are \(\binom{10}{3}=120\) possible samples in total. Therefore

$$ P(X_1=2,X_2=1,X_3=0) = \frac{18}{120} = \frac{3}{20} = 0.15. $$

The zero count in category 3 is handled by \(\binom{3}{0}=1\): there is exactly one way to choose none of its members. The probability calculation counts the samples themselves, not different orders in which the same sample might be drawn.

Means, Variances, and Covariances

The category counts have simple moments. The mean of a category count is the sample size times that category's population proportion. The variance is smaller than the corresponding binomial variance because units are not returned to the population after selection. Counts in distinct nonempty categories tend to move in opposite directions, subject to the fixed total \(n\).

Theorem: Let \(p_j=K_j/N\), and suppose \(N>1\). For a simple random sample of size \(n\), $$ E[X_j]=np_j,\qquad \operatorname{Var}(X_j) = n\frac{N-n}{N-1}p_j(1-p_j), $$ and, for \(i\ne j\), $$ \operatorname{Cov}(X_i,X_j) = -n\frac{N-n}{N-1}p_ip_j. $$

To prove these formulas, for each population unit \(u\) let \(I_u=1\) if it is included in the sample and \(I_u=0\) otherwise. By symmetry, \(P(I_u=1)=n/N\). For distinct units \(u\) and \(v\), both are included with probability \(\binom{N-2}{n-2}/\binom{N}{n}=n(n-1)/(N(N-1))\); this identity also gives zero when \(n=0\) or \(n=1\). Hence

$$ \operatorname{Cov}(I_u,I_v) = \frac{n(n-1)}{N(N-1)}-\left(\frac{n}{N}\right)^2 = -\frac{n(N-n)}{N^2(N-1)}. $$

For category \(j\), let \(C_j\) be its set of \(K_j\) units. Then \(X_j=\sum_{u\in C_j}I_u\). Linearity of expectation gives \(E[X_j]=K_jn/N=np_j\). For the variance, the \(K_j\) individual indicator variances are each \((n/N)(1-n/N)\), and there are \(K_j(K_j-1)\) ordered distinct-unit covariance terms. Therefore

$$ \begin{aligned} \operatorname{Var}(X_j) &=K_j\frac{n}{N}\left(1-\frac{n}{N}\right) -K_j(K_j-1)\frac{n(N-n)}{N^2(N-1)}\\ &=\frac{n(N-n)}{N^2(N-1)} \bigl(K_jN-K_j(K_j-1)\bigr)\\ &=\frac{n(N-n)}{N^2(N-1)}K_j(N-K_j)\\ &=n\frac{N-n}{N-1}p_j(1-p_j). \end{aligned} $$

For distinct categories \(i\) and \(j\), their units are disjoint, so every pair \(u\in C_i,\ v\in C_j\) consists of distinct units. Expanding the covariance of the two sums gives

$$ \begin{aligned} \operatorname{Cov}(X_i,X_j) &=\sum_{u\in C_i}\sum_{v\in C_j}\operatorname{Cov}(I_u,I_v)\\ &=-K_iK_j\frac{n(N-n)}{N^2(N-1)} =-n\frac{N-n}{N-1}p_ip_j. \end{aligned} $$

This proves all three moment formulas. \(\square\)

Worked Example: Checking the Dependence Between Two Counts

A population of \(N=20\) units has category sizes \(K_1=8\), \(K_2=5\), and \(K_3=7\). A sample of size \(n=6\) is selected. Find the means of the first two counts, their covariance, and the variance of the first count.

Here \(p_1=8/20=2/5\) and \(p_2=5/20=1/4\), while \(n(N-n)/(N-1)=6\cdot14/19=84/19\). Thus

$$ E[X_1]=6\left(\frac25\right)=\frac{12}{5}, \qquad E[X_2]=6\left(\frac14\right)=\frac32. $$

The covariance is

$$ \operatorname{Cov}(X_1,X_2) =-\frac{84}{19}\left(\frac25\right)\left(\frac14\right) =-\frac{42}{95}. $$

The variance of the first count is

$$ \operatorname{Var}(X_1) =\frac{84}{19}\left(\frac25\right)\left(\frac35\right) =\frac{504}{475}. $$

The negative covariance is consistent with the fixed total: a sample containing more units from category 1 has fewer sample places available for category 2. The computed means need not be integers; they are averages over repeated samples, not counts in one particular sample.

Boundary Cases and a Common Pitfall

For \(0<n<N\) and at least two nonempty categories, every nonempty category count has positive variance, and the covariance of any two distinct nonempty category counts is negative. In particular, each such pair is dependent: independent variables with finite variances have covariance zero. This dependence statement requires the stated conditions. If \(n=0\), all counts equal zero; if \(n=N\), each count equals its full category size. At either endpoint all counts are constant, and constant random variables are independent. A category of size zero also has a constant count.

Common mistake: It is tempting to say that category counts are always dependent because their sum is fixed. The fixed-sum argument alone does not settle the endpoint cases: when \(n=0\) or \(n=N\), the counts are constants, so they are independent. The correction is to identify whether the counts are nonconstant. For an interior sample size \(0<n<N\) and at least two nonempty categories, the negative covariance formula establishes dependence for each pair of nonempty categories; at the endpoint sample sizes, all counts are constant.

The hypergeometric laws are useful whenever an exact probability is required under sampling without replacement—for example, quality-control sampling from a fixed batch, drawing labeled individuals from a finite roster, or allocating a fixed-size sample across known groups. The probability model must match the sampling mechanism: replacing the finite-population design with independent draws changes both the probabilities and the dependence structure.

Check Your Understanding

Use the finite-population sampling setup and formulas developed above.

  1. A population has 9 marked and 11 unmarked units. Four are sampled without replacement. Write the support and probability mass function for the number of marked units.
  2. For category sizes \((3,5,4)\) and sample size 4, determine whether the count vector \((1,2,1)\) is feasible, then write its probability as a ratio of binomial coefficients.
  3. Explain why the mean of a hypergeometric count can be noninteger even though each realized count is an integer.
  4. Under what conditions are two distinct nonempty category counts dependent? What happens at \(n=0\) and \(n=N\)?
  5. For a category with population proportion \(p\), state the variance of its sample count and identify the factor that reflects sampling without replacement.