Let $(X,Y)$ be a uniformly distributed random point on the $2\times 2$ square with four corners at $(0,0),(2,0),(2,2)$ and $(0,2).$ Let $R$ be the distance of $(X,Y)$ to the nearest corner. Find the CDF and the PDF of $R$.
Let $r\geq 0.$ I consider the four quarter disks of radius $r$ inside the square with center at the four corners of the square. Now I observe that the event $\{R\leq r\}$ is the event that the point $(X,Y)$ lies in the union of the four disks. Note that each disk has an area of $\pi r^2/4.$
Since the point $(X,Y)$ is uniformly distributed on the square, which has area equal to $4$, we have by the remark above, that $$F_{R}(r)=\mathsf{P}(R\leq r)= \begin{cases}\displaystyle\frac{\pi r^2}{4}&\text{if }0<r\leq 2\\1&\text{if }\,\,\,r>2 \\0&\text{if }\,\,\,r\leq 0.\end{cases}$$ And differentiating with respect to $r$, we find that $$f_{R}(r)= \begin{cases}\displaystyle\frac{\pi r}{2}&\text{if }0<r\leq 2\\0&\text{otherwise. } \end{cases}$$
Is my approach correct?
Any feedback is much appreciated. Thank you for your time.
By symmetry you may assume that $(X,Y)\in[0,1]^2$ and that $R:=\sqrt{X^2+Y^2}$. It is then obvious that $$F_R(r)={\pi\over4}r^2\qquad(0\leq r\leq 1)\ .$$ When $1< r\leq\sqrt{2}$ the area in question consists of two triangles and a circular sector. The total area of the two triangles is $\sqrt{r^2-1}$, and the central angle $\alpha$ of the sector is $$\alpha={\pi\over2}-2\arctan\sqrt{r^2-1}\ ,$$ and its area is ${1\over2}\alpha r^2$. Put it all together to obtain $F_R(r)$ for $1< r\leq\sqrt{2}$.