|
1 | | -\begin{flalign} |
2 | | - \mathbb{E}[X] & = \int_{0}^{\infty} x f(x) dx \\ |
3 | | - & = \int_{0}^{\infty} x^2 e^{-\frac{x^2}{2}} dx \\ |
4 | | - & = \frac{1}{2} \ri x^2 e^{-\frac{x^2}{2}} dx \\ |
5 | | - & = \frac{1}{2} |
6 | | -\end{flalign} |
| 1 | +a. From the definition of expectation |
7 | 2 |
|
| 3 | +$$ |
| 4 | +\mathbb{E}[X] = \int_{-\infty}^\infty x f(x) dx = \int_0^\infty x^2 e^{-x^2/2} dx |
| 5 | +$$ |
8 | 6 |
|
9 | | -\begin{flalign} |
| 7 | +The integral in the above equation is similar to the integral that arises when calculating the second moment of a standard Normal distribution. |
| 8 | +Let $Z \sim \mathcal{N}(0,1)$, with PDF $\varphi$. |
| 9 | +We know that $\mathbb{E}[Z]=0$ and $\mathrm{Var}(Z)=1$. |
| 10 | +From the definition of variance, |
| 11 | + |
| 12 | +$$ |
| 13 | +\mathrm{Var}(Z) = \mathbb{E}[Z^2] - (\mathbb{E}[Z])^2 = \mathbb{E}[Z^2] - 0 = 1 |
| 14 | +$$ |
| 15 | + |
| 16 | +$$ |
| 17 | +\mathbb{E}[Z^2] |
| 18 | += \int_{-\infty}^\infty z^2 \varphi(z) dz |
| 19 | += \int_{-\infty}^\infty z^2 \frac{1}{\sqrt{2\pi}} e^{-z^2/2} dz |
| 20 | += 1 |
| 21 | +$$ |
| 22 | + |
| 23 | +$$ |
| 24 | +\int_{-\infty}^\infty z^2 e^{-z^2/2} dz = \sqrt{2\pi} |
| 25 | +$$ |
| 26 | + |
| 27 | +Since the integrand is an even function, the integral in $(0,\infty)$ is half this value. Therefore, |
| 28 | + |
| 29 | +$$ |
| 30 | +\mathbb{E}[X] = \frac{\sqrt{2\pi}}{2} = \sqrt{\frac{\pi}{2}} |
| 31 | +$$ \\ |
| 32 | + |
| 33 | + |
| 34 | +b. |
| 35 | + |
| 36 | +\begin{flalign*} |
10 | 37 | \mathbb{E}[X^2] & = \int_{0}^{\infty} x^2 f(x) dx \\ |
11 | | - & = \int_{0}^{\infty} x^3 e^{\frac{x^2}{2}} dx \\ |
12 | | - & = \int_{0}^{\infty} 2 u e^u du = 2 \\ |
13 | | -\end{flalign} |
| 38 | + & = \int_{0}^{\infty} x^3 e^{-\frac{x^2}{2}} dx \\ |
| 39 | + & = \int_{0}^{\infty} 2 u e^{-u} du \\ |
| 40 | +\end{flalign*} |
| 41 | + |
| 42 | +The last integral is similar to the integral that arises when calculating the expected value of $Y \sim \mathrm{Expo}(1)$. |
| 43 | +We know that $\mathbb{E}[Y] = 1$, |
| 44 | + |
| 45 | +$$ |
| 46 | +\mathbb{E}[Y] = \int_0^\infty y e^{-y} dy = 1 |
| 47 | +$$ |
14 | 48 |
|
| 49 | +It then follows that $\mathbb{E}[X^2] = 2$ |
0 commit comments