Variance of Bernoulli Distribution/Proof 1

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 1
From the definition of variance:
 * $\operatorname{var} X = E \left({\left({X - E \left({X}\right)}\right)^2}\right)$

From the Expectation of Bernoulli Distribution, we have $E \left({X}\right) = p$.

Then by definition of Bernoulli distribution: