Hypergeometric Distribution Calculator - PMF, Mean, Variance, and Range
Use this hypergeometric distribution calculator to compute exact, cumulative, mean, variance, and standard deviation for any finite population sample.
Hypergeometric Distribution Calculator
Results
What Is a Hypergeometric Distribution Calculator?
A hypergeometric distribution calculator computes probabilities for samples drawn without replacement from a finite population where each item is either a success or a non-success. Use it whenever your population is small enough that removing one item changes the odds of the next draw, such as card hands, lot inspections, or committee selections.
- • Card Probability: Find the chance of a specific number of aces, kings, or face cards in a dealt hand.
- • Quality Control Lots: Estimate the probability of zero or few defectives in an acceptance sample from a finite shipment.
- • Committee Selection: Compute the probability of choosing a target number of women, veterans, or qualified candidates from a small applicant pool.
- • Genetics and Sampling: Estimate the probability of drawing k carriers of a trait when sampling from a population with a known carrier count.
Hypergeometric probabilities are exact for finite populations, which is why they appear in classical card problems and in acceptance sampling where you inspect a subset of a finite lot. Because each draw changes the population, you cannot reuse the binomial rule of multiplying the same success probability across all draws.
According to StatTrek, the hypergeometric distribution applies when samples are drawn without replacement from a finite population, which is the key reason it differs from the binomial distribution.
The hypergeometric distribution calculator reports exact probability, the at-most and at-least cumulative probabilities, and the full distribution mean and variance so you can describe how spread out the sample is.
When draws are independent and the success chance stays fixed across trials, Binomial Distribution Calculator handles the related case where replacement or a stable probability applies.
How the Hypergeometric Distribution Calculator Works
The calculator evaluates the hypergeometric PMF for the four inputs and reports exact, cumulative, and summary statistics in one step.
- N: Total size of the population you are sampling from.
- K: Number of success items in the population.
- n: Number of items you draw without replacement.
- k: Number of successes you want in the sample.
The cumulative probability P(X <= k) sums PMF values from the minimum reachable k up to the chosen k. The mean is n times K over N and the variance multiplies the binomial-style n p (1 - p) by the finite population correction (N - n) / (N - 1), which approaches 1 when N is large relative to n.
The standard deviation is the square root of the variance and is shown so you can quickly estimate a typical spread around the mean for typical sample sizes.
Worked Example: 5-Card Poker Hand With 1 Ace
Population N = 52 standard playing cards, K = 4 aces, sample n = 5 cards, target k = 1 ace.
P(X = 1) = [C(4, 1) * C(48, 4)] / C(52, 5) = (4 * 194,580) / 2,598,960 = 0.2995.
P(X = 1) = 0.2995, Mean = 0.3846, Variance = 0.3272, Std Dev = 0.5720.
About 30 percent of 5-card hands contain exactly one ace. The mean of about 0.38 aces per hand reflects the rarity of being dealt an ace in any single hand.
According to NIST/SEMATECH Engineering Statistics Handbook, the hypergeometric distribution gives the probability of k successes in n draws from a finite population of N containing K successes, with mean nK/N and variance n(K/N)(1-K/N)(N-n)/(N-1).
Once you have the variance and standard deviation, Statistics Calculator is a quick way to convert them into z-scores, quartiles, or other descriptive metrics for the same dataset.
Key Concepts Explained
These four ideas show up in every hypergeometric problem and decide which formula to use.
Sampling Without Replacement
Each draw changes the population because the drawn item is not returned, so the success probability on the next draw depends on what was already drawn. This is the defining feature of the hypergeometric distribution.
Finite Population Correction
The factor (N - n) / (N - 1) reduces the variance relative to the binomial version because sampling a noticeable fraction of a finite population leaves less remaining variability. When N is much larger than n, this factor approaches 1.
Reachable Range of k
k cannot exceed either K (the population successes) or n (the sample size), and it cannot be less than n - (N - K). Values outside this range have probability zero, which is why the calculator clamps the cumulative sums.
Contrast With the Binomial
The binomial uses a fixed success probability on every trial, while the hypergeometric updates the probability after each draw. They give nearly identical answers when the sample is a small fraction of the population.
These concepts come straight from standard probability references and apply equally to textbook problems, real acceptance sampling plans, and Monte Carlo simulations.
The PMF uses three combinations, so Binomial Coefficient Calculator is handy when you want to verify the C(N, n) denominator or the C(K, k) and C(N - K, n - k) numerators by hand.
How to Use This Calculator
Enter the four population parameters and the calculator updates the probabilities and summary statistics in real time.
- 1 Enter the population size N: Type the total number of items you are sampling from, such as 52 for a deck of cards or 20 for a small lot.
- 2 Enter the number of successes K: Type how many items in the population count as successes, such as 4 aces or 3 defectives.
- 3 Enter the sample size n: Type the number of items you draw without replacement, such as 5 cards or 10 inspected units.
- 4 Enter the target successes k: Type the number of successes you want to see in the sample, such as 1 ace or 0 defectives.
- 5 Read the exact and cumulative probabilities: The P(X = k) result answers 'how likely is exactly this outcome', while P(X <= k) and P(X >= k) answer 'at most' and 'at least' questions.
- 6 Use the mean and variance for planning: The mean and standard deviation tell you how many successes to expect on average and how much typical variation to plan around.
To answer 'how likely is it that a 5-card hand has at most one ace', enter N=52, K=4, n=5, k=1 and read P(X<=1) which sums the probabilities of zero and one ace in the hand.
When you want to communicate the spread in real-world units rather than variance, Standard Deviation Calculator can convert the reported sigma into percentile thresholds for the same sample.
Benefits of Using This Calculator
These benefits focus on what you can do with the output that would be slow or error-prone to compute by hand.
- • Exact PMF Without Manual Combinations: Computes P(X = k) using combinations internally so you do not have to look up factorials or binomial tables for moderate N and n.
- • Cumulative and Range Probabilities: Reports P(X <= k), P(X >= k), and the implied range probabilities so you can answer 'at least', 'at most', and 'between' questions from a single input set.
- • Distribution Summary in One View: Shows the hypergeometric mean, variance, and standard deviation alongside the probabilities so you can describe the spread without recomputing it.
- • Valid-k Guard: Highlights impossible k values (above K or below the reachable minimum) so you do not accidentally treat zero probability as a calculation error.
- • Cross-Checks Hand Calculations: Verifies answers from textbook exercises, Monte Carlo scripts, and homework problems in seconds, including the classic 52-card hand cases.
- • Educational Walkthrough: Pairs each numeric result with the formula and finite population correction so statistics students can see why the numbers change with N and n.
All of these benefits come from one set of four inputs, which makes the calculator practical for quick checks during problem solving as well as for teaching a new topic.
If the question is instead 'how many trials until the first success' under a fixed success chance, Geometric Distribution Calculator is the matching discrete distribution for that scenario.
Factors That Affect Your Results
These factors determine how much the hypergeometric distribution shifts away from a simple binomial approximation.
Sampling Fraction (n / N)
When you sample a small fraction of the population, the hypergeometric PMF gets close to the binomial PMF. As n approaches N, the finite population correction shrinks the variance noticeably.
Success Density (K / N)
A small K / N shifts the distribution toward low counts and pushes the mean toward zero. A K / N near 0.5 spreads the probability mass across more k values.
Sample Size (n)
Larger samples spread the PMF across more k values and reduce the standard deviation per draw, but they also pull more weight from the finite population correction.
Integer Inputs
All four inputs are counts and must be whole numbers. Non-integer entries are rounded because the hypergeometric PMF is only defined for integer parameters.
Range of k
Out-of-range k values (above K or below the reachable minimum) return probability zero. The cumulative sums respect the same range and never report values below zero or above one.
- • When N is extremely large, the hypergeometric PMF approaches the binomial PMF. For very large N you can use the binomial formula with p = K / N as a fast approximation.
- • Floating point precision caps reliable factorial-based computations around N around 170. The calculator uses logarithmic combinations to keep results accurate well past that point.
These limitations are the same ones flagged by NIST and standard probability textbooks, so the reported values stay trustworthy across the typical ranges used in classroom problems and acceptance sampling plans.
According to Wikipedia (Hypergeometric distribution), P(X = k) = [C(K,k) C(N-K,n-k)] / C(N,n) when sampling without replacement, which is the canonical form used in probability textbooks.
According to StatTrek, the hypergeometric distribution applies when samples are drawn without replacement from a finite population, which is the key reason it differs from the binomial distribution.
If your problem involves waiting times between independent events rather than counts from a finite batch, Exponential Distribution Calculator covers the continuous-time analogue in the same discrete-to-continuous family of distributions.
Frequently Asked Questions
Q: What is the hypergeometric distribution formula?
A: The hypergeometric formula is P(X = k) = [C(K, k) * C(N - K, n - k)] / C(N, n), where N is the population size, K is the number of successes in the population, n is the sample size, and k is the target successes in the sample. The mean is nK / N and the variance is n(K/N)(1 - K/N)(N - n)/(N - 1).
Q: When should I use a hypergeometric distribution calculator?
A: Use a hypergeometric calculator when you sample from a finite population without replacement. Common cases include drawing cards from a deck, sampling from a small lot for quality control, selecting committees from a fixed applicant pool, and genetics problems where each draw changes the population.
Q: What is the difference between hypergeometric and binomial distributions?
A: Hypergeometric probability is for draws without replacement, so the success chance changes after each draw. Binomial probability is for independent trials with the same success chance each time. If the sample is a small fraction of the population, the two distributions give nearly identical numbers.
Q: How do I calculate hypergeometric cumulative probability P(X <= k)?
A: Add up P(X = i) for every reachable i from the minimum (max(0, n - (N - K))) up to and including k. The calculator does this summation automatically and also reports P(X >= k) and the implied range probabilities so you can answer at-most, at-least, and between questions.
Q: What do N, K, n, and k mean in hypergeometric notation?
A: N is the total population size, K is the number of successes in the population, n is the number of items drawn, and k is the number of successes you want to observe in your sample. All four must be whole numbers, with k bounded between max(0, n - (N - K)) and min(K, n).
Q: Can the hypergeometric distribution be used for card probability?
A: Yes. Card hands are the textbook hypergeometric example because cards are drawn without replacement. For a 5-card hand from a 52-card deck with 4 aces, N = 52, K = 4, n = 5, and k is the number of aces you want to evaluate, such as k = 1 for exactly one ace.