The hypergeometric distribution answers a question the binomial distribution can't: what's the probability of a given number of successes when you draw a sample from a finite population and don't put anything back? Card hands, lottery draws, and quality-control sampling from a finished batch all fit this pattern. This calculator computes exact, at-most, and at-least probabilities along with the distribution's mean and standard deviation, so you can go from population, successes, and sample size straight to a usable probability.
How the hypergeometric formula works
The hypergeometric PMF, P(X = k) = C(K,k)·C(N−K, n−k) / C(N,n), is a ratio of combination counts rather than a product of probabilities. The numerator counts every way to build a sample with exactly k successes: C(K,k) ways to choose which successes are included, times C(N−K, n−k) ways to fill the rest of the sample with non-successes. The denominator, C(N,n), is the total number of equally-likely samples of size n you could draw from the whole population, regardless of how many successes they contain. Dividing the favorable count by the total count gives the exact probability — the same combinatorial logic behind card-hand probabilities in poker and bridge.
Inputs and what they mean
Population size (N) is the total number of items available, and must be a whole number this calculator supports up to 1,000 for numerical stability. Successes in population (K) is how many of those N items count as a 'success' — it must be between 0 and N. Sample size (n) is how many items you draw at once without replacement, also between 0 and N. Observed successes (k) is the count you're asking about, and its valid range is narrower than 0-to-n: k can't exceed K (there aren't more successes to draw than exist) and can't be so low that it would require more failures than actually exist in the population. The comparison type works exactly like the binomial calculator — exactly, at most, or at least — but always operating over this population-constrained range.
Hypergeometric vs. binomial: when each applies
Both distributions count successes across repeated draws, but they answer different sampling setups. The binomial distribution assumes you sample with replacement (or from an effectively infinite population), so every draw is independent and the success probability p never changes. The hypergeometric distribution assumes you sample without replacement from a known, finite population, so each draw changes the odds for the next one — pulling a heart from a deck makes the next heart slightly less likely. As a rule of thumb, when the sample size n is small relative to the population size N (roughly n/N below 5%), the two distributions give very similar answers and the simpler binomial formula is often used as an approximation. When N is small or n is a large fraction of N — a 5-card poker hand from a 52-card deck, for instance — the difference matters and the hypergeometric formula is the correct one.