Variance of Bernoulli Distribution/Proof 5

Proof
From Moment Generating Function of Bernoulli Distribution, the moment generating function $M_X$ of $X$ is given by:


 * $\map {M_X} t = q + p e^t$

From Variance as Expectation of Square minus Square of Expectation, we have:


 * $\var X = \expect {X^2} - \paren {\expect X}^2$

From Moment in terms of Moment Generating Function:


 * $\expect {X^2} = \map {M_X''} 0$

We have:

Setting $t = 0$ gives:

In Expectation of Bernoulli Distribution, it is shown that:


 * $\expect X = p$

So: