Probability Distributions

Hypergeometric Distribution Calculator

Use this hypergeometric distribution calculator to find exact and cumulative probabilities when sampling without replacement from a finite population. Enter the population size, number of successes in the population, sample size, and number of successes in the sample to get an instant answer with a clear step-by-step solution.

Enter the total number of items in the population.
Enter the number of items classified as successes.
Enter the number of items selected without replacement.
Enter the number of successes in the sample.

How to Use the Hypergeometric Distribution Calculator

This calculator allows you to find the probability of getting a certain number of successes when selecting a sample from a finite population without replacement.

To use the calculator:

  1. Enter the population size, N.
  2. Enter the number of successes in the population, K.
  3. Enter the sample size, n.
  4. Enter the number of successes in the sample, x. For a between probability, enter the lower and upper number of successes.
  5. Select the probability you want to find.
  6. Choose the number of decimal places for the final answer.
  7. Click Calculate.

The calculator returns the requested probability and shows how it was calculated step by step. It also provides the mean and standard deviation of the hypergeometric distribution.

With this calculator, you can calculate:

  • Probability that exactly x successes occur, P(X = x)
  • Probability that at most x successes occur, P(X ≤ x)
  • Probability that fewer than x successes occur, P(X < x)
  • Probability that at least x successes occur, P(X ≥ x)
  • Probability that more than x successes occur, P(X > x)
  • Probability that between a and b successes occur, P(a ≤ X ≤ b)

What Is a Hypergeometric Distribution?

A hypergeometric distribution is a discrete probability distribution used to find the probability of getting a certain number of successes when a sample is selected without replacement from a finite population.

For example, suppose a box contains 20 light bulbs, including 5 defective bulbs. If you randomly select 4 bulbs without putting any of them back, the number of defective bulbs in the sample follows a hypergeometric distribution.

In this example:

  • The population contains 20 bulbs.
  • Five of the bulbs are classified as successes because they are defective.
  • Four bulbs are sampled.
  • X represents the number of defective bulbs selected.

The word success does not necessarily mean something good. In probability problems, a success simply means the item or outcome you are interested in counting.

When Should You Use the Hypergeometric Distribution?

You should use the hypergeometric distribution when:

  • you have a finite population;
  • the population contains two types of items, which can be classified as successes and failures;
  • you select a fixed-size sample;
  • items are sampled without replacement; and
  • X represents the number of successes selected in the sample.

Sampling without replacement is the key feature. Once an item is selected, it cannot be selected again. As a result, the probability of success can change from one draw to the next.

Common examples include:

  • selecting defective products from a shipment;
  • drawing cards from a deck without replacing them;
  • selecting students from a class;
  • auditing records from a fixed collection;
  • choosing winning tickets from a finite set.

Hypergeometric Distribution Formula

The hypergeometric distribution formula is:

Hypergeometric distribution formula

Where:

  • N is the population size;
  • K is the number of successes in the population;
  • n is the sample size;
  • x is the number of successes in the sample;
  • (Kx)\binom{K}{x} is the number of ways to choose x successes from the K available successes;
  • (NKnx)\binom{N-K}{n-x} is the number of ways to choose the remaining items from the failures;
  • (Nn)\binom{N}{n} is the total number of ways to choose n items from the population.

This is the standard probability mass function for a hypergeometric random variable. Thus, the formula helps us find the probability of selecting exactly x successes.

How to Identify N, K, n, and x

Before using the formula or calculator, it is important to identify the four values correctly.

Suppose a shipment contains 30 laptops, of which 8 are defective. A quality inspector randomly selects 6 laptops without replacement and wants the probability that exactly 2 are defective.

From the question:

  • Population size, N = 30
  • Successes in the population, K = 8
  • Sample size, n = 6
  • Successes in the sample, x = 2

A simple way to remember the notation is:

  • N = everything in the population
  • K = successes in the population
  • n = everything selected in the sample
  • x = successes selected in the sample

Exact and Cumulative Hypergeometric Probabilities

An exact probability finds the probability of selecting one specific number of successes. For example, P(X = 2) means exactly 2 successes are selected.

On the other hand, a cumulative probability combines several possible values of X.

The most common probability statements are:

  • Exactly x: P(X = x)
  • At most x: P(X ≤ x)
  • Less than x: P(X < x)
  • At least x: P(X ≥ x)
  • More than x: P(X > x)
  • Between a and b: P(a ≤ X ≤ b)

For example, P(X ≤ 2) means: P(X = 0) + P(X = 1) + P(X = 2)

Similarly, P(X ≥ 2) means adding all possible probabilities beginning at X = 2.

Unlike the geometric distribution, most cumulative hypergeometric probabilities are found by adding the required exact probabilities.

How to Calculate Hypergeometric Probability

To calculate a hypergeometric probability manually, first identify the population size (N), number of successes in the population (k), sample size (n), and required number of successes (x).

For an exact probability, substitute these values directly into the hypergeometric probability formula. However, for a cumulative probability, identify all values of X that satisfy the probability statement, calculate their individual probabilities, and add them.

Example 1: Exact Hypergeometric Probability

A warehouse has 25 electronic devices, of which 6 are defective. An inspector randomly selects 5 devices without replacement. What is the probability that exactly 2 of the selected devices are defective?

Solution

From the question, we know that:

  • Population size, N = 25
  • Successes in the population, K = 6
  • Sample size, n = 5
  • Successes in the sample, x = 2

In this case, a success means selecting a defective device.

Since we need the probability of selecting exactly 2 defective devices, we need to find: P(X = 2)

Recall. The hypergeometric probability formula is:P(X=x)=(Kx)(NKnx)(Nn)P(X=x)= \frac{\binom{K}{x}\binom{N-K}{n-x}} {\binom{N}{n}}

