Let $X$ and $Y$ be independent random variables, $X,Y \sim unif(0,1)$. Let $U = \min \{X,Y\}$ and $V = \max\{X,Y\}$. Find the correlation coefficient of $U$ and $V$.
I think we can assume that $U = X$ and $V = Y$ because they both have the same distribution. Further, $E[U] = E[V] = 1/2$ and $Var(U) = Var(V) = 1/12$. Next is $E[UV]$ and this is where I am stuck, because I can't solve this $E[UV] = \int_{}^{}\int_{\mathbb{R}^2}^{}uvf(u,v)dudv$. I think I can substitute $f(u,v)$ with $1$, but I'm not sure.
This problem has several nice shortcuts.
For the first term, you can note that $UV=XY$. This is because one or the other of $X,Y$ is the smaller one and the other is the larger, and multiplication doesn't care what order they come in. So since $ X, Y $ are independent, $ E [UV]= E [X] E [Y] = 1/4$.
We can use a similar trick to calculate $E[U]$ and $E[V]$. Let's think about $U$. We first consider $X=x$. Now with probability $1-x$, $Y>x$, in which case $U=x$. With probability $x$, $Y \leq x$, in which case $U$ is uniform on $[0,x]$. I'll write $U_x$ for a uniform variable on $[0,x]$. Now linearity of expectation tells us that:
$$E[U|X=x]=x (1-x) + x E[U_x]=x (1-x) + x^2/2$$
Now the total expectation formula gives:
$$E[U]=\int_0^1 E[U|X=x] f_X(x) dx = \int_0^1 (x (1-x) + x^2/2) dx.$$
The situation is similar to calculate $E[V]$, $E[U^2]$, and $E[V]^2$, then you can just combine everything to get the correlation coefficient.