In probability theory and statistics, the hypergeometric distribution is a discrete probability distribution that describes the probability of k successes (random draws for which the object drawn has a specified feature) in n draws, without replacement, from a finite population of size N that contains exactly K objects with that feature, where in each draw is either a success or a failure. In contrast, the binomial distribution describes the probability of k successes in n draws with replacement.
Definitions
Probability mass function The following conditions characterize the hypergeometric distribution:
The result of each draw (the elements of the population being sampled) can be classified into one of two mutually exclusive categories (e.g. Pass/Fail or Employed/Unemployed). The probability of a success changes on each draw, as each draw decreases the population (sampling without replacement from a finite population). A random variable X follows the hypergeometric distribution if its probability mass function (pmf) is given by
pX(k)=Pr(X=k)=(Kk)(N−Kn−k)(Nn), where
N is the population size, K is the number of success states in the population, n is the number of draws (i.e. quantity drawn in each trial), k is the number of observed successes, (ab) is a binomial coefficient. The pmf is positive when max(0,n+K−N)≤k≤min(K,n). A random variable distributed hypergeometrically with parameters N, K and n is written X∼Hypergeometric(N,K,n) and has probability mass function pX(k) above.
Combinatorial identities As required, we have
∑0≤k≤min(n,K)(Kk)(N−Kn−k)(Nn)=1, which essentially follows from Vandermonde's identity from combinatorics. Also note that
(Kk)(N−Kn−k)(Nn)=(nk)(N−nK−k)(NK); This identity can be shown by expressing the binomial coefficients in terms of factorials and rearranging the latter. Additionally, it follows from the symmetry of the problem, described in two different but interchangeable ways. For example, consider two rounds of drawing without replacement. In the first round, K out of N neutral marbles are drawn from an urn without replacement and coloured green. Then the colored marbles are put back. In the second round, n marbles are drawn without replacement and colored red. Then, the number of marbles with both colors on them (that is, the number of marbles that have been drawn twice) has the hypergeometric distribution. The symmetry in K and n stems from the fact that the two rounds are independent, and one could have started by drawing n balls and colouring them red first. Note that we are interested in the probability of k successes in n draws without replacement, since the probability of success on each trial is not the same, as the size of the remaining population changes as we remove each marble. Keep in mind not to confuse with the binomial distribution, which describes the probability of k successes in n draws with replacement.
Properties
Working example The classical application of the hypergeometric distribution is sampling without replacement. Think of an urn with two colors of marbles, red and green. Define drawing a green marble as a success and drawing a red marble as a failure. Let N describe the number of all marbles in the urn (see contingency table below) and K describe the number of green marbles, then N − K corresponds to the number of red marbles. Now, standing next to the urn, you close your eyes and draw n marbles without replacement. Define X as a random variable whose outcome is k, the number of green marbles drawn in the experiment. This situation is illustrated by the following contingency table:
Indeed, we are interested in calculating the probability of drawing k green marbles in n draws, given that there are K green marbles out of a total of N marbles. For this example, assume that there are 5 green and 45 red marbles in the urn. Standing next to the urn, you close your eyes and draw 10 marbles without replacement. What is the probability that exactly 4 of the 10 are green? This problem is summarized by the following contingency table:
To find the probability of drawing k green marbles in exactly n draws out of N total draws, we identify X as a hyper-geometric random variable to use the formula P(X=k)=f(k;N,K,n)=(Kk)(N−Kn−k)(Nn). To intuitively explain the given formula, consider the two symmetric problems represented by the identity (Kk)(N−Kn−k)(Nn)=(nk)(N−nK−k)(NK)
left-hand side - drawing a total of only n marbles out of the urn. We want to find the probability of the outcome of drawing k green marbles out of K total green marbles, and drawing n-k red marbles out of N-K red marbles, in these n rounds. right hand side - alternatively, drawing all N marbles out of the urn. We want to find the probability of the outcome of drawing k green marbles in n draws out of the total N draws, and K-k green marbles in the rest N-n draws. Back to the calculations, we use the formula above to calculate the probability of drawing exactly k green marbles
P(X=4)=f(4;50,5,10)=(54)(456)(5010)=5⋅814506010272278170=0.003964583…. Intuitively we would expect it to be even more unlikely that all 5 green marbles will be among the 10 drawn.
P(X=5)=f(5;50,5,10)=(55)(455)(5010)=1⋅122175910272278170=0.0001189375…, As expected, the probability of drawing 5 green marbles is roughly 35 times less likely than that of drawing 4.
Symmetries Swapping the roles of green and red marbles:
f(k;N,K,n)=f(n−k;N,N−K,n) Swapping the roles of drawn and not drawn marbles:
f(k;N,K,n)=f(K−k;N,K,N−n) Swapping the roles of green and drawn marbles:
f(k;N,K,n)=f(k;N,n,K) These symmetries generate the dihedral group D4.
Order of draws The probability of drawing any set of green and red marbles (the hypergeometric distribution) depends only on the numbers of green and red marbles, not on the order in which they appear; i.e., it is an exchangeable distribution. As a result, the probability of drawing a green marble in the ith draw is
P(Gi)=KN. This is an ex ante probability—that is, it is based on not knowing the results of the previous draws.
Tail bounds Let X∼Hypergeometric(N,K,n) and p=K/N. Then for 0<t<K/N we can derive the following bounds:
Pr[X≤(p−t)n]≤e−nD(p−t∥p)≤e−2t2nPr[X≥(p+t)n]≤e−nD(p+t∥p)≤e−2t2n where
… excerpt ends here. Continue reading the full article.



