CDF of $\max(x_1,x_2)+\max(x_3,x_4)$ where all $x_i$s are iid from $U[a,b]$ I am looking for the cumulative density function of the sum of two variables, which are themselves the result of a rank order process.
Thus, if $x_1, x_2, x_3$ and $x_4$ are all independent draws from a uniform distribution with support $[a,b]$, what is the CDF for $\max(x_1,x_2)+\max(x_3,x_4)$?
Thanks.
 A: Suppose $u,v$ are i.i.d. $U(0,1)$. Then for any $w\in[0,1]$, $\operatorname{Pr}(\max(u,v)\le w)=w^2$. Hence the density of $W=\max(u,v)$ is given by $f(w)=2w$. Therefore, if $X=(\max(x_1,x_2)-a)/(b-a)$ and $Y=(\max(x_3,x_4)-a)/(b-a)$, the densities of $X$ and $Y$ on $[0,1]$ are $2x$ and $2y$ respectively.
Now let $Z=X+Y=\left[\max(x_1,x_2)+\max(x_1,x_2)-2a\right]/(b-a)$. Then for any $m\in[0,\,2]$, we have
$$
\phantom{=}\operatorname{Pr}\left(Z\le m\right)
=\begin{cases}
\int_0^m \int_0^{m-y} 4xy\, dx dy=\frac{m^4}{6} &\text{ if } m\le1,\\
1-\int_{m-1}^1 \int_{m-y}^1 4xy\, dx dy = 1-\frac16m(m-2)^2(m+4) &\text{ otherwise}.
\end{cases}
$$
A: Let $X=\max\{x_1,x_2\}$. We find the density function of $X$. We have that $F_X(x)=\mathbb{P}\{X\leq x\}=\mathbb{P}\{\max\{x_1,x_2\}\leq x\}=\mathbb{P}\{x_1\leq x \cap x_2\leq x\}=\mathbb{P}\{x_1\leq x\}\mathbb{P}\{x_2\leq x\}$. Because they are uniformly distributed, it follows that the above is just the product of the cdfs of your original uniform distribution. Therefore $F_X(x)=(\frac{x-a}{b-a})^2$ whenever $x\in[a.b)$. From this it follows that $f_X(x)=\frac{2(x-a)}{(b-a)^2}$. Similarly, if $Y=\max\{x_3,x_4\}$, you have that $f_Y(y)=\frac{2(y-a)}{(b-a)^2}$. Now let $Z=X+Y$. You have that $Z\leq 2b$ with probability one and $Z\leq 2a$ with probability 0. For $z\in[2a,2b)$ you have $F_Z(z)=\mathbb{P}\{Z\leq z\}=\mathbb{P}\{X+Y\leq z\}=\int_A f_{X,Y}(x,y) dA$ Because of independence of $x_1,x_2,x_3$ and $x_4$ you have that $X$ and $Y$ are independent. This means that $f_{X,Y}(x,y)=f_X(x)f_Y(y)$. Therefore, $F_Z(z)=\int_A f_X(x)f_Y(y) dA=\int_{-\infty}^\infty\int_{-\infty}^{z-x}f_X(x)f_Y(y)dydx=\int_{-\infty}^\infty f_X(x)\int_{-\infty}^{z-x}f_Y(y)dydx=\int_a^b f_X(x)\int_a^{z-x}f_Y(y)dydx=\int_a^b f_X(x) (\frac{a+x-z}{b-a})^2dx=\frac{1}{(b-a)^4}\int_a^b 2(x-a)(a+x-z)^2 dx=\frac{1}{12(a-b)^2}(11a^2+10ab-16az +3b^2-8bz+6z^2)$. I hope this is correct. 
