Variance of Bernoulli Distribution/Proof 4

Theorem
Let $X$ be a discrete random variable with the Bernoulli distribution with parameter $p$.

Then the variance of $X$ is given by:
 * $\operatorname{var} X = p \left({1 - p}\right)$

Proof 4
From Variance of Discrete Random Variable from PGF, we have:
 * $\operatorname{var} X = \Pi''_X \left({1}\right) + \mu - \mu^2$

where $\mu = E \left({x}\right)$ is the expectation of $X$.

From the Probability Generating Function of Bernoulli Distribution, we have:
 * $\Pi_X \left({s}\right) = q + ps$

where $q = 1 - p$.

From Expectation of Bernoulli Distribution, we have $\mu = p$.

We have $\Pi''_X \left({s}\right) = 0$ from Derivatives of PGF of Bernoulli Distribution.

Hence, $\operatorname{var} X = 0 - \mu - \mu^2 = p - p^2 = p \left({1-p}\right)$.