Variance of Bernoulli Distribution

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} \left({X}\right) = p \left({1-p}\right)$$

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

$$ $$ $$ $$

Proof 2
From the definition of Variance as Expectation of Square minus Square of Expectation:
 * $$\operatorname{var} \left({X}\right) = E \left({X^2}\right) - \left({E \left({X}\right)}\right)^2$$

From Expectation of Function of Discrete Random Variable:
 * $$E \left({X^2}\right) = \sum_{x \in \operatorname{Im} \left({X}\right)} x^2 \Pr \left({X = x}\right)$$

So:

$$ $$

Then:

$$ $$ $$

Proof 3
We can also use the Variance of Binomial Distribution putting $$n = 1$$.