Proving $\operatorname{Var}(X) = E[X^2] - (E[X])^2$

83.7k Views Asked by At

I want to understand something about the derivation of $\text{Var}(X) = E[X^2] - (E[X])^2$

Variance is defined as the expected squared difference between a random variable and the mean (expected value): $\text{Var}(X) = E[(X - \mu)^2]$

Then:

$\operatorname{Var}(X) = E[(X - \mu)^2]$

$\operatorname{Var}(X) = E[(X - E[X])^2]$

$\operatorname{Var}(X) = E[(X - E[X])(X - E[X])]$

$\operatorname{Var}(X) = E[X^2 - 2XE[X] + (E[X])^2]$

$\operatorname{Var}(X) = E[X^2] - 2E[XE[X]] + E[(E[X])^2]$

$\operatorname{Var}(X) = E[X^2] - 2E[E[X]E[X]] + E[(E[X])^2]$

$\operatorname{Var}(X) = E[X^2] - 2(E[X])^2 + (E[X])^2$

$\operatorname{Var}(X) = E[X^2] - (E[X])^2$

What I don't quite understand is the steps that get us from $E[XE[X]]$ to $E[E[X]E[X]]$ to $(E[X])^2$, also $E[(E[X])^2]$ to $(E[X])^2$.

While I'm sure these jumps are intuitive and obvious I would still like to understand how we can (more formally) make these jumps / consider them mathematically equivalent.

2

There are 2 best solutions below

0
On BEST ANSWER

$\newcommand{\E}{\operatorname{E}}$It should not have been written as $$ \E[X\E[X]] = \E[\E[X]\E[X]]. $$ Instead, it should have said $$ \E[X\E[X]] = \E[X] \E[X]. $$ The justification is this: $$ \E[X\cdot5] = 5\E[X], $$ and similarly for any other constant besides $5$. And in this context, "constant" means "not random". So just treat $\E[X]$ the same way you treat $5$, because it's a constant.

0
On

We start from the fundamental definition: $$Var(X)=E[(x-\mu)^2]$$ $$Var(X)=E[x^2-2\mu x+\mu^2]$$ $$Var(X)=E[x^2]-E[\mu(2x-\mu)]$$ Because mu is just a constant, we can take it out. $$Var(X)=E[x^2]-\mu*E[2x-\mu]$$ $$Var(X)=E[x^2]-\mu*(E[2x]-E[\mu])$$ $$Var(X)=E[x^2]-u*(2u-u)$$ $$Var(X)=E[x^2]-u*u$$ After Everything, we derive the end result: $$Var(X)=E[x^2]-E[x]^2$$