## Mean and Variance of Negative Binomial Distribution

A negative binomial models the number of trials
$n$
to achieve a desired number
$x$
of successes.
We can treat the negative binomial as a sequence of geometric sequences each with parameter
$p$
, each sequence ending in a success. The expected number of trial until a success is achieved in
$\frac{1}{p}$
and since we require
$x$
successes we would expect to have to carry out
$\frac{x}{p}$
trials.
Similarly the variance of a geometric distribution is
$\frac{1-p}{p^2}$
so the variance of a sequence of
$x$
such geometric distributions is
$\frac{x(1-p)}{p^2}$
.