# Thread: Need help with another proof.

1. ## Need help with another proof.

I've got a problem that I don't know how to solve. The question: Suppose that Y is a continuous random variable with density f(y) that is positive only if y> or equal to zero. If F(y) is the distribution function, show that

$E(Y) = \int_{0}^{infty}{} yf(y) dy = \int_{0}^{infty}{} [1-F(y)] dy.$

The book also gives a hint: If y > 0, $y=\int_{0}^{y}{} dt$ and $E(Y) = \int_{0}^{+\infty} yf(y) dy = \int_{0}^{+\infty} [\int_{0}^{y} dt] f(y) dy$

Exchange the order of integration to obtain the desired result.

I've tried to change the integration order like this:

$E(Y) = \int_{0}^{+\infty} yf(y) dy = - \int_{+\infty}^{0} [\int_{0}^{y} dt] f(y) dy$

but how do I go on from there?

2. In order to change the order of integration, you must remove the $y$ from the bound. Here is how:
$E(Y) = \int_{0}^{+\infty} yf(y) dy = \int_{0}^{+\infty} \left(\int_{0}^{y} dt\right) f(y) dy$
.... $= \int_0^\infty \int_0^\infty {\bf 1}_{(t\leq y)}dt f(y) dy = \int_0^\infty\left(\int_0^\infty {\bf 1}_{(t\leq y)}f(y) dy\right)dt$
.... $= \int_0^\infty \left(\int_t^{+\infty} f(y) dy\right)dt =\int_0^\infty (1-F(t))dt$.
(I denote by ${\bf 1}_{(t\leq y)}$ an indicator function: it is equal to 1 if $t\leq y$ and to 0 otherwise)

3. Thank you, Laurent. I'm not sure that I understand the use of an indicator function. Can you please try to explain how I use it to go from:

$\int_0^\infty\left(\int_0^\infty {\bf 1}_{(t\leq y)}f(y) dy\right)dt$

to:

$\int_0^\infty \left(\int_t^{+\infty} f(y) dy\right)dt$

?

4. Originally Posted by approx
Thank you, Laurent. I'm not sure that I understand the use of an indicator function. Can you please try to explain how I use it to go from:

$\int_0^\infty\left(\int_0^\infty {\bf 1}_{(t\leq y)}f(y) dy\right)dt$

to:

$\int_0^\infty \left(\int_t^{+\infty} f(y) dy\right)dt$

?
Consider (for some fixed $t>0$) $\int_0^\infty {\bf 1}_{(t\leq y)}f(y) dy$. The function that is being integrated is equal to $f(y)$ when $y\geq t$ (because the indicator equals 1), and it is equal to $0$ when $y (because the indicator equals 0). So it simplifies into: $\int_t^{+\infty} f(y) dy$ (we integrate only on the values of $y$ where the integrand is not zero, that is for $y$ greater than $t$). Is it clear? I use this operation twice: once to remove the $y$ from the integration sign, and once to put back a $t$.

5. There is also a "visual" way to understand this exchange in the order of integration. Draw the set of all $(t,y)$ such that $0\leq t\leq y$ (with the $y$-axis as the horizontal axis): this is the part of the plane delimited by the positive $y$-axis and the half-line $t=y$, $t\geq 0$. When you compute $\int_0^\infty\int_0^y f(y) dt\,dy$, you integrate the function $f(y)$ along the vertical slices corresponding to fixed $y$'s, and then you "sum" the slices together. These slices are bounded: from 0 to $y$. And, by Fubini Theorem, the value of the integral does not change if you sum the horizontal slices instead: for each $t$, the slice goes from $t$ to $+\infty$. So that the integral becomes: $\int_0^\infty\int_t^\infty f(y) dy\,dt$. That's clearer when drawn on a paper actually, but I hope you got it anyway.

6. I think I understand now. Thank you for that explanation.