Definition
X∼H(n,K,N), X is said to obey the hypergeometric distribution.
P(X=k)=CNnCKkCN−Kn−k(k=0,1,2,...,n)
Preliminary knowledge
Commonly used combined identities
- Cnk=knCn−1k−1=k(k−1)n(n−1)Cn−2k−2=...
- ∑k=0rCmkCnr−k=Cm+nr
Proof 1:
Cnk=k!(n−k)!n!=kn(k−1)![(n−1)−(k−1)]!(n−1)!=knCn−1k−1=k(k−1)n(n−1)Cn−2k−2
Proof 2:
Consider this scenario: select r people (r≤minm,n) among m boys and n girls. It is not difficult to find that 2 is the result of counting twice.
To add, 2 is exactly the famous Vandermonde Identity
Properties of random variables
D(X)=E(X2)−[E(X)]2
Starting from the definition of variance: D(X)=i=0∑npi[Xi−E(X)]2=i=0∑n(piXi2)−2E(X)i=0∑n(piXi)+[E(X)]2=E(X2)−[E(X)]2
Properties
- E(X)=nNK
- D(X)=nNKNN−KN−1N−n
E(X)=i=0∑n[P(X=i)i]=i=0∑n[CNnCKiCN−Kn−ii]apply combinatorial identity 1 to eliminate i=i=1∑n[iKCNnCK−1i−1CN−Kn−ii]=Ki=1∑n[CNnCK−1i−1CN−Kn−i]apply combinatorial identity 2=CNnKCN−1n−1apply combinatorial identity 1=NnK
E(X2)=i=0∑n[P(X=i)i2]=i=0∑n[CNnCKiCN−Kn−ii2]apply combinatorial identity 1 to eliminate i=Ki=1∑n[CNnCK−1i−1CN−Kn−ii]=Ki=1∑n[(i−1+1)CNnCK−1i−1CN−Kn−i]=Ki=1∑n[(i−1)CNnCK−1i−1CN−Kn−i+CNnCK−1i−1CN−Kn−i]apply combinatorial identity 2=Ki=1∑n[(i−1)CNnCK−1i−1CN−Kn−i]+KCNnCN−1n−1=Ki=1∑n[(i−1)CNnCK−1i−1CN−Kn−i]+NKnapply combinatorial identity 1 to eliminate i−1=Ki=2∑n[(K−1)CNnCK−2i−2CN−Kn−i]+NKnapply combinatorial identity 2=K[(K−1)CNnCN−2n−2]+NKn=K(K−1)N(N−1)n(n−1)+NKn=NKn[N−1(K−1)(n−1)+1]D(X)=E(X2)−[E(X)]2=NKn[N−1(K−1)(n−1)+1]−(NKn)2=NKn[N(N−1)N2−(K+n)N+Kn]=nNKNN−KN−1N−n
Summary
At this point, we have completely derived the distribution law based on only two combination identities.
E(X)=nNK,D(X)=nNK⋅NN−K⋅N−1N−n.
There are two key points in the whole process: one is to repeatedly use identity 1 to reduce the combination number and eliminate i in the summation term with i; the other is to use the Vandermonde identity to merge the summation into a single combination number. The reason why i2 is split into (i−1)+1 when calculating the variance is precisely to create i(i−1), a structure that can be reduced to two orders again. In essence, it is to find the factorial moment E[X(X−1)].
Note p=K/N, and the result can be written as E(X)=np, D(X)=np(1−p)⋅N−1N−n. Compared with np(1−p) of the binomial distribution, the extra factor N−1N−n is called the finite population correction factor - it is less than 1, which depicts the fact that sampling without replacement makes the variance smaller; when N≫n, the factor tends to 1, and the hypergeometric distribution is approximated as a binomial distribution.