Show that $E[(X-E[X])^2] = E[X^2]-E^2[X]$

15.9k Views Asked by At

I'm trying to use linearity of expectation, but I seem to be failing somewhere. So if we expand the squared expression:

$$(X-E[X])^2 = (X-E[X])(X-E[X]) = X^2 - 2XE[X] + E^2[X]$$

So we have:

$$E[X^2 - 2XE[X] + E^2[X]]$$

Would the linearity of expectation applied to this be:

$$E[X^2 - 2XE[X] + E^2[X]] = E[X^2] - 2E[XE[X]] + E[E^2[X]]$$

Or is it not possible to use with this equation? How can I show that the two expressions in the title are equivalent to each other?

2

There are 2 best solutions below

0
On BEST ANSWER

Let $E(X)=\mu$. Note that $\mu$ is a constant.
Now, $E[X^2-2XE(X) + E^2(X)]$
$= E[X^2-2\mu X+\mu^2]$
$=E(X^2) - 2\mu E(X)+\mu^2$
$=E(X^2)-2\mu^2+\mu^2$
$=E(X^2)-\mu^2$
$=E(X^2)-E^2(X)$

1
On

You're not done using linearity of expectation. Look at your second term: $$ E[X E[X]] = E[X\cdot\text{constant}] = \text{constant} \cdot E[X]. $$

You've also written $E^2[X]$. I don't know what that means. What you need there is $(E[X])^2$. Then you need to deal with $E[(E[X])^2] = E[\text{another constant}]$.

One problem with writing something like $E^2[X]$ is that it could be taken to mean $E[E[X]]$, which is not at all the same as $(E[X])^2$.