Substituting N = 25, K = 6, n = 5, and x = 2 gives:P(X=2)=(62)(193)(255)P(X=2)= \frac{\binom{6}{2}\binom{19}{3}} {\binom{25}{5}}

Evaluating the combinations gives:

= (15 × 969) / 53,130

= 14,535 / 53,130

Hence, P(X =2)= 0.273574. This implies that the probability of selecting exactly 2 defective devices is approximately 0.2736, or 27.36%.

Example 2: Cumulative Hypergeometric Probability

A college computer lab has 20 laptops, of which 5 currently require maintenance. A technician randomly selects 4 laptops without replacement for inspection. What is the probability that at least 2 of the selected laptops require maintenance?

Solution

From the question, we know that:

  • Population size, N = 20
  • Successes in the population, K = 5
  • Sample size, n = 4
  • Successes in the sample, x = 2

“At least 2” means 2 or more.

Since the sample contains only 4 laptops, we need to find P(X ≥ 2

By definition, P(X ≥ 2) = P(X = 2) + P(X = 3) + P(X = 4)

First, calculate P(X = 2):P(X=2)=(52)(152)(204)P(X=2)= \frac{\binom{5}{2}\binom{15}{2}} {\binom{20}{4}}

= (10 × 105) / 4,845

= 1,050 / 4,845

P(X = 2) = 0.21672

Next:P(X=3)=(53)(151)(204)P(X=3)= \frac{\binom{5}{3}\binom{15}{1}} {\binom{20}{4}}

= (10 × 15) / 4,845

= 0.03096

Also,P(X=4)=(54)(150)(204)P(X=4)= \frac{\binom{5}{4}\binom{15}{0}} {\binom{20}{4}}

= (5 × 1) / 4,845

= 0.00103

Therefore, P(X ≥ 2) = 0.21672 + 0.03096 + 0.00103

= 0.24871

This implies that the probability that at least 2 of the 4 selected laptops require maintenance is approximately 0.2487, or 24.87%.

Mean and Standard Deviation of a Hypergeometric Distribution

Besides the requested probability, the calculator also reports the mean and standard deviation of the hypergeometric distribution.

By definition, the mean of a hypergeometric distribution is: μ=nKN\mu = n\frac{K}{N}. It represents the expected number of successes in a sample of size n.

For example, if:

  • N = 25
  • K = 6
  • n = 5

We can calculate the mean of the hypergeometric distribution as follows:

μ = 5 × (6 / 25)

= 1.2

Therefore, the expected number of successes in samples of size 5 is 1.2.

The variance of a hypergeometric distribution is:

variance of a hypergeometric distribution formula

and the standard deviation is:

standard deviation of hypergeometric distribution formula

The factor (Nn)/(N1)(N-n)/(N-1) accounts for sampling without replacement from a finite population. It is also called the finite population correction.

Hypergeometric Distribution vs. Binomial Distribution

The hypergeometric and binomial distributions both count the number of successes in a sample or set of trials, but the sampling process is different.

The easiest way to tell them apart is to ask: Are the selected items replaced?

If sampling is from a finite population but without replacement, then you should use a hypergeometric distribution. However, if the trials are independent and the probability of success remains constant from one trial to the next, you should use a binomial distribution.

Common Mistakes When Calculating Hypergeometric Probability

Avoid these common mistakes:

  • Using the wrong population size. N is the total number of items before sampling begins.
  • Confusing K and x. K is the number of successes in the entire population, while x is the number of successes you want in the sample.
  • Confusing N and n. N is the population size, while n is the sample size.
  • Using the hypergeometric distribution when sampling with replacement. The hypergeometric model is designed for sampling without replacement.
  • Confusing at least and more than. P(X ≥ 2) includes 2, while P(X > 2) does not.
  • Confusing at most and less than. P(X ≤ 2) includes 2, while P(X < 2) does not.
  • Ignoring impossible values of x. The number of successes selected cannot exceed the number of successes available in the population or the sample size.

Frequently Asked Questions

What is a hypergeometric distribution calculator?

It is an online tool used to calculate probabilities when a fixed-size sample is selected without replacement from a finite population containing a known number of successes. This calculator finds exact and cumulative probabilities such as P(X = x), P(X ≤ x), P(X < x), P(X ≥ x), P(X > x), and P(a ≤ X ≤ b), and also provides the mean, standard deviation, and a step-by-step solution.

What do N, K, n, and x mean in a hypergeometric distribution?

N is the population size, K is the number of successes in the population, n is the sample size, and x is the number of successes selected in the sample.

What does sampling without replacement mean?

Sampling without replacement means that once an item is selected, it is not returned to the population before the next item is selected. Therefore, the same item cannot be selected twice.

What is the difference between hypergeometric and binomial probability?

The main difference is replacement and independence. Hypergeometric probability is used for sampling without replacement, so probabilities can change after each selection. However, binomial probability assumes a constant probability of success across independent trials.

Cite

Choose APA, MLA, Chicago, or Harvard, then copy the citation.

Mburu, J.. (2026, August 31). Hypergeometric Distribution Calculator. StatCalc.net. Retrieved September 11, 2026, from https://statcalc.net/hypergeometric-distribution-calculator/

Joseph Mburu

About This Calculator

Prepared by Joseph Mburu · Updated on

Joseph is an applied statistician and data analyst with over 6 years of experience helping students, researchers, and professionals solve statistics and data analysis problems. He holds a degree in Applied Statistics and a Master’s degree in Data…

We aim to keep our calculators accurate, easy to use, and helpful for learning. Always check that your inputs match the assumptions of the method you are using.