I originally found this question here.
We pick three random numbers $x,y,z$ independently from the uniform distribution $U(0,1)$. What is the probability $\max(x,y,z)-\min(x,y,z)\le\frac{2}{3}$?
I know there are several solutions, e.g. one using geometry, and one using direct integration. However, I am curious specifically with one of the approaches suggested also in the above link. The approach is to, say, define a random variable $w\triangleq \max(x,y,z)-\min(x,y,z)$ and find the cumulative density for $w$. To do so, my approach would be: $$F_w(w)=6\int_{x=0}^1\int_{z=\max(0,x-w)}^x\int_{y=z}^x1dydzdx=6\left(\int_{x=0}^w\int_{z=0}^x \int_{y=z}^x1dydzdx+\int_{x=w}^1\int_{z=x-w}^x\int_{y=z}^x1dydzdx\right)=6\left(\frac{w^2}{2}-\frac{w^3}{3}\right)=3w^2-2w^3$$
Note we multiply by 6 because of permutations of $(x,y,z)$. However, the "Expanded Solution 3" in the link suggestions you can simply compute the probability density of $y$ with $x\geq y\geq z$ holding $$f_y(x\geq y\geq z)=\int_y^1\int_0^y1dzdx=y-y^2$$ and then integrate this from $0$ to $w$ to get the desired cumulative density $F_w(w)$ $$\int_{0}^wf_y(x\geq y\geq z)=\int_{0}^w (y-y^2)dy=\frac{w^2}{2}-\frac{w^3}{3}$$ Multiplying by 6 to account for permutations gives the same expression I derived.
Can someone explain why this "shortcut" works? It's not obvious to me why integrating this probability density for $y$ from $0$ to $w$ would give the desired cumulative density, as this $f_y$ has nothing to do with the max minus min, no? I'm probably missing something simple, but any insights would be appreciated. Thanks!