# Discovering Statistics

A den for Learning

## HYPERGEOMETRIC DISTRIBUTION

Suppose an urn contains N coloured balls, out of which M are blue and the rest are red in color. Suppose we draw a sample of ‘n’ number of balls from the urn at random and without replacements. Then if X a random variable denoting the number of blue balls drawn, then the probability that there will be x number of blue balls drawn is given by:

p(x ; N,M) = Pr[X=x] \\ \hskip{1.8cm}= \frac{\binom M x \binom {N-M}{n-x}}{\binom N n}  \\ \hskip{3cm}; x=0,1,\dots,M

EXPECTATION

E(X)= \sum_{x=0}^{M} x p(x;n,N,M) = \sum_{x=1}^{M} x  \frac{\binom M x \binom {N-M}{n-x}}{\binom N n} \\
= \sum_{x=1}^{M} x  \frac{n!}{N!(N-n)!)} \frac{M!}{x!(M-x)!} \frac{(N-M)!}{(n-x)!(N-M-n+x)!} \\
= \sum_{x=1}^{M}  \frac{n!}{N!(N-n)!)} \frac{M(M-1)!}{(x-1)!(M-x)!} \frac{(N-M)!}{(n-x)!(N-M-n+x)!} \\
= \frac{M}{\binom N n} \sum_{x=1}^{M}  \binom {M-1}{x-1} \binom {(N-1)-(M-1)}{(n-1)-(x-1)} \\
= \frac{M}{\binom N n} \binom {N-1}{n-1} \sum_{x=1}^{M}  p(x-1 ; n=n-1 ,N=N-1 , M =M-1) \\
= \frac{M}{\binom N n} \binom {N-1}{n-1} \sum_{x=0}^{M-1}  p(x ; n=n-1 ,N=N-1 , M =M-1) \\
= \frac{M n! (N-n)! (N-1)!}{(n-1)!(N-n)!N!} = n \frac{M}{N}



FACTORIAL MOMENTS

For any integer, s=0,1,…,M, we have,

\mu_{[s]}=E(X(X-1)\dots(X-s+1))  \\= \sum_{x=0}^{M} \frac{x!}{(x-s)!}p(x; n,N,M) \\
=  \sum_{x=s}^{M} \frac{x!}{(x-s)!} \frac{\binom M x \binom {N-M}{n-x}}{\binom N n} \\
=  \sum_{x=s}^{M} \frac{x!}{(x-s)!} \frac{\binom M x \binom {N-M}{n-x}}{\binom N n} \\
=  \sum_{x=s}^{M} \frac{x!}{(x-s)!} \frac{M!}{x!(M-x)!} \frac{ \binom {N-M}{n-x}}{\binom N n} \\
= \frac{M!}{(M-s)!}  \sum_{x=s}^{M}  \frac{(M-s)!}{(x-s)!(M-x)!} \frac{ \binom {N-M}{n-x}}{\binom N n} \\
= \frac{M!}{(M-s)!} \frac{1}{\binom N n} \sum_{x=s}^{M} \binom {M-s}{x-s} { \binom {N-M}{n-x}} \\
= \frac{M!}{(M-s)!} \frac{1}{\binom N n} \sum_{x=0}^{M-s} \binom {M-s}{x} { \binom {(N-s)-(M-s)}{n-x-s}} \\
= \frac{M!}{(M-s)!} \frac{\binom {N-s}{n-s}}{\binom N n} \sum_{x=0}^{M-s} p(x ; n'=n-s,N'=N-s,M'=M-s) \\
= \frac{M!}{(M-s)!} \frac{(N-s)! n! (N-n)!}{N! (n-s)! (N-n)!)} \\
= \frac{M!}{(M-s)!} \frac{(N-s)!}{N!} \frac{n!}{(n-s)!} \\ 

VARIANCE:

E(X(X-1)) = \frac{M!}{(M-2)!} \frac{(N-2)!}{N!} \frac{n!}{(n-2)!} = \frac{n(n-1)M(M-1)}{N(N-1)} \\
------------------------------ \\
E(X^2) = E(X(X-1)) +E(X) \\
=  \frac{n(n-1)M(M-1)}{N(N-1)} + \frac{nM}{N}  \\
= \frac{nM}{N(N-1)} \left[ (n-1)(M-1) + (N-1)  \right]  \\
------------------------------ \\
V(X) =  \frac{nM}{N(N-1)} \left[ (n-1)(M-1) + (N-1)  \right]  - \frac{n^2M^2}{N^2} \\
=  \frac{nM}{N^2 (N-1)}  \left[ N(n-1)(M-1) + N(N-1) - nM(N-1)) \right]  \\
=  \frac{nM}{N^2 (N-1)}  \left[ nNM-nN-NM+N + N^2-N - nMN+nM \right]  \\
=  \frac{nM}{N^2 (N-1)}  \left[ -nN-NM + N^2 +nM \right]  \\
=  \frac{nM}{N^2 (N-1)}  (N-n)(N-M)  \\
= n \frac{M}{N} \frac{N-M}{N} \frac{N-n}{N-1}

