Variance of Bernoulli Distribution/Proof 5

From ProofWiki
Jump to navigation Jump to search

Theorem

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

$X \sim \Bernoulli p$


Then the variance of $X$ is given by:

$\var X = p \paren {1 - p}$


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:

\(\ds \map {M_X''} t\) \(=\) \(\ds \frac {\d^2} {\d t^2} \paren {q + p e^t}\)
\(\ds \) \(=\) \(\ds p \frac \d {\d t} \paren {e^t}\) Derivative of Constant, Derivative of Exponential Function
\(\ds \) \(=\) \(\ds p e^t\) Derivative of Exponential Function

Setting $t = 0$ gives:

\(\ds \expect {X^2}\) \(=\) \(\ds p e^0\)
\(\ds \) \(=\) \(\ds p\) Exponential of Zero

In Expectation of Bernoulli Distribution, it is shown that:

$\expect X = p$

So:

\(\ds \var X\) \(=\) \(\ds p - p^2\)
\(\ds \) \(=\) \(\ds p \paren {1 - p}\)

$\blacksquare$