# What is cov(X,Y), where X=min(U,V) and Y=max(U,V) for independent uniform(0,1) variables U and V?

Let $X=\min(U,V)$ and $Y=\max(U,V)$ for independent uniform(0,1) variables $U$ and $V$. What's the covariance of $X$ and $Y$? Could you develop some calculations, especially regarding the computation of $\mathbb{E}XY$?

• Because the mapping $(U,V)\to(X,Y)$ simply folds the unit square in half along the diagonal, the joint distribution of $(X,Y)$ is uniform on the upper triangle $0\le X\le 1$, $0\le Y\le 1$, $X\le Y$. – whuber Apr 6 '12 at 16:16
• – Franck Dernoncourt Jan 9 '17 at 0:42

Obviously $XY=UV$ therefore the calculation of $\mathbb{E} XY$ is really easy !

• +1. $\mathbb{E} X$ and $\mathbb{E} Y$ are harder – Henry Apr 6 '12 at 9:56
• +1. @Henry But since $E[U+V]=E[X+Y]=1$ so that $E[U]=1-E[V]$, only one "hard" calculation is necessary. – Dilip Sarwate Apr 6 '12 at 12:50

I see that we still need to find E[X] and E[Y].

From Franck's Question and Answer, we see that

E[X] + E[Y] = E[U] + E[V] = 1

and

E[Y - X] = E[Y] - E[X] = E[ |U - V| ]

So, we calculate E[ | U - V | ]

$$\int_{0}^{1} \int_{0}^{1} |u - v| dvdu = 2\int_{0}^{1} \int_{0}^{u} (u - v) dvdu = \int_{0}^{1} u^2 du = \frac{1}{3}$$

So, E[Y] - E[X] = 1/3 and E[Y] + E[X] = 1. There are two equations and two unknowns so we solve and get

$$E[Y] = \frac{2}{3} \quad and \quad E[X] = \frac{1}{3}$$

Finally,

$$cov[X, Y] = E[XY] - E[X]E[Y] = \frac{1}{4} - \frac{1}{3}*\frac{2}{3} = \frac{1}{36}$$