8

If $X$ is a normally distributed with mean $0$ and variance $1$, expectation of $X$ equals $0$ but why is $E(X^2)=1$?

beep-boop
  • 11,825

4 Answers4

7

For any random variable $X$ with a finite second moment, $$ \operatorname{Var}X=\operatorname EX^2-(\operatorname EX)^2 $$ so that $\operatorname{Var}X=\operatorname EX^2$ if $\operatorname EX=0$.

In our case, $\operatorname EX^2=\operatorname{Var} X=1$.

Cm7F7Bb
  • 17,879
  • 5
  • 43
  • 69
2

Hint:

Compute $$ \int_{-\infty}^{\infty} x^2 \left(\frac{1}{\sqrt{2\pi}} {\rm e}^{-\frac{x^2}{2}}\right)dx$$

Hint to hint:

Note that $$ \int x^2 {\rm e}^{-\frac{x^2}{2}}dx = \frac{\sqrt{\pi}}{\sqrt{2}} {\rm erf}\left( \frac{x}{\sqrt{2}}\right) - x {\rm e}^{-\frac{x^2}{2}} + \mathcal{C},$$ with erf being the error function defined by: $$ {\rm erf}(z) =\frac{2}{\sqrt{\pi}} \int_0^{z} {\mathrm e}^{-t^2} dt, $$ which can be viewed as special function (that is, it has clear, proven properties and numerical computer implementation).

ir7
  • 6,289
  • 1
    This is not a hint, this is a definition – M Turgeon Apr 25 '14 at 14:48
  • 1
    @MTurgeon That's my WHOLE point! Get to the actual calculation, instead of looking for nice ways out of it, like in the other answers :). – ir7 Apr 25 '14 at 14:57
  • @MTurgeon: It's not a definition, it's a consequence of what is often referred to as the law of the unconscious statistician. – Stefan Hansen Apr 25 '14 at 15:11
  • Hint to the hint: integrals like $\int x^2 \exp(-x^2/2) dx$ are addressed via integration by parts or differentiation by an artificial parameter: introduce $a$ into the exponent as $\exp( -a x^2/2)$, evaluate the integral, and take derivatives with respect to $a$. Oh, and statisticians hate the erf() function, it is on a wrong scale as it is does not correspond to the standard normal distribution. – StasK Apr 25 '14 at 15:28
  • @StasK Surely. All successful methods are equal in God's eyes. :) feel free to direct the user to them within MSE (tons of related places) or elsewhere. (No, nobody hates erf, they are just used to one language and are uncomfortable speaking other people languages. :)) – ir7 Apr 25 '14 at 15:39
  • @StefanHansen Of course, it depends on your definition of expectation. That $E_{F_Y}(Y)=E_{F_X}(X^2)$, where $Y=X^2$, is definitely a theorem, but they both have different definitions – M Turgeon Apr 25 '14 at 15:46
1

Another way of seeing this: If $X$ is standard normal, then $X^2$ is chi-squared with one degree of freedom. The expected value of a chi-squared being equal to the degrees of freedom, the result follows.

M Turgeon
  • 10,785
1

The definition of variance for a random variable $X$, $var(X) = E[(X - \mu)^2]$, since $\mu = 0$, it's obvious that $var(X) = E[X^2]$.

dpington
  • 247