I need help understanding a proof regarding a continuous variable

114 Views Asked by At

Consider a continuous random variable $Y$ with probability density function $f_Y$. A proof was given for the statement below in my book but I do not understand it.

$$E[Y]=\int_{0}^{\infty}P(Y>y)\mathrm{d}y$$

Proof (from my book):

$$\int_{0}^{\infty}P(Y>y)\mathrm{d}y=\int_{0}^{\infty}\int_{y}^{\infty}f_Y(x)\mathrm{d}x\mathrm{d}y\stackrel{?}{=} \int_{0}^{\infty}\left(\int_{0}^{x}\mathrm{d}y\right)f_Y(x)\mathrm{d}x=\int_{0}^{\infty}xf_Y(x)\mathrm{d}x=E[Y]$$

Shouldn't the integral after the question mark be $\displaystyle\int_{0}^{\infty}\left(\int_{y}^{\infty}\mathrm{d}y\right)f_Y(x)\mathrm{d}x$? I don't understand why $\displaystyle\int_{0}^{x}$ is used instead of $\displaystyle\int_{y}^{\infty}$.

2

There are 2 best solutions below

0
On BEST ANSWER

For one thing, it wouldn't really make sense to integrate $\int_y^\infty dy$, because if you integrate with respect to $y$, then you treat it as a variable, but you also have $y$ as a bound for your integral, so it's a constant. $y$ can't be both a variable and constant. Furthermore, the bounds are supposed to align with the variables- $\int_y^\infty$ goes with $dx$ and $\int_0^\infty$ goes with $dy$. When you change the order of integration, the bounds have to continue to align with the corresponding variable of integration.

I believe what's confusing you is that it looks like the integral $\int_0^\infty$ hasn't changed. However, that's not the case. At first, $\int_0^\infty$ is for an integral with respect to $y$. After that step that confused you, it is for an integral with respect to $x$. They are not the same integrals- the bounds just happened to be the same.

To understand how the bounds change, imagine it geometrically. The integral $\int_y^\infty dx$ represents integrating over the region bounded below by the line $x=y$ and unbounded above. The integral $\int_0^\infty dy$ represents integrating over the region where $y\geq 0$. Putting these together, you get that $\int_0^\infty \int_y^\infty dxdy$ represents integrating over the region on the first quadrant of the coordinate plane (where $y>0,x>0$) under the line $y=x$.

Alternatively, you can integrate with respect to $y$ first. You can see that $y$ is bounded from above by $y=x$ and bounded from below by $0$, so you have $\int_0^x dy$. You then integrate with respect to $x$; since $x$ is bounded from below by $0$ and unbounded above, you have $\int_0^\infty \int_0^x dydx$.

For reference, consider this image. You can see faint traces of topology notes on the back.

1
On

The region of integration is $\{(x,y): 0<y<x<\infty\}.$ If you fix an $x$-value and integrate the $y$-variable, which $y$-values give $(x,y)$ in the region?

enter image description here