Properties of negative binomial distributions
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} \]If we define the number of trials until the first success to be \(Y_1\), the number of trials after the first success until the second one to be \(Y_2\) and so on up to \(Y_k\) which is the number of trials after the \((k-1)\)'th success until the \(k\)'th one,
\[ X = Y_1 + Y_2 + \dots + Y_k = \sum_{i=1}^k Y_i \]Now each of the \(\{Y_i\}\) is an independent geometric random variable,
\[ Y_i \;\; \sim \; \; \GeomDistn(\pi) \]so we can use the general results about the sum of \(k\) independent identically distributed variables (i.i.d.r.vs) to get
\[ E[X] = k \times E[Y_i] = \frac k {\pi} \spaced{and} \Var(X) = k \times \Var(Y_i ) = \frac {k(1-\pi)} {\pi^2}\]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} \]