Hypergeometric Distribution Calculator

statistical-calculators.site

How to Use This Calculator

Step 1: Enter Your Parameters

Step 2: Click "Calculate"

The calculator will instantly show you:

Step 3: Export Your Results

Use the buttons below the results to:

💡 Quick Tip: The calculator automatically determines the valid range for k (number of successes in your sample). If you enter values for 'a' or 'b' outside this range, you'll see a warning, but the calculation will still proceed.

Understanding the Hypergeometric Distribution

The Hypergeometric Distribution is a discrete probability distribution that describes the probability of \(k\) successes in a sample of size \(n\) drawn without replacement from a finite population of size \(N\) that contains exactly \(K\) objects with a certain feature (successes).

Difference from Binomial Distribution

The key distinction is the "without replacement" condition. In a Binomial distribution, trials are independent, and the probability of success is constant. In a Hypergeometric distribution, each draw is dependent on the previous ones because the population size decreases, changing the probability of success for subsequent draws.

The Hypergeometric Formula

The probability of getting exactly \(k\) successes is given by the Probability Mass Function (PMF):

$$P(X=k) = \frac{\binom{K}{k} \binom{N-K}{n-k}}{\binom{N}{n}}$$

Where:

Mean / Expected Value: \(E[X] = n \frac{K}{N}\)

Variance: \(Var[X] = n \frac{K}{N} (1-\frac{K}{N}) \frac{N-n}{N-1}\). The last term, \(\frac{N-n}{N-1}\), is the finite population correction factor.

Examples with Step-by-Step Answers

Example 1: Quality Control

Problem: A batch of 20 items contains 5 defectives. If you randomly select 4 items without replacement, what is the probability that exactly 1 of them is defective?

1. Identify the parameters:

  • Population size, \(N = 20\)
  • Successes in population (defectives), \(K = 5\)
  • Sample size, \(n = 4\)
  • Successes in sample, \(k = 1\)

2. Apply the formula:

$$P(X=1) = \frac{\binom{5}{1} \binom{20-5}{4-1}}{\binom{20}{4}} = \frac{\binom{5}{1} \binom{15}{3}}{\binom{20}{4}}$$

3. Calculate the combinations: \(\binom{5}{1}=5\), \(\binom{15}{3}=455\), \(\binom{20}{4}=4845\).

4. Combine the results: \(P(X=1) = \frac{5 \times 455}{4845} = \frac{2275}{4845} \approx 0.4696\)

Answer: There is a 46.96% chance of selecting exactly 1 defective item.

Example 2: Card Game

Problem: From a standard 52-card deck, you are dealt a 5-card hand. What is the probability that your hand contains exactly 2 aces?

1. Identify the parameters:

  • Population size (cards in deck), \(N = 52\)
  • Successes in population (aces), \(K = 4\)
  • Sample size (cards in hand), \(n = 5\)
  • Successes in sample, \(k = 2\)

2. Apply the formula:

$$P(X=2) = \frac{\binom{4}{2} \binom{52-4}{5-2}}{\binom{52}{5}} = \frac{\binom{4}{2} \binom{48}{3}}{\binom{52}{5}}$$

3. Calculate the combinations: \(\binom{4}{2}=6\), \(\binom{48}{3}=17296\), \(\binom{52}{5}=2598960\).

4. Combine the results: \(P(X=2) = \frac{6 \times 17296}{2598960} = \frac{103776}{2598960} \approx 0.0399\)

Answer: The probability of getting exactly 2 aces in a 5-card hand is about 3.99%.