Counting Samples to Find Probabilities
When a sample is drawn without replacement from a finite population, the outcomes of successive draws are dependent: an object selected on one draw is no longer available on the next. To find the distribution of the number of successes, we can count the possible samples directly. The key is to specify what counts as a distinct sample and why all such samples are equally likely.
Suppose a population contains \(N\) distinct objects, of which \(K\) are designated successes and \(N-K\) are failures. Select \(n\) objects by simple random sampling without replacement, so each subset of \(n\) objects has the same probability of selection. Let \(X\) be the number of successes in the selected sample. The earlier material on hypergeometric sampling and its support identifies which values \(X\) can take; here we derive their probabilities by counting.
The binomial coefficient \(\binom{a}{b}\) counts the subsets of size \(b\) from \(a\) distinct objects when \(a\) and \(b\) are integers with \(0\leq b\leq a\). A count is zero if the requested number of objects cannot be chosen. Thus an exact count \(x\) is possible only when \(0\leq x\leq K\) and \(0\leq n-x\leq N-K\). Equivalently, the support is \( \max(0,n-(N-K))\leq x\leq \min(n,K) \), with integer \(x\).
Deriving the Hypergeometric Mass Function
A sample is an unordered subset: selecting the same four objects in a different order does not create a different sample. Because every subset of size \(n\) is equally likely, the probability of an event is the number of subsets in that event divided by \(\binom{N}{n}\), the number of all possible subsets. To have exactly \(x\) successes, choose \(x\) of the \(K\) successes and \(n-x\) of the \(N-K\) failures. These choices determine one sample, and every sample with exactly \(x\) successes is obtained in this way.
The numerator counts favorable samples and the denominator counts all possible samples. This argument also shows why the formula has two combination factors in its numerator: successes and failures must both be selected to form a sample of size \(n\). In particular, \(\binom{K}{x}\) alone does not count complete samples; it only chooses the successes.
The same counting argument verifies that the probabilities sum to one. Every subset of size \(n\) contains exactly one possible number \(x\) of successes. Grouping all subsets by that number partitions the full set of samples into disjoint groups.
Worked Probability Calculations
Worked Example: Exactly Two Successes in a Sample
A box contains 12 labeled components, 5 of which are defective and 7 of which are good. Four components are selected uniformly without replacement. Let \(X\) be the number of defective components. Find \(P(X=2)\).
There are \(\binom{12}{4}\) possible samples. For exactly two defectives, choose 2 of the 5 defective components and 2 of the 7 good ones. Hence
The support runs from 0 to 4, since four components are sampled and both population categories contain at least four and at least two objects, respectively. Thus two defectives is a feasible count. The probability is about \(42.42\%\).
Worked Example: At Least Two Successes
A shipment contains 20 devices, 6 of which fail a test and 14 of which pass. A quality inspector selects 5 devices uniformly without replacement. Find the probability that at least 2 fail.
Here \(N=20\), \(K=6\), and \(n=5\). The event includes the disjoint outcomes \(X=2,3,4,5\), so its probability is the sum of their individual probabilities. The total number of samples is \(\binom{20}{5}=15{,}504\). The favorable counts are:
Adding these disjoint counts gives \(5{,}460+1{,}820+210+6=7{,}496\) favorable samples. Therefore,
The support is \(0,1,2,3,4,5\), so the four terms used above cover every possible outcome in the event. Counts outside the event, namely 0 and 1, are not included.
Worked Example: At Most One Success
A tray contains 15 blood-test specimens, 4 of which have a particular marker and 11 of which do not. Three specimens are selected uniformly without replacement. Find the probability that at most one selected specimen has the marker.
The event consists of \(X=0\) or \(X=1\). There are \(\binom{15}{3}=455\) possible samples. With no marked specimens, all 3 must be chosen from the 11 without the marker, giving \(\binom{4}{0}\binom{11}{3}=1\cdot165=165\) samples. With exactly one marked specimen, there are \(\binom{4}{1}\binom{11}{2}=4\cdot55=220\) samples. Thus
The event count \(385\) cannot exceed the total \(455\), as it should not: the remaining \(455-385=70\) samples have two or three marked specimens. This provides a direct arithmetic check on the count.
A Reliable Counting Procedure
For a specified hypergeometric probability, a short sequence of decisions prevents most errors. First identify what constitutes a success and confirm that the sample is drawn uniformly without replacement. Then translate the event into possible values of \(X\), and count complete samples for each value. For an event involving several counts, add their favorable counts or, equivalently, add their probabilities. The following procedure is especially useful when a question asks for an exact count or a tail probability.
Write down \(N\), \(K\), and \(n\), along with which population members count as successes.
For an exact event, use one value \(x\). For “at least” or “at most,” list every feasible value included in the event.
For each feasible \(x\), count \(\binom{K}{x}\binom{N-K}{n-x}\) favorable samples. Divide the total favorable count by \(\binom{N}{n}\).
Confirm that all included counts are in the support, that favorable samples do not outnumber all samples, and that the final probability lies between 0 and 1.
Common Mistake: Counting Ordered Draws
A frequent error is to treat a sample of \(n\) objects as an ordered sequence in the denominator while treating it as an unordered subset in the numerator. For example, one might use \(N(N-1)\cdots(N-n+1)\) as the total number of outcomes but use \(\binom{K}{x}\binom{N-K}{n-x}\) for favorable outcomes. These quantities count different kinds of objects, so their ratio is not the desired probability.
There are two consistent approaches. The one used here treats the sample as an unordered subset, giving \(\binom{N}{n}\) total samples and \(\binom{K}{x}\binom{N-K}{n-x}\) favorable samples. Alternatively, one could count ordered draw sequences in both numerator and denominator; every subset then corresponds to \(n!\) orderings. The common factor cancels, producing the same probability. Mixing the approaches does not preserve that cancellation.
A related error is to multiply \(n\) probabilities as though the draws were independent. In sampling without replacement, the chance that the next draw is a success changes after each object is removed. The subset-counting method handles that dependence without needing to calculate a separate sequence of conditional probabilities.
Check Your Understanding
Use the counting method to answer each question. State the total number of samples and the favorable count or counts.
- A population has 10 objects, 3 of them successes. A sample of size 2 is selected uniformly without replacement. Find the probability of exactly one success.
- For \(N=18\), \(K=5\), and \(n=4\), which integer values of \(X\) have positive probability?
- In the setting of question 2, write the sum of combination counts that gives the number of samples with at least two successes.
- Explain why \(\binom{K}{x}\) alone does not count all samples with exactly \(x\) successes.
- If every possible size-\(n\) sample is assigned the same probability, why must the favorable count be divided by \(\binom{N}{n}\)?