Find the Correlation coefficient between $X_{(1)},X_{(3)}$ There is the following question:

Let $X_{(1)},X_{(2)},X_{(3)}$ be statistic order of three independent random variables $X_1,X_2,X_3$ with uniform distribution in $[0,1]$. Find the Correlation coefficient between $X_{(1)},X_{(3)}$.

We know that $X_{(k)}\sim Beta(k,4-k)$ so we get:
$$
Var\left(X_{(k)}\right)=\frac{k\cdot(4-k)}{(k+(4-k))^{2}\cdot(k+(4-k)+1)}=\frac{k(4-k)}{80}, E\left(X_{(k)}\right)=\frac{k}{(4-k)+k}=\frac{k}{3}
$$
We can use the following theorem to calculate $Corr\left(X_{(1)},X_{(3)}\right)$:
$$
Corr\left(X_{(1)},X_{(3)}\right)=\frac{Cov\left(X_{(1)},X_{(3)}\right)}{\sqrt{Var\left(X_{(1)}\right)}\sqrt{Var\left(X_{(2)}\right)}}=\frac{E\left(X_{(1)},X_{(3)}\right)-E\left(X_{(1)}\right)E\left(X_{(3)}\right)}{\sqrt{Var\left(X_{(1)}\right)}\sqrt{Var\left(X_{(2)}\right)}}
$$
The only thing left to calculate is $E\left(X_{(1)},X_{(3)}\right)$. In the solution it says that the Probability density functions are:

I'm not understanding how they calculated the left function. Will be glad to see some explanation. Which theorem did they use?
 A: The tripple joint density function for the order statisics is the probability denisity function for arrangments of the samples that fits those three ordered values, $x\leqslant y\leqslant z$.
Since these three samples are identically and independently distributed, that is:
$$\begin{align}f_{\small\! X_{(1)},X_{(2)},X_{(3)}}\!(x,y,z) &={( f_{\small\! X_1,X_2,X_3\!}(x,y,z) + f_{\small\! X_1,X_2,X_3\!}(x,z,y)+f_{\small\! X_1,X_2,X_3\!}(y,x,z)\\+f_{\small\! X_1,X_2,X_3\!}(y,z,x)+f_{\small\! X_1,X_2,X_3\!}(z,x,y)+f_{\small\! X_1,X_2,X_3\!}(z,y,x))~\mathbf 1_{x\leqslant y\leqslant z}} \\[1ex] &= 3!\,f_{\!\small X_1}\!(x)\,f_{\!\small X_1}\!(y)\,f_{\!\small X_1}\!(z))\;\mathbf 1_{x\leqslant y\leqslant z}\\[1ex]&=3!\,\mathbf 1_{0\leqslant x\leqslant y\leqslant z\leqslant 1}\end{align}$$

The marginal for the joint pdf for $X_{(1)}$ and $X_{(3)}$ is just the integral of this for all middle values between the least and most order statistic.
$$\begin{align}f_{\small\! X_{(1)},X_{(3)}}\!(x,z) &=\int_x^z f_{\small\! X_{(1)},X_{(2)},X_{(3)}}\!(x,y,z) ~\mathrm d y \\[2ex]&= 3!~(z-x)~\mathbf 1_{0\leqslant x\leqslant z\leqslant 1}\end{align}$$

Similarly: $$\begin{align}f_{\small X_{(1)}}(x)&= 3\,(1-x)^2~\mathbf 1_{0\leqslant x\leqslant 1}\\[3ex]f_{\small X_{(2)}}(y)&=3!\,y(1-y)\,\mathbf 1_{0\leqslant y\leqslant 1}\\[3ex]f_{\small X_{(3)}}(z)&= 3\,z^2\,\mathbf 1_{0\leqslant z\leqslant 1}\end{align}$$

That is all.
A: A shortcut to the answer is to note that $(X_{(1)}, X_{(2)} - X_{(1)}, X_{(3)} - X_{(2)}, 1 - X_{(3)}) = (p_1, p_2, p_3, p_4)$ is uniformly distributed on the simplex, i.e., it has a $\operatorname{Dirichlet}(1,1,1,1)$ distribution. Therefore, $\text{Cov}(X_{(1)}, X_{(3)}) = -\text{Cov}(p_1, p_4)$ which using the properties of the Dirichlet distribution is $(1 \times 1) / (4^2 * 5) = 1/80$. We also have $\text{Var}(X_{(1)}) = \text{Var}(X_{(3)}) = \text{Var}(p_1) = \text{Var}(p_4) = 3/80$ so the correlation is $1/3$.
