1
$\begingroup$

Per Wikipedia, this is what happens when you expand the variance equation:

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

How do we get the $\ 2E[X]E[X] $ term?

$\endgroup$
2
$\begingroup$

$$\begin{align} \text{Var}(X)&=E\Big[\big(X-E[X]\big)^{2}\Big]\\ &=E\Big[X^{2}-2XE[X]+\big(E[X]\big)^{2}\Big]\\ &=E\big[X^{2}\big]-2E\big[XE[X]\big]+E\Big[\big(E[X]\big)^{2}\Big]\\ &\overset{*}{=}E\big[X^{2}\big]-2E\big[XE[X]\big]+\big(E[X]\big)^{2}\\ &\overset{**}{=}E\big[X^{2}\big]-2E[X]E[X]+\big(E[X]\big)^{2}\\ &=E\big[X^{2}\big]-2\big(E[X]\big)^{2}+\big(E[X]\big)^{2}\\ &=E\big[X^{2}\big]-\big(E[X]\big)^{2} \end{align}$$

$^{*}$Because $\big(E[X]\big)^{2}$ is a constant, so taking the expectation of $\big(E[X]\big)^{2}$ just gives the constant.

$^{**}$Because $E[X]$ is a constant, so taking the expectation of $E[X]$ just gives the constant.

$\endgroup$
  • $\begingroup$ This problem has been solved many times on this site. Next time point the OP to the duplicates. $\endgroup$ – Michael R. Chernick Jan 15 '17 at 8:17
2
$\begingroup$

It's from linearity of expectation and the fact that $E[X]$ is constant. I'll let $E[X]=c$ at some steps for clarity. \begin{align*} Var(X) &= E[ (X- E[X])^2] \\ &= E[ X^2 - 2X E[X] + (E[X])^2] \\ &= E[X^2] - E[2X E[X]] + E[(E[X])^2] \\ &= E[X^2] - E[2X c] + E[c^2] \\ &= E[X^2] - 2c E[X] + c^2 \\ &= E[X^2] - 2(E[X])^2 + (E[X])^2 \\ &= E[X^2] - (E[X])^2. \end{align*}

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.