I need clarified and detailed derivation of mean and variance of a hyper-geometric distribution.
If a box contains $N$ balls, $a$ of them are black and $N-a$ are white, and $n$ number of balls are drawn at random without replacement , then the probability of getting $x$ black balls (and obviously $n-x$ white balls) is given by the following p.m.f.
The p.m.f is $$f(x) =\frac{(_{a}C_x) \cdot (_{N-a}C_{n-x})}{_{N}C_n} $$
The mean is given by: $$ \mu = E(x) = np = na/N$$ and, variance $$ \sigma^2 = E(x^2)+E(x)^2 = \frac{na(N-a)(N-n)}{N^2(N^2-1)} = npq \left[\frac{N-n}{N-1}\right] $$ where $$ q = 1-p = (N-a)/N$$
I want the step by step procedure to derive the mean and variance. Thank you.