Joint density of $(X,Y, \max\{X,Y\})$ with $X, Y \sim Uniform(0,1)$ independent I am trying to find the joint density of $(X,Y, \max\{X,Y\})$ with $X, Y \sim Uniform(0,1)$ independent.
Denoting $Z:= \max\{X,Y\}$
I know that $F_Z(z)= F_X(z)F_Y(z) = z^2$, and so, $f_Z(z) = 2z$, $f_Y(y) = 1, f_X(x) = 1$. I am having a hard time putting it all together, however.
I have
\begin{align}P(X \leq x, Y\leq y, Z \leq z) &= P(X \leq x, Y\leq y \vert Z \leq z)P(Z\leq Z)\\ &= P(X \leq x\vert Z \leq z)P(Y\leq y \vert Z \leq z)P(Z\leq Z)\\
& = \left(I\{x\geq z\}+I\{x < z\}\frac{x}{z}\right)\left(I\{y\geq z\}+I\{y < z\}\frac{y}{z}\right)z^2\\ &= I\{x\geq z\}I\{y\geq z\}z^2 + I\{x\geq z\}I\{y< z\}yz \\&+ I\{x< z\}I\{y< z\}xy + I\{x< z\}I\{y\geq z\}xz~,
\end{align}
I think this is correct, but I don't know how to go from here to the joint density...
 A: Let $\mu$ denote the joint distribution of $(X,Y,Z)$, and we'll denote the marginal distributions of $\mu$ using subscripts (e.g. $\mu_X$ is the marginal distribution of $X$). Let $\lambda$ denote the Lebesgue measure on $[0,1]^3$.
Typically we think of the joint density of a random variable $(X,Y,Z)$ to be the derivative of the cdf. However, there is another perspective we can look at it. $f$ be the pdf of $\mu$, and Let $g:[0,1]^3\to \mathbb{R}$ be a bounded, measurable function. Then,
$$\mathbb{E}[g(X,Y,Z)] = \int_{[0,1]^3} g(x,y,z) \mu(dx,dy,dz) = \int_{[0,1]^3} g(x,y,z)f(x,y,z)\lambda(dx,dy,dz).$$
Since this is true for all bounded, measurable $g$, $f$ can be represented as the Radon-Nikodym derivative of $\mu$ with respect to $\lambda$:
$$f(x,y,z) = \frac{d\mu}{d\lambda}(x,y,z).$$
Thus, $f$ is only well-defined when $\mu \ll \lambda$. Now consider the following event:
$$\mathcal{E} := \{X\leq 1/2, Y\in [1/2,1], Z = Y\}.$$
Then notice that,
$$\lambda(\mathcal{E}) \leq \lambda(Z=Y) = 0.$$
However,
$$\mu(\mathcal{E}) = \mu(X\in [0,1/2],Y \in [1/2,1]) = 1/4 \neq 0.$$
Thus, $\mu$ is not absolutely continuous with respect to $\lambda$, so $(X,Y,Z)$ does not have a density.
Note: When I'm talking about a density here, I mean in the standard sense with respect to the Lebesgue measure. You could define a representative measure with respect to which $\mu$ is absolutely continuous and use the Radon-Nikodym derivative to get a density with respect to that measure.
Note: An intuitive reason why $(X,Y,Z)$ does not have a density is because it has only 2 degrees of freedom ($X$ and $Y$ determine $Z$) while a density would be used to describe joint distributions with 3 degrees of freedom.
