For $X$~$\text{Exp}(1)$ (exponential distribution with parameter $1$), show that $$\text{Var}[(x-1)^2]=8$$
I know I have to calculate pdf, $E(X)$ and $E(X^2)$, but I what really confuses me is the brackets in variance $(x-1)^2$. Any suggestions?
For $X$~$\text{Exp}(1)$ (exponential distribution with parameter $1$), show that $$\text{Var}[(x-1)^2]=8$$
I know I have to calculate pdf, $E(X)$ and $E(X^2)$, but I what really confuses me is the brackets in variance $(x-1)^2$. Any suggestions?
Let's find the raw moments: $$\operatorname{E}[X^k] = \int_{x=0}^\infty x^k e^{-x} \, dx = k!, \quad k = 1, 2, \ldots,$$ which is a consequence of the definition of the gamma function.
Then the rest is elementary algebra and using the linearity of expectation: $$\begin{align*}\operatorname{Var}[(X-1)^2] &= \operatorname{E}[(X-1)^4] - \operatorname{E}[(X-1)^2]^2 \\ &= \operatorname{E}[X^4 - 4X^3 + 6X^2 - 4X + 1] - (\operatorname{E}[X^2 - 2X + 1])^2 \\ &= \operatorname{E}[X^4] - 4 \operatorname{E}[X^3] + 6 \operatorname{E}[X^2] - 4 \operatorname{E}[X] + 1 - (\operatorname{E}[X^2] - 2 \operatorname{E}[X] + 1)^2 \\ &= 4! - 4(3!) + 6(2!) - 4(1!) + 1 - (2! - 2(1!) + 1)^2. \end{align*}$$