11

Let $X$ be a continuous non-negative random variable (i.e. $R_x$ has only non-negative values). Prove that $$E(X) = \int_{0}^{\infty} P(X>x)\,dx = \int_{0}^{\infty} (1-F_X(x))\,dx$$ where $F_X(x)$ is the CDF for $X$. Using this result, find $E(X)$ for an exponential ($\lambda$) random variable.

I know that by definition, $F_X(x) = P(X \leq x)$ and so $1 - F_X(x) = P(X>x)$

The solution is: $$\int_{0}^{\infty} \int_{x}^{\infty} f(y)\,dy dx = \int_{0}^{\infty} \int_{0}^{y} f(y)\,dy dx = \int_{0}^{\infty} yf(y) dy.$$

I'm really confused as to where the double integral came from. I'm also rusty on multivariate calc, so I'm confused about the swapping of $x$ and $\infty$ to $0$ and $y$.

Any help would be greatly appreciated!

Em.
  • 15,981
Nikitau
  • 1,353

5 Answers5

21

Observe that for a continuous random variable, (well absolutely continuous to be rigorous):

$$\mathsf P(X> x) = \int_x^\infty f_X(y)\operatorname d y$$

Then taking the definite integral (if we can):

$$\int_0^\infty \mathsf P(X> x)\operatorname d x = \int_0^\infty \int_x^\infty f_X(y)\operatorname d y\operatorname d x$$

To swap the order of integration we use Tonelli's Theorem, since a probability density is strictly non-negative.

Observe that we are integrating over the domain where $0< x< \infty$ and $x< y< \infty$, which is to say $0<y<\infty$ and $0< x < y$.

$$\begin{align}\int_0^\infty \mathsf P(X> x)\operatorname d x = & ~ \iint_{0< x< y< \infty} f_X(y)\operatorname d (x,y) \\[1ex] = & ~ \int_0^\infty \int_0^y f_X(y)\operatorname d x\operatorname d y\end{align}$$

Then since $\int_0^y f_X(y)\operatorname d x = f_X(y) \int_0^y 1\operatorname d x = y~f_X(y)$ we have:

$$\begin{align}\int_0^\infty \mathsf P(X> x)\operatorname d x = & ~ \int_0^\infty y ~ f_X(y)\operatorname d y \\[1ex] = & ~ \mathsf E(X \mid X\geq 0)~\mathsf P(X\geq 0) \\[1ex] = & ~ \mathsf E(X) & \textsf{when $X$ is strictly positive} \end{align}$$

$\mathcal {QED}$

Graham Kemp
  • 129,094
  • Ah, thanks for explaining it! Now I know where the double integral came from.

    Quick question, do I still have to somehow use this result to find E(X) for an Exponential random variable?

    – Nikitau Mar 10 '16 at 01:45
  • 2
    @TFSM You do not have to, but which is easier: $$\begin{align}\int_0^\infty x~f_X(x)~\operatorname d x = & ~ \int_0^\infty x \lambda e^{-\lambda x}\operatorname d x \ \int_0^\infty 1-F_X(x)\operatorname d x = & ~ \int_0^\infty e^{-\lambda x}\operatorname d x\end{align}$$ – Graham Kemp Mar 10 '16 at 03:53
8

HINT

Since $1 - F_X(x) = P(X\geq x) = \int_x^\infty f_X(t) \,\mathrm{d}t$,

$$ \int_0^\infty \left( 1 - F_X(x) \right) \,\mathrm{d}x = \int_0^\infty P(X\geq x) \,\mathrm{d}x = \int_0^\infty \int_x^\infty f_X(t) \,\mathrm{d}t \mathrm{d}x $$

Then change the order of integration:

$$ = \int_0^\infty \int_0^t f_X(t) \,\mathrm{d}x \mathrm{d}t = \int_0^\infty \left[xf_X(t)\right]_0^t \,\mathrm{d}t = \int_0^\infty t f_X(t) \,\mathrm{d}t $$

Recognizing that $t$ is a dummy variable, or taking the simple substitution $t=x$ and $\mathrm{d}t = \mathrm{d}x$,

$$ = \int_0^\infty x f_X(x) \,\mathrm{d}x = \mathrm{E}(X) $$

alexjo
  • 14,976
  • OH I think I understand now! Correct me if I'm wrong, but the first integral was to change the CDF into a PDF. The second integral then involved the definition of $P(X \geq x)$ – Nikitau Mar 10 '16 at 03:31
  • Y es, you are right. – alexjo Mar 10 '16 at 03:49
8

First note that \begin{align} P\{X>x\}&=E(1_{X>x})\\ &=\int_0^{\infty}1_{y>x}f(y)dy \end{align} Therefore \begin{align} \int_0^{\infty}P\{X>x\}dx&=\int_0^{\infty}\int_0^{\infty}1_{y>x}f(y)dydx\\ &=\int_0^{\infty}\int_0^{\infty}1_{y>x}f(y)dxdy\\ &=\int_0^{\infty}yf(y)dy\\ \end{align}

Math-fun
  • 9,507
2

The proof is incorrect as stated, but can be easily fixed. If $X$ is absolutely continuous with density $f$, that means that $F_X(x) = \int_{-\infty}^x f(t)\,dt$ for all $x$. The integral showed up in the proof because the prover assumed that $X$ is absolutely continuous with density $f$.

nullUser
  • 27,877
0

\begin{align} EX &=\int_{-\infty}^{\infty}xf(x)dx\\ &=\int_0^{\infty}xf(x)dx\\ &=\int_0^{\infty}xd(-\int_x^{\infty}f(t)dt)\\ &=-\left[x\int_x^{\infty}f(t)dt\right]_0^{\infty}+\int_0^{\infty}(\int_x^{\infty}f(t)dt)dx\\ &=-\left[\infty\int_{\infty}^{\infty}f(t)dt-0\int_0^{\infty}f(t)dt\right]+\int_0^{\infty}P(X>x)dx\\ &=-0+\int_0^{\infty}P(X>x)dx\\ &=\int_0^{\infty}P(X>x)dx \end{align}