CDF of $M(X,Y)$? Let $X,Y \sim^{\text{iid}} Unif(0,1)$. Let $M = M(X,Y) = \min\{X,Y,1-Y,1-X,|X-Y|,1-|X-Y|\}$. Supposedly $image(M) \subseteq (0,\frac13)$ and distribution of $M$ is $F_M(m)= (3m(2-3m))1_{(0,\frac13)}(m) + 1_{(\frac13,\infty)}(m)$.
Question: How do I compute the CDF of $M$? Below is what I've tried so far.
Well $|X-Y| \ge m$ and $1-|X-Y| \ge m$ tells me $m \le |X-Y| \le 1-m$. So it looks like I have 4 cases

*

*$x+(m-1) \le y \le x-m$


*$x+m \le y$


*$y \le x-m$


*$x-(m-1) \le y \le x+m$ (but I think I rule out this last case because here I have $m \ge \frac12$.
Then $X,Y,1-Y,1-X \ge m$ tells me $m \le X \le 1-m$ and $m \le Y \le 1-m$. So I guess the 3 cases become

*

*$x+m-1 = \max\{m,x+m-1\} \le y \le \min\{x-m,1-m\} = x-m$


*$x+m = \max\{m,x+m\} \le y \le 1-m$


*$m \le y \le \min\{x-m,1-m\} = x-m$
But it seems if I do $\int_0^1 \int_{\cdot}^{\cdot} 1 dy dx$ for each case and then add them up I get only $2-6m$.
 A: As always, begin by drawing a picture.

The answer is immediate just by glancing at this figure and requires almost no calculation.  I will explain--but the explanation takes much longer than finding the answer!
Because $(X,Y)$ has a uniform distribution, the value of the CDF at any height $z=\min(x,y,1-y,1-x,|x-y|,1-|x-y|)$ is proportional to the area of the points not enclosed by the level-$z$ contour.
The plot suggests there is a 6-fold symmetry group in play.  We can exploit it by choosing a representative of each coset.  I have chosen to use the triangle $ABC.$  (This is where $y$ is the smallest of the six values $x,$ $y,$ etc.  The other five regions correspond to the places where any given one of those six values is the smallest.)
For instance, given any $(x,y)$ in the unit square,

*

*If $x \le y$ (a location in the upper left set of contours), then $(y,x)$ is in the lower right half of the unit square and $z(y,x)=z(x,y).$


*Given we have arranged that $x \ge y,$ find the smallest value among the nonnegative numbers $y,$ $x-y,$ and $1-x.$  Since their average is $(y+(x-y)+(1-x))/3 = 1/3,$ the smallest must lie between $0$ and $1/3.$  Now:

*

*If $y$ is the smallest, do nothing.

*If $x-y$ is the smallest, replace $(x,y)$ by $(1-y,x-y).$

*Otherwise (when $1-x$ is smallest), replace $(x,y)$ by $(1-(x-y), 1-x).$
You can easily verify this preserves the value of $z,$ because (based on step $(1)$) the smallest value among $x,$ $y,$ $\ldots,$ $1-|x-y|$ does not change.  In the preceding figure, these operations are merely rotating the vertices $(0,0),$ $(1,0),$ and $(1,1)$ among themselves, corresponding to a (generalized) order-three rotation of that triangle (with $A$ as its center).
Steps $(1)$ and $(2)$ preserve the value of $z$ and map the unit square in a six-to-one fashion into the triangle $ABC$ (a fundamental domain of the group).    Here is a detail of the values of $z$ within this fundamental domain.  Since we have arranged to make $y=z,$ they are all horizontal and equally spaced with heights equal to $z:$

Because all contours enclose similar triangular regions (with apex $A$) and heights $1/3-z,$ it is now obvious that the relative area above any value $z,$ where $0\le z\le 1/3,$ is proportional to the square of the height $1/3-z.$  Consequently the CDF (which is the complementary probability) must take the form
$$F_Z(z) = 1 - C(1/3-z)^2.$$
Since $F_Z(0)=0,$ the only possible value for the normalizing constant is $C=9$ (this is the only calculation needed to solve this problem!) and

$$F_Z(z) = 1 - 9(1/3-z)^2.$$

Here is a histogram of the $z$-values of the pixels used in the two figures, on which I have superimposed a plot of the density $\mathrm{d}/\mathrm{d}z\,F_Z(z) = 18(1/3-z):$

Their agreement is near-perfect.
A: Ok here's what I did on wolfram:
By trying out values of $m=\frac15, \frac16, \frac17$ (Btw: $\frac14$ was kind of an outlier. See below re 'only issue'. Also, as expected, $\frac13$ gave no solutions), I got 4 cases

*

*$x \in (m,2m)$, $y \in (x+m,1-m)$

*$x \in (2m,1-2m)$, $y \in (m, x-m)$

*$x \in (2m,1-2m)$, $y \in (x+m, 1-m)$

*$x \in (1-2m,1-m)$, $y \in (m,x-m)$
When sketching this, I ended up getting 4 trapezoid figures.
Anyhoo, I got

*

*$\int_m^{2m} \int_{x+m}^{1-m} 1 dy dx$


*$\int_{2m}^{1-2m} \int_{m}^{x-m} 1 dy dx$


*$\int_{2m}^{1-2m} \int_{x+m}^{1-m} 1 dy dx$


*$\int_{1-2m}^{1-m} \int_{m}^{x-m} 1 dy dx$


*Combining (1) and (3), we get $\int_m^{1-2m} \int_{x+m}^{1-m} 1 dy dx$


*Combining (2) and (4), we get $\int_{2m}^{1-m} \int_{x+m}^{1-m} 1 dy dx$


*Combining (5) and (6) we get our desired distribution.
My one issue however is the very fact that we say $(2m,1-2m)$ in the first place suggests $m \in (0,\frac14)$ only! (See above re 'outlier'.) I mean, I don't think $2m$ and $1-2m$ should be compared, but I think $m$ and $1-m$ should be compared.
I think this can be fixed if we just do 2 cases

*

*$x \in (m,1-2m)$, $y \in (x+m,1-m)$, combining (1) and (3)

*$x \in (2m,1-m)$, $y \in (m, x-m)$, combining (2) and (4)

