Hypergeometric PMF Calculator
The probability of exactly k successes when drawing n items without replacement from a population of N containing K successes.
What this page computes
Evaluates the hypergeometric point probability: drawing without replacement changes the odds after every draw, so this is not a binomial.
How to use it
Type the Population size N, Successes in population K, Draws n, Observed successes k and press Run. N ≥ 1 is the population, K the successes in it (0 ≤ K ≤ N), n the draws (0 ≤ n ≤ N) and k the observed successes. The support is max(0, n − (N − K)) … min(n, K). With N = 50, K = 5, n = 10, k = 2, the page prints P(X = 2) = 0.20984.
Running it
A ratio of binomial coefficients, each evaluated as a log-gamma, so no factorial is ever formed and a large population stays finite. Every figure is computed in this browser tab: nothing is uploaded and nothing is stored.
Evaluates the hypergeometric point probability: drawing without replacement changes the odds after every draw, so this is not a binomial. With N = 50, K = 5, n = 10, k = 2, the page prints P(X = 2) = 0.20984.
A ratio of binomial coefficients, each evaluated as a log-gamma, so no factorial is ever formed and a large population stays finite. The printed result is accurate to log-gamma arithmetic, about 1e-14 relative for ordinary inputs; no table is read and nothing is simulated.
How to use this hypergeometric distribution calculator
Type each value below and press Run. The page prints the point probability and the parameter line it used, so the answer can be checked against the formula rather than taken on trust.
The inputs this page reads are Population size N (whole number, at least 1); Successes in population K (whole number, 0 to N); Draws n (whole number, 0 to N); Observed successes k (whole number on the support).
The parameterisation
N ≥ 1 is the population, K the successes in it (0 ≤ K ≤ N), n the draws (0 ≤ n ≤ N) and k the observed successes. The support is max(0, n − (N − K)) … min(n, K).
The numeric method
A ratio of binomial coefficients, each evaluated as a log-gamma, so no factorial is ever formed and a large population stays finite.
The printed value is accurate to log-gamma arithmetic, about 1e-14 relative for ordinary inputs. The page returns the point probability only; it does not also print a test statistic, a p-value or a decision.
What to Expect
Best for
- sampling without replacement
- lot inspection and card-draw problems
Not ideal for
- draws with replacement, which use the binomial distribution
- a probability that ignores the finite population
What this tool keeps
- Double-precision arithmetic in your own browser
- The same inputs always produce the same output
Common errors
- Every count must be a whole number inside its range, and k must lie on the support. A draw larger than the population, or more successes than exist, is refused.
Example use cases
- defect sampling from a finite lot
- committee and card problems
Sample input
N = 50, K = 5, n = 10, k = 2.
Sample output
P(X = 2) = 0.20984.
Who this is for
- students
- quality engineers
Frequently asked questions
Which parameterisation does this page use?
N ≥ 1 is the population, K the successes in it (0 ≤ K ≤ N), n the draws (0 ≤ n ≤ N) and k the observed successes. The support is max(0, n − (N − K)) … min(n, K).
How is the result computed?
A ratio of binomial coefficients, each evaluated as a log-gamma, so no factorial is ever formed and a large population stays finite. The result is accurate to log-gamma arithmetic, about 1e-14 relative for ordinary inputs.
What inputs are refused?
Every count must be a whole number inside its range, and k must lie on the support. A draw larger than the population, or more successes than exist, is refused.
Is anything uploaded?
No. Every number is computed by JavaScript in this page from the values you typed; nothing is posted, stored or logged.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.