Opentopia Directory Encyclopedia Tools

Hypergeometric distribution

Encyclopedia : H : HY : HYP : Hypergeometric distribution


]| cdf =| mean =[nD\over N]| median =| mode =| variance =[n(D/N)(1-D/N)(N-n)\over (N-1)]| skewness =[\frac(N-2n)}(N-2)}]| kurtosis =[ [frac][frac+frac-6]]| entropy =| mgf =[\frac\,_2F_1(-n,-D;N-D-n+1;e^)]| char =[\frac\,_2F_1(-n,-D;N-D-n+1;e^)] }} In probability theory and statistics, the hypergeometric distribution is a discrete probability distribution that describes the number of successes in a sequence of n draws from a finite population without replacement.

drawn not drawn total
defective k D − k D
nondefective n − k N + k − n − D N − D
total n N − n N

A typical example is illustrated by the contingency table above: there is a shipment of N objects in which D are defective. The hypergeometric distribution describes the probability that in a sample of n distinctive objects drawn from the shipment exactly k objects are defective.

In general, if a random variable X follows the hypergeometric distribution with parameters N, D and n, then the probability of getting exactly k successes is given by

[ f(k;N,D,n) = \over }]
The probability is positive when k is between max and min.

The formula can be understood as follows: There are [ N \choose n ] possible samples (without replacement). There are [ D \choose k ] ways to obtain k defective objects and there are [ \choose ] ways to fill out the rest of the sample with non-defective objects.

When the population size is large compared to the sample size (i.e., N is much larger than n) the hypergeometric distribution is approximated reasonably well by a binomial distribution with parameters n (number of trials) and p = D / N (probability of success in a single trial).

The fact that the sum of the probabilities, as k runs through the range of possible values, is equal to 1, is essentially Vandermonde's identity from combinatorics.

Application and example

The classical application of the hypergeometric distribution is sampling without replacement. Think of an urn with two types of balls, black ones and white ones. Define drawing a white ball as a success and drawing a black ball as a failure (analogous to the binomial distribution). If the variable N describes the number of all balls in the urn (see contingency table above) and D describes the number of white balls (called defective in the example above), then N-D corresponds to the number of black balls.
Now, assume that there are 5 white and 45 black balls in the urn. Standing next to the urn, you close your eyes and draw 10 balls without replacement. What's the probability p (k=4) that you draw exactly 4 white balls (and - of course - 6 black balls) ?

This problem is summarized by the following contingency table:

drawn not drawn total
white balls 4 (k) 1 = 5 - 4 (D-k)5 (D)
black balls 6 = 10 - 4 (n − k) 39 = 50 + 4 - 10 - 5 (N + k − n − D) 45 (N − D)
total 10 (n)40 (N − n) 50 (N)

The probability p (k=x) of drawing exactly x white balls (= number of successes) can be calculated by the formula

[ p(k=x) = f(k;N,D,n) = \over }]
Hence, in this example x is 4 you calculate

[ p(k=4) = f(4;50,5,10) = \over } = 0.003964583 ]
So, the probability of drawing exactly 4 white balls is quite low (approximately 0.004) and the event is very unlikely. It means, if you repeated your random experiment (drawing 10 balls from the urn of 50 balls without replacement) 1000 times you just would expect to obtain such a result 4 times.
O.k., fine. But what about the probability of drawing even (all) 5 white balls? You intuitively will agree upon that this is even more unlikely than drawing 4 white balls. Well, let's calculate the probability for such an extreme event.

The contingeny table is as follows:

drawn not drawn total
white balls 5 (k) 0 = 5 - 5 (D-k)5 (D)
black balls 5 = 10 - 5 (n − k) 40 = 50 + 5 - 10 - 5 (N + k − n − D) 45 (N − D)
total 10 (n)40 (N − n) 50 (N)

And you can calculate the probability as follows (notice that the denominator always stays the same):

[ p(k=5) = f(5;50,5,10) = \over } = 0.0001189375 ]
You were right, as expected, the probability of drawing 5 white balls is even much lower than drawing 4 white balls.

