Help with integration and random variables

I am having some trouble understanding the steps in the following integral, where $$x$$ and $$y$$ are uniform on $$[0,1]$$.

$$\int_0^1 \int_0^1 y \, P(y\leq x) \, \mathrm{d}y \, \mathrm{d}x =\int_0^1 x \int_0^xy \, \mathrm dy \, \mathrm dx$$ By using the uniform distribution, I get:

$$\int_0^1 \int_0^1 y \, P(y\leq x) \, \mathrm dy \, \mathrm dx = \int_0^1 \int_0^1 y \, x \hspace{1mm} \, \mathrm dy \, \mathrm dx$$

But why can't I write:

$$= \int_0^1 x \, \mathrm dx \int_0^1 y \, \mathrm dy$$

Can someone help me understand the step here?

Thank you.

• What are you even trying to find? $\mathsf P(y<x)$ makes little sense, since $y$ and $x$ are not random variables, but the integration terms. Do you mean $\mathbf 1_{y<x}$ , an indicator function -- which equals one when the indicated condition is true, and zero otherwise-- ? – Graham Kemp Mar 21 at 23:04
• I'm sorry, it was not clear. $y$ is a random variable. Actually, what I am trying to find is the expected value: $\mathbb{E}(y \hspace{1mm} P(y \leq x))$. – Cola Mar 21 at 23:25
• $y$ is either a random variable, xor a term of integration. You cannot use it for both, hence the confusion. – Graham Kemp Mar 21 at 23:30
• Thank you. Yes, your answer below is correct. – Cola Mar 21 at 23:42

What are you even trying to find?   $$\mathsf P(y makes little sense, since $$y$$ and $$x$$ are not random variables, but the integration terms.   Do you mean $$\mathbf 1_{y , an indicator function --which equals one when the indicated condition is true, and zero otherwise-- ?

If so, then you cannot separate the integrals because you must integrate over the domain where the values for $$X$$ are less than those for $$Y$$.   There is a clear entanglement.

Thus I suspect that the actual solution is:

\begin{align}\mathsf E(Y\mid Y

I'm sorry, it was not clear. y is a random variable. Actually, what I am trying to find is the expected value: $$\Bbb E(y\mathsf P(y≤x))$$.

They are either random variables, xor a terms of integration. You cannot use the symbols for both, hence the confusion.

Then as they are random variables, $$\mathsf P(y is therefore a constant.

\begin{align} \mathbb E(y\mathsf P(y\leq x)) &= \mathsf P(y\leq x)\cdot\mathbb E(y)\\[1ex]&=\iint_{\Bbb R^2}\mathbf 1_{t

Are you sure that is what you wanted?

In the context of the integral, $$x$$ and $$y$$ are just numbers, so $$P(x is simply either 0 or 1 depending on the values of $$x$$ and $$y$$.

This is different from $$P(X where X is a uniform random variable on $$[0,1]$$. That is equal to $$y$$.