Different ways of determining $\mathbb E(X^n)$

52 Views Asked by At

Let $X$ be a uniformly distributed random variable on $[0,2a]$ with $ a > 0 $. The task was to determine $\mathbb E (X^2)$.

My approach: $F_{X^2}(x) = \mathbb P(X^2 \le x)$ = $\mathbb P(- \sqrt x \le X \le \sqrt x)$. Thus we got:

$$\boldsymbol{F_{X^2}}(x) = \begin{cases} 0, & x \le 0 \\ \sqrt x \over 2a, & 0 < x < 4a^2 \\ 1, & x \ge 4a^2 \end{cases}$$

Note that $$f_{X^2}(t) = \frac{\partial}{\partial x}({\sqrt x \over 2a}) \boldsymbol{1}_{0 < x < 4a^2} = {1 \over 4a \sqrt x} \boldsymbol{1}_{0 < x < 4a^2} $$ Finally we got:

$\mathbb E (X^2) = \int_{0}^{4a^2} {x \over 4a \sqrt x} dx = {4a^2 \over 3}$.

In the solution however, it simply says:

$\mathbb E (X^2) = {1 \over 2a} \int_{0}^{2a} x^2 dx = {4a^2 \over 3}$.

My question: Let $X$ be some real-valued random variable with pdf $f(x)$. Does for all $X^n, n \in \mathbb N$ w.l.o.g follow that $\mathbb E(X^n) = \int_{\mathbb R} x^n f(x) dx$? Why?

1

There are 1 best solutions below

4
On BEST ANSWER

The expected value for a continuous random variable $X$ with pdf $f(x)$ is $E(X)=\int_{\Bbb R}xf(x)dx$. We also have that $E(g(X))=\int_{\Bbb R}g(x)f(x)dx$ for a function $g$ of the random variable. See this link for more information.

So in your case, $g(x)=x^n$, so we have $$E(X^n)=\int_{\Bbb R}x^nf(x)dx$$


Another way to tackle this problem is using the moment generating function or mgf. This allows you to compute any moment of $X$ by differentiating the mgf and evaluating at $t=0$. For a uniform distribution on $[a,b]$ the mgf is given as $$m(t)=\begin{cases}\frac{e^{tb}-e^{ta}}{t(b-a)}\qquad\text{if $t\neq 0$}\\1\qquad\qquad\text{if $t=0$}\end{cases}$$ and then $E(X^n)=\frac{d^n}{dt^n}m(t)\vert_{t=0}$