Recall that for a random variable

following a Bernoulli distribution

, we have the moment-generating function (MGF)

and also recall that the MGF of a sum of i.i.d. random variables is the product of the MGFs of each distribution:

So for a sum of Bernoulli-distributed i.i.d. random variables

, we have

which is the MGF of the binomial distribution

. (Indeed, the Bernoulli distribution is identical to the binomial distribution when

.)