Conclusion:
Consequently, one could expand the initial question as follows: If you draw 10 balls from an urn (containing 5 white and 45 black balls), what's the probability of drawing at least 4 white balls? Or, what's the probability of drawing 4 white balls and more extreme outcomes such as drawing 5)? This corresponds to calculating the cumulative probability p(k>=4) and can be calculated by the cumulative distribution function (cdf). Since the hypergeometric distribution is a discrete probablity distribution the cumulative probability can be calculated easily by adding all corresponding single probability values.

In our example you just have to sum-up p(k=4) and p(k=5):

p(k>=4) = 0.003964583 + 0.0001189375 = 0.004083520

You can easily re-calculate the example given above with the [hypergeometric distribution calculator] (see also link below) or the free [statistical programming language R] which is sometimes also called GNU_S:
The code snippets for [R] are as follows:
p(k=4): type

choose (5,4) * choose (45,6) / choose (50,10)

p(k=5): type
choose (5,5) * choose (45,5) / choose (50,10)
or alternatively,
dhyper(5, m=5, n=45, k=10)


p(k>=4): type
phyper(q=3, m=5, n=45, k=10, lower.tail = FALSE)

Explanation:
q : number of white balls drawn [k in the contingency table]
m : number of white balls (total) [D in the contingency table]
n : number of black balls (total) [N - D in the contingency table]
k : number of balls drawn (total) [n in the contingency table]
lower.tail = FALSE : if lower.tail is set TRUE, than p(k<=x) is calculated; if set to FALSE, p(k>x) is calculated --> in order to calculate p(k>=4) you have to calculate p(k>3)

If n is much smaller than min (D, N-D), then the hypergeometric distribution approaches the binomial distribution. In other word: this is the case when the number of balls drawn from the urn is clearly smaller than both the number of black and white balls. Roughly speaking, sampling with or without replacement is almost identical in large populations.

Symmetries

[ f(k;N,D,n) = \over } = f(n-k;N,N-D,n)]
This symmetry can be intuitively understood if you repaint all the black balls to white and vice versa, thus the black and white balls simply change roles.

[ f(k;N,D,n) = f(k;N,n,D) ]
This symmetry can be intuitively understood if instead of drawing balls, you label the balls that you would have drawn. Both expressions give the probability that exactly k balls are "black" and labeled "drawn"

Relationship to Fisher's exact test

The test (see above) based on the hypergeometric distribution (hypergeometric test) is identical to the corresponding one-tailed version of Fisher's exact test. Reciprocally, the p-value of a two-sided Fisher's exact test can be calculated as the sum of two appropriate hypergeometric tests (for more information see the following [web site]).

Related distributions

External links

Probability distributions  [ view][ talk][ edit] 
Univariate Multivariate
Discrete: BernoullibinomialBoltzmanncompound PoissondegeneratedegreeGauss-Kuzmingeometrichypergeometriclogarithmicnegative binomialparabolic fractalPoissonRademacherSkellamuniformYule-SimonzetaZipfZipf-Mandelbrot Ewensmultinomial
Continuous: BetaBeta primeCauchychi-squareexponentialexponential powerFfadingFisher's zFisher-TippettGammageneralized extreme valuegeneralized hyperbolicgeneralized inverse GaussianHotelling's T-squarehyperbolic secanthyper-exponentialhypoexponentialinverse chi-squareinverse gaussianinverse gammaKumaraswamyLandauLaplaceLévyLévy skew alpha-stablelogisticlog-normalMaxwell-BoltzmannMaxwell speednormal (Gaussian)ParetoPearsonpolarraised cosineRayleighrelativistic Breit-WignerRiceStudent's ttriangulartype-1 Gumbeltype-2 GumbeluniformVoigtvon MisesWeibullWigner semicircle DirichletKentmatrix normalmultivariate normalvon Mises-FisherWigner quasiWishart
Miscellaneous: Cantorconditionalexponential family • infinitely divisible • location-scale familymarginalmaximum entropyphase-typeposteriorpriorquasisampling

 


From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.

Search Titles
0123456789
ABCDEFGHIJ
KLMNOPQRST
UVWXYZ?

E-mail this article to:

Personal Message: