We now give formulae for the mean and variance of the negative binomial distribution.
Mean and variance
If the random variable \(X\) has a negative binomial distribution with probability function
\[ p(x) = \begin{cases} \displaystyle{{x-1} \choose {k-1}} \pi^k(1-\pi)^{x-k} & \quad \text{for } x = k, k+1, \dots \\[0.5em] 0 & \quad \text{otherwise} \end{cases} \]then its mean and variance are
\[ E[X] = \frac k {\pi} \spaced{and} \Var(X) = \frac {k(1-\pi)} {\pi^2} \](Proved in full version)
Since the alternative type of negative binomial distribution (for the number of failures before the \(k\)'th success) is for
\[ X^* \;\; = \; \; X - k \]its mean is simply \(k\) less than that of \(X\) and its variance is the same,
\[ E[X^*] = \frac k {\pi} - k = \frac {k(1-\pi)} \pi \spaced{and} \Var(X^*) = \frac {k(1-\pi)} {\pi^2} \]