The mean and variance of the binomial distribution can be derived most easily using a simple indicator function approach but, in the course of studying a stochastic process involving the binomial distribution, I became interested in deriving the mean and variance from the canonical probability-weighted sum of random variable values. I found it instructive to work out how to do this and want to record the relevant manipulations here.
For the binomial distribution with
a positive integer and
, the underlying random variable
is one that counts the number of successes in the first
trials of a Bernoulli sequence with probability
of success on any trial and a probability
of failure. The probability function for
successes in
trials is
where
The mean and variance of the random variable can be obtained almost trivially by expressing
as a sum of indicator functions
for
, where each indicator takes the value 1 meaning success with probability
and the value 0 meaning failure with probability
:
Given that
and
it follows immediately that
and
However, it is also possible to obtain these expressions by manipulating the usual defining sums for and
using the probability functions in (1) above, i.e.,
and
In the case of , we can manipulate
as follows:
Then we have
where the penultimate line follows from the binomial expansion theorem.
In the case of , we need to manipulate
as follows:
Then we have
Therefore,
