What is the mean of the random variable $\min\{X_1,X_2\}$ and $\max\{X_1,X_2\}$, where each $X_i$ is distributed uniformly over $[0,1]$? So as stated on the title, what is the mean of the random variable $\min\{X_1,X_2\}$ and $\max\{X_1,X_2\}$, where each $X_i$ is distributed uniformly over $[0,1]$?
I know it's going to be $1/3$ and $2/3$ but I cannot derive it analytically. 
Thank you in advance
Paul
 A: The function $\min(x,y)$ can be detected by considering the function $x-y$. When $x-y\ge 0$, we have $\min(x,y)=y$, and when $x-y<0$ we have $\min(x,y)=x$. 
So it suffice to consider the value of $x-y$ on the unit square $[0,1]\times [0,1]$. It is obvious that above the diagonal line, $x-y<0$, and below the diagonal line, $x-y\ge 0$. So to calculate the "mean" of $\min(x,y)$ it suffice to integrate $x$ on the upper half triangle and $y$ on the lower half triangle. 
Now write integral along the upper half triangle as $$\int^{y}_{0}xdx\int^{1}_{0}dy=\int^{1}_{0}\frac{1}{2}y^{2}dy=\frac{1}{6}$$
The integral along the lower half triangle as 
$$\int^{x}_{0}ydy\int^{1}_{0}dx=\int^{1}_{0}\frac{1}{2}x^{2}dx=\frac{1}{6}$$
So the whole "mean" is the sum $\frac{1}{3}$. I am leaving the second result for you to prove. 
A: Two basic facts:

(1) CDF are better suited than PDF when dealing with maxima and minima of independent random variables. 
(2) To compute expectations of nonnegative random variables, CDF can be used instead of PDF.

Let $Y=\min\{X_1,X_2\}$, then Fact 2 is based on the identity $E[Y]=\int\limits_0^\infty P[Y\geqslant y]\mathrm dy$ and Fact 1 is based on the fact that, for every $y\geqslant0$, $[Y\geqslant y]=[X_1\geqslant y]\cap[X_2\geqslant y]$.
In the case at hand, $P[Y\geqslant y]=P[X_1\geqslant y]\cdot P[X_2\geqslant y]=(1-y)^2$ for $0\leqslant y\leqslant1$ and $P[Y\geqslant y]=0$ for $y\geqslant1$. This yields
$$
E[Y]=\int_0^1(1-y)^2\mathrm dy=\left[\tfrac13z^3\right]_0^1=\tfrac13.
$$
Finally, let $Z=\max\{X_1,X_2\}$, then $Z=X_1+X_2-Y$ hence $E[Z]=2E[X_1]-E[Y]=\ldots$
