# Variance of Binomial Distribution

## Theorem

Let $X$ be a discrete random variable with the binomial distribution with parameters $n$ and $p$.

Then the variance of $X$ is given by:

$\var X = n p \paren {1 - p}$

## Proof 1

From the definition of Variance as Expectation of Square minus Square of Expectation:

$\var X = \expect {X^2} - \paren {\expect X}^2$
$\ds \expect {X^2} = \sum_{x \mathop \in \Img X} x^2 \Pr \paren {X = x}$

To simplify the algebra a bit, let $q = 1 - p$, so $p + q = 1$.

So:

 $\ds \expect {X^2}$ $=$ $\ds \sum_{k \mathop \ge 0}^n k^2 \binom n k p^k q^{n - k}$ Definition of Binomial Distribution: $p + q = 1$ $\ds$ $=$ $\ds \sum_{k \mathop = 0}^n k n \binom {n - 1} {k - 1} p^k q^{n - k}$ Factors of Binomial Coefficient: $k \dbinom n k = n \dbinom {n - 1} {k - 1}$ $\ds$ $=$ $\ds n p \sum_{k \mathop = 1}^n k \binom {n - 1} {k - 1} p^{k - 1} q^{\paren {n - 1} - \paren {k - 1} }$ Change of limit: term is zero when $k - 1 = 0$ $\ds$ $=$ $\ds n p \sum_{j \mathop = 0}^m \paren {j + 1} \binom m j p^j q^{m - j}$ putting $j = k - 1, m = n - 1$ $\ds$ $=$ $\ds n p \paren {\sum_{j \mathop = 0}^m j \binom m j p^j q^{m - j} + \sum_{j \mathop = 0}^m \binom m j p^j q^{m - j} }$ splitting sum up into two $\ds$ $=$ $\ds n p \paren {\sum_{j \mathop = 0}^m m \binom {m - 1} {j - 1} p^j q^{m - j} + \sum_{j \mathop = 0}^m \binom m j p^j q^{m - j} }$ Factors of Binomial Coefficient: $j \dbinom m j = m \dbinom {m - 1} {j - 1}$ $\ds$ $=$ $\ds n p \paren {\paren {n - 1} p \sum_{j \mathop = 1}^m \binom {m - 1} {j - 1} p^{j - 1} q^{\paren {m - 1} - \paren {j - 1} } + \sum_{j \mathop = 0}^m \binom m j p^j q^{m - j} }$ Change of limit: term is zero when $j - 1 = 0$ $\ds$ $=$ $\ds n p \paren {\paren {n - 1} p \paren {p + q}^{m - 1} + \paren {p + q}^m}$ Binomial Theorem $\ds$ $=$ $\ds n p \paren {\paren {n - 1} p + 1}$ as $p + q = 1$ $\ds$ $=$ $\ds n^2 p^2 + n p \paren {1 - p}$ by algebra

Then:

 $\ds \var X$ $=$ $\ds \expect {X^2} - \paren {\expect X}^2$ $\ds$ $=$ $\ds n p \paren {1 - p} + n^2 p^2 - \paren {n p}^2$ Expectation of Binomial Distribution: $\expect X = n p$ $\ds$ $=$ $\ds n p \paren {1 - p}$

as required.

$\blacksquare$

## Proof 2

$\var X = \map {\Pi''_X} 1 + \mu - \mu^2$

where $\mu = \expect X$ is the expectation of $X$.

$\map {\Pi_X} s = \paren {q + p s}^n$

where $q = 1 - p$.

$\mu = n p$
$\map {\Pi''_X} s = n \paren {n - 1} p^2 \paren {q + p s}^{n - 2}$

Setting $s = 1$ and using the formula $\map {\Pi''_X} 1 + \mu - \mu^2$:

$\var X = n \paren {n - 1} p^2 + n p - n^2 p^2$

Hence the result.

$\blacksquare$

## Proof 3

From Bernoulli Process as Binomial Distribution, we see that $X$ as defined here is the sum of the discrete random variables that model the Bernoulli distribution.

Each of the Bernoulli trials is independent of each other.

Hence we can use Sum of Variances of Independent Trials.

The Variance of Bernoulli Distribution is $p \paren {1 - p}$.

Thus the variance of $\Binomial n p$ is $n p \paren {1 - p}$.

$\blacksquare$