The hypergeometric distribution, intuitively, is the probability distribution of the number of red marbles drawn from a set of red and blue marbles, without replacement of the marbles. In contrast, the binomial distribution measures the probability distribution of the number of red marbles drawn with replacement of the marbles. It is useful for situations in which observed information cannot re-occur, such as poker (and other card games) in which the observance of a card implies it will not be drawn again in the hand. It is also applicable to many of the same situations that the binomial distribution is useful for, including risk management and statistical significance.
Consider a population and an attribute, where the attribute takes one of two mutually exclusive states and every member of the population is in one of those two states. For example, the attribute might be "over/under 30 years old," "is/isn't a lawyer," "passed/failed a test," and so on. Furthermore, the population will be sampled without replacement, meaning that the draws are not independent: each draw affects the next since each draw reduces the size of the population.
Given the size of the population and the number of people that have a desired attribute, the hypergeometric distribution measures the probability of drawing exactly people with the desired attribute over trials.
For example, if a bag of marbles is known to contain 10 red and 6 blue marbles, the hypergeometric distribution can be used to find the probability that exactly 2 of 3 drawn marbles are red.
If the population size is , the number of people with the desired attribute is , and there are draws, the probability of drawing exactly people with the desired attribute is
This formula can be derived by selecting of the possible successes in ways, then selecting of the possible failures in , and finally accounting for the total possible -person draws.
A bag of marbles contains 13 red marbles and 8 blue marbles. If five marbles are drawn from the bag, what is the resulting hypergeometric distribution?
Here, the population size is , there are objects with the desired attribute (redness), and there are 5 draws. The above formula then applies directly:
This can be represented pictorially:
A gambler shows you a box with 5 white and 2 black marbles in it. All the marbles are identical except for their color. He invites you to draw without replacement 3 marbles from the box while you are blindfolded, and you lose if you draw a black marble.
If you lose $10 for losing the game, how much should you get paid for winning it for your mathematical expectation to be zero (i.e. to make it a fair game)?
There are several important values that give information about a particular probability distribution. The most important are these:
- The mean, or expected value, of a distribution gives useful information about what average one would expect from a large number of repeated trials.
- The median of a distribution is another measure of central tendency, useful when the distribution contains outliers (i.e. particularly large/small values) that make the mean misleading.
- The mode of a distribution is the value that has the highest probability of occurring.
- The variance of a distribution measures how "spread out" the data is. Related is the standard deviation, the square root of the variance, useful due to being in the same units as the data.
Three of these values—the mean, mode, and variance—are generally calculable for a hypergeometric distribution. The median, however, is not generally determined.
The mean is intuitive, in the same sense that it is for a binomial distribution:
The mean of is
The mode is significantly more complex:
The mode of is
The variance is even more involved:
The variance of is
It is also worth noting that, as expected, the probabilities of each sum up to 1:
which is a consequence of Vandermonde's identity.
Additionally, the symmetry of the problem gives the following identity:
As mentioned in the introduction, card games are excellent illustrations of the hypergeometric distribution's use. Here is an example:
In the game of Texas Hold'em, players are each dealt two private cards, and five community cards are dealt face-up on the table. Each player makes the best 5-card hand they can with their two private cards and the five community cards. What is the probability that a particular player can make a flush of spades (i.e. 5 spades)?
This situation can be modeled by a hypergeometric distribution where the population size is 52 (the number of cards), the number of objects with the desired attribute (spades) is 13, and there are 7 draws. The player needs at least 5 successes, so the probability is
It can also be used once some information is already observed. Here is another example:
Bob is playing Texas Hold'em, and his two private cards are both spades. What is the probability he finishes with a flush of spades?
This situation can be modeled by a hypergeometric distribution where the population size is 50 (the number of remaining cards), the number of remaining objects with the desired attribute (spades) is 11, and there are 5 draws. The player needs at least 3 successes, so the probability is
The hypergeometric test is used to determine the statistical significance of having drawn objects with a desired property from a population of size with total objects that have the desired property. In other words, it tests to see whether a sample is truly random or whether it over-represents (or under-represents) a particular demographic.