Hypergeometric Distribution Calculator

Data Visualization

Hypergeometric Distribution Calculator

What is Hypergeometric Distribution?

The hypergeometric distribution is a discrete probability distribution that describes the probability of \(k\) successes in \(n\) draws, without replacement, from a finite population of size \(N\) that contains exactly \(K\) successes.

Formula and Its Meaning

The probability mass function of the hypergeometric distribution is given by:

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

Where:

  • \(N\) is the population size
  • \(K\) is the number of success states in the population
  • \(n\) is the number of draws (sample size)
  • \(k\) is the number of observed successes
  • \(\binom{a}{b}\) represents the binomial coefficient ("a choose b")

Calculation Steps

  1. Calculate \(\binom{K}{k}\): This represents the number of ways to choose \(k\) successes from \(K\) total successes.
  2. Calculate \(\binom{N-K}{n-k}\): This represents the number of ways to choose the remaining non-successes.
  3. Calculate \(\binom{N}{n}\): This represents the total number of ways to choose \(n\) items from \(N\).
  4. Divide the product of steps 1 and 2 by the result of step 3.

Example Calculation

Let's work through a practical example to understand the hypergeometric distribution better:

Problem: In a bag containing 20 marbles, 8 are red and 12 are blue. If we randomly draw 5 marbles without replacement, what is the probability of getting exactly 3 red marbles?

Given values:

  • Population size (\(N\)) = 20 marbles
  • Success in population (\(K\)) = 8 red marbles
  • Sample size (\(n\)) = 5 draws
  • Success in sample (\(k\)) = 3 red marbles

Solution:

\[P(X = 3) = \frac{\binom{8}{3} \binom{12}{2}}{\binom{20}{5}} = \frac{56 \cdot 66}{15504} \approx 0.2378 \text{ or } 23.78\%\]

Visual Representation

Population Success (8/20) Sample Success (3/5)

This diagram represents our example. The large circle represents the total population of 20 marbles, with the blue section showing the 8 red marbles. The smaller circle represents our sample of 5 draws, with the green section showing the 3 successful draws of red marbles.