Hypergeometric Distribution Calculator

Multivariate hypergeometric distribution calculator

–

Population N
–
Sample n
–
Favourable samples
–
All samples
–

Population vs your sample

share of each category

Each category on its own

marginal distributions, your count highlighted

How multivariate hypergeometric distribution calculator works?

The multivariate hypergeometric distribution calculator reads the size Kᵢ and the wanted count kᵢ of every category, then returns the exact probability of drawing that combination without replacement.

  1. List categories2 or more groups, for example red, blue and green marbles.
  2. Set KᵢItems in each category; the total is the population N.
  3. Set kᵢItems wanted from each category; the total is the sample size n.
  4. Multiply and divideProduct of C(Kᵢ, kᵢ) divided by C(N, n).
  5. ComparePopulation vs sample bars and one marginal chart per category.
How the multivariate hypergeometric distribution calculator works

Multivariate hypergeometric distribution formula

The multivariate hypergeometric distribution formula is P(X₁ = k₁, …, Xm = km) = C(K₁, k₁) · C(K₂, k₂) · … · C(Km, km) / C(N, n), with N = ΣKᵢ and n = Σkᵢ.

P(2 red, 1 blue, 1 green)=C(5, 2)×C(4, 1)×C(3, 1)÷C(12, 4)
= 120 / 495 = 0.242424
  • C(5, 2)Ways to pick 2 of the 5 red marbles = 10
  • C(4, 1)Ways to pick 1 of the 4 blue marbles = 4
  • C(3, 1)Ways to pick 1 of the 3 green marbles = 3
  • C(12, 4)All 4-marble samples from 12 marbles = 495

Multivariate hypergeometric distribution calculator FAQ

What is a multivariate hypergeometric distribution?

The multivariate hypergeometric distribution gives the probability of drawing an exact count from each of 3 or more categories, without replacement, from a finite population. It extends the hypergeometric distribution from 2 categories (success and failure) to m categories.

How do you calculate a multivariate hypergeometric probability?

Multiply C(Kᵢ, kᵢ) for every category and divide by C(N, n). Drawing 2 red, 1 blue and 1 green marble from 5 red, 4 blue and 3 green gives C(5,2) · C(4,1) · C(3,1) / C(12,4) = 120 / 495 = 0.242424.

What is the probability of a 2-2-1 suit split in poker?

The probability of 2 hearts, 2 spades and 1 club in a 5-card hand is 0.030432, from C(13,2) · C(13,2) · C(13,1) · C(13,0) / C(52,5) = 79,092 / 2,598,960.

How do you compute a multivariate hypergeometric distribution in R or Python?

In Python, call scipy.stats.multivariate_hypergeom.pmf(x=[2,1,1], m=[5,4,3], n=4), which returns 0.242424. In R, the extraDistr package offers dmvhyper(c(2,1,1), c(5,4,3), 4).