Overview
This free calculator computes the hypergeometric probability distribution — the distribution of sampling without replacement from a finite population. Enter the population size \(N\), successes \(R\), sample size \(n\), and successes drawn \(x\) to get:
- The exact probability \(P(X = x)\)
- The cumulative probability \(P(X \le x)\)
- The upper-tail probability \(P(X \ge x)\)
Interactive Calculator
All inputs must be non-negative integers with \(R \le N\), \(n \le N\), and \(\max(0,\; n + R - N) \le x \le \min(R,\; n)\).
Hypergeometric Formula
If a population of size \(N\) contains \(R\) "successes" (and \(N-R\) "failures"), and a sample of size \(n\) is drawn without replacement, then the probability of drawing exactly \(x\) successes is:
\[ P(X = x) = \frac{\dbinom{R}{x}\,\dbinom{N-R}{n-x}}{\dbinom{N}{n}} \]The numerator counts the ways to choose \(x\) successes from \(R\) available and \(n-x\) failures from \(N-R\) available. The denominator counts all possible samples of size \(n\) from \(N\).
Worked Example & Manual Verification
The default inputs correspond to the following scenario. Compare the manual math below with the outputs generated by the calculator above.
Problem. A box holds 12 balls: 7 red and 5 black. Five balls are drawn without replacement. Find the probability that the sample contains:
- exactly 3 red balls;
- at least 3 red balls;
- at most 3 red balls.
View solution
Setup. Population size \(N = 12\), red balls \(R = 7\), sample \(n = 5\). Note \(\binom{12}{5} = 792\).
(a) Exactly 3 red (\(x = 3\)):
\[ P(X = 3) = \frac{\binom{7}{3}\binom{5}{2}}{\binom{12}{5}} = \frac{35 \times 10}{792} = \frac{175}{396} \approx 0.4419 \](b) At least 3 red (\(X \ge 3\)): \(X = 3, 4, 5\)
\[ P(X \ge 3) = \frac{350 + 175 + 21}{792} = \frac{546}{792} = \frac{91}{132} \approx 0.6894 \](c) At most 3 red (\(X \le 3\)): \(X = 0, 1, 2, 3\)
\[ P(X \le 3) = \frac{1 + 35 + 210 + 350}{792} = \frac{596}{792} = \frac{149}{198} \approx 0.7525 \]Cross-check: \(P(X \ge 3) + P(X \le 2) = 1\), and \(P(X \le 2) = 1 - P(X \ge 3) = 1 - 91/132 = 41/132 \approx 0.3106\). Since \(P(X \le 3) = 149/198 \approx 0.7525\), we have \(P(X = 3) = P(X \le 3) - P(X \le 2) \approx 0.7525 - 0.3106 = 0.4419\) ✓ — matching part (a).
Related Statistics Resources
Last updated: October 20, 2026