## THIRD AND FOURTH ORDER MOMENTS:

Provided that the specified moment exists, it is straightforward (though tedious) to show via the factorial moments that…

Univariate Discrete Distributions – Johnson, Kemp, Kotz
\mu_3= \frac{nM(N-M)(N-n)(N-2M)(N-2n)}{N^3(N-1)(N-2)} \\
\mu_4 = \frac{nM(N-M)(N-2n)}{N^3(N-1)(N-2)(N-3)} \left[\frac{}{} N(N+1)-6n(N-n) \right. \\
+ \left. \frac{M(N-M)}{N^2} \left( N^2(n-2) -Nn^2 +6n(N-n) \right) \right]

It’s really tedious!!!

-------------------------------\\
\\
\mu_{[3]}=E(X(X-1)(X-2)) = \frac{n(n-1)(n-2) M(M-1)(M-2)}{N(N-1)(N-2)} \\
------------------------------ \\
\\
\mu'_3 =  E(X^3) = \mu_{[3]} + 3 \mu'_2 - 2 \mu'_1 \\
= \frac{n(n-1)(n-2) M(M-1)(M-2)}{N(N-1)(N-2)} + 3  \frac{n(n-1)M(M-1)}{N(N-1)} -2 \frac{nM}{N} \\
------------------------------

\mu_3 = \mu'_3 -3 \mu'_2 \mu_1  +2 (\mu'_1)^3   \\
= \mu_{[3]}+3(\mu_2 + \mu^2) -2\mu-3 (\mu_2 + \mu^2) \mu  +2 (\mu'_1)^3 \\
= ( \mu_{[3]} +3 \mu^2 -2\mu + \mu^3)  +3\mu_2 -3\mu_2 \mu \\ 
 \mu_{[3]} +3 \mu^2 -2\mu + \mu^3 = \frac{n(n-1)(n-2)M(M-1)(M-2)}{N(N-1)(N-2)} \\ \hskip{3cm}+ \frac{3n^2M^2-2nMN^2-n^3M^3}{N^3} \\
=\frac{nM}{N^3(N-1)(N-2)} \left( n^2M^2N^2-3nM^2N^2+2M^2N^2 -3n^2MN^2 + 9nMN^2 \right. \\ \left.-6MN^2 +2n^2N^2 -6nN^2 +4N^2 + 3nMN^3-9nMN^2 +6nMN -2N^4 \right. \\ \left. +6N^3 -4N^2 -n^2M^2N^2 +3n^2M^2N -2n^2M^2 \right) \\
=\frac{nM}{N^3(N-1)(N-2)}  \left[ -3nM^2N(N-n)+3nMN^2(N-n) \right. \\ \left. -6MN(N-n) +6N^2(N-n) \right. \\
\left. +2M^2(N^2-n^2)-2N^2(N^2-n^2) \right)\\
=\frac{nM}{N^3(N-1)(N-2)}  \left( (N-n) \left[ 3nMN(N-M) +6N(N-M)  \right. \right. \\ \left. \left.-2(N+n)(N^2-M^2) \right] \right) \\
=\frac{nM(N-n)(N-M)}{N^3(N-1)(N-2)} \left( 3nMN +6N - 2(N+n)(N+M) \right)
\mu_3 = \frac{nM(N-n)(N-M)}{N^3(N-1)(N-2)} \left( 3nMN +6N - 2(N+n)(N+M) \right) \\
+ 3n \frac{M}{N} \frac{N-M}{N} \frac{N-n}{N-1} -3 n^2 \frac{M^2}{N^2} \frac{N-M}{N} \frac{N-n}{N-1} \\
= \frac{nM(N-n)(N-M)}{N^3(N-1)(N-2)} \left[ 3nMN +6N - 2N^2 -2nN -2NM -2nM  \right. \\ \left. +3N^2 -6N -3nMN +6nM \right] \\
= \frac{nM(N-M)(N-n)(N-2M)(N-2n)}{N^3(N-1)(N-2)} \\
--------------------------------
\mu_4 = \frac{nM(N-M)(N-2n)}{N^3(N-1)(N-2)(N-3)} \left[\frac{}{} N(N+1)-6n(N-n) \right. \\
+ \left. \frac{M(N-M)}{N^2} \left( N^2(n-2) -Nn^2 +6n(N-n) \right) \right]