Conditional expectation of $\max(X,Y)$ and $\min(X,Y)$ when $X,Y$ are iid and exponentially distributed I am trying to compute the conditional expectation $$E[\max(X,Y) | \min(X,Y)]$$ where $X$ and $Y$ are two iid random variables with $X,Y \sim \exp(1)$. 
I already calculated the densities of $\min(X,Y)$ and $\max(X,Y)$, but I failed in calculating the joint density. Is this the right way? How can I compute the joint density then? Or do I have to take another ansatz? 

If $Z = \min(X,Y)$ and $W = \max(X,Y)$, then for $w > z$,
$$\begin{align*}
F_{Z,W}(z,w) &= P\{Z \leq z, W \leq w\}\\
&= P\left[\{X \leq z, Y \leq w\} \cup \{X \leq w, Y \leq z\}\right]\\
&= P\{X \leq z, Y \leq w\} + P\{X \leq w, Y \leq z\} - P\{X \leq z, Y \leq z\}\\
&= F_{X,Y}(z, w) + F_{X, Y}(w,z) - F_{X,Y}(z,z)
\end{align*}
$$ 
while for $w < z$,
$$\begin{align*}
F_{Z,W}(z,w) &= P\{Z \leq z, W \leq w\} = P\{Z \leq w, W \leq w\}\\
&= P\{X \leq w, Y \leq w\}\\
&= F_{X,Y}(w,w).
\end{align*}
$$ 
Consequently, if $X$ and $Y$ are jointly continuous
random variables, then 
$$f_{Z,W}(z,w) = \frac{\partial^2}{\partial z \partial w}F_{Z,W}(z,w) = 
\begin{cases}
f_{X,Y}(z,w) + f_{X,Y}(w,z), & \text{if}~w > z,\\
\\
0, & \text{if}~w < z.
\end{cases}
$$
The conditional density of $W$ given $Z = z$ is 
$$
f_{W \mid Z}(w \mid z) = \frac{f_{Z,W}(z,w)}{f_Z(z)}
= \begin{cases}
\frac{f_{X,Y}(z,w) + f_{X,Y}(w,z)}{\int_z^{\infty} f_{X,Y}(z,w) + f_{X,Y}(w,z)\ 
\mathrm dw}, & w > z,\\
0, & w < z,
\end{cases}
$$
and so with $f_{X,Y}(x,y) = e^{-x-y}$ for $x, y \geq 0$
$$
\begin{align*}E[W \mid Z = z] 
&= \frac{\int_z^\infty w\cdot f_{X,Y}(z,w) + w\cdot f_{X,Y}(w,z)\  \mathrm dw}{
\int_z^\infty f_{X,Y}(z,w) + f_{X,Y}(w,z)\  \mathrm dw}\\
&= \frac{\int_z^\infty w\cdot e^{-w-z} + w\cdot e^{-w-z}\  \mathrm dw}{
\int_z^\infty e^{-w-z} + e^{-w-z}\  \mathrm dw}\\
&= \frac{2e^{-2z}\int_z^\infty w\cdot e^{-w}\  \mathrm dw}{
2e^{-2z}} = \frac{2e^{-z}[\left . (-we^{-w})\right\vert_z^{\infty}
+ \int_z^{\infty}e^{-w}\ \mathrm dw]}{2e^{-2z}}\\
&= 1 + z.
\end{align*}
$$
