1

Let $Z = ||X-Y||_2^2$ where $X$ and $Y$ are two points selected uniformly-randomly and independently on the unit circle. I'm trying to find the PDF of $Z$.

It is very similar to this question but answers over there are too clever for me. So here is what I did:

Since we are on the unit circle, if we switch to polar coordinates, both $X$ and $Y$ can be characterized by the angle. So, $$ X = \begin{bmatrix}cos(\theta_x)\\sin(\theta_x)\end{bmatrix}\ \ \ Y = \begin{bmatrix}cos(\theta_y)\\sin(\theta_y)\end{bmatrix}$$ where $\theta_x$ and $\theta_y$ are both $\sim Unif(0, 2\pi)$. Now the squared $L_2$ norm becomes

\begin{align*} ||X-Y||_2^2 & = (cos(\theta_x)-cos(\theta_y))^2 + (sin(\theta_x)-sin(\theta_y))^2 \\[7pt] & = 2 - 2(cos(\theta_x)cos(\theta_y)+sin(\theta_x)sin(\theta_y)) \\[7pt] & = 2 - 2cos(\theta_x - \theta_y) \end{align*}

I can now formulate the CDF of $Z$:

\begin{align*} P(Z\leq z) & = P(||X-Y||_2^2 \leq z) \\[10pt] & = P(2 - 2cos(\theta_x - \theta_y) \leq z) \\[7pt] & = P(cos(\theta_x - \theta_y) \geq \frac{2-z}{2}) \end{align*}

Now I take $arccos$ of both terms: \begin{align*} P(Z\leq z) & = P(\theta_x - \theta_y \leq arccos(\frac{2-z}{2})) \end{align*}

And I think this corresponds to the area of the white trapezoid below, where axes represent $\theta_x$ and $\theta_y$, red & blue lines are boundaries for $(0, 2\pi)$ and green line is $\theta_x - \theta_y = arccos(\frac{2-z}{2})$:

enter image description here

which gives

$$ F_Z(z) = \begin{cases} 0 & \text{ for } z \leq 0\\[7pt] 4\pi^2 - \frac{1}{2} (2\pi - arccos(\frac{2-z}{2}))^2 & \text{ for } 0 \lt z \lt 4\\[7pt] 1 & \text{ for } z \geq 4\\ \end{cases}$$

but this can't be true because $F_Z(z)$ is not continous at either end. I suspect I failed with the $arccos$ operation, any thoughts on how can I correct the steps?

2 Answers2

1

Plese note the fact that

$$P(\cos(a)>b)=P(\color{red}{|a|}<\text{arccos}(b))=P(-\text{arccos}(b)<a<\text{arccos}(b))$$

(but in fact this is unimportant for the sequel). Edit: You have in fact a classical arcsine distribution under a slightly generalized form $a=0,b=4$. Please note that (see the Wikipedia article) that an arcsine distribution is obtained from a uniform RV $U$ on [0,1] by considering $X=\cos(\pi U)$.

Jean Marie
  • 81,803
  • Thanks! With this correction I get $F_Z(z) = 1 - \frac{(2\pi - \alpha)^2}{4\pi^2} \text{for } 0 \lt z \lt 4$. where $\alpha\ = arccos(\frac{2-z}{2})$. But, since $\alpha$ ranges between $0$ and $\pi$, upper bound is not satisfied i.e. CDF doesn't give 1. It gives 1 if $\alpha = 2\pi$. Any thoughts on this? – Mustafa Aydın Oct 22 '20 at 11:00
  • 1
    I see that you have a complete answer now from Math Lover. See the Edit I just wrote. – Jean Marie Oct 22 '20 at 12:53
1

Not repeating all the steps that you have already done correctly.

$\theta = \theta_x - \theta_y$ is the angle measured between the two randomly chosen points on the circle from its center.

Please note $\theta$ is uniformly distributed between $0$ and $\pi$.

Formulating the CDF of $Z$ -

\begin{align*} F_Z(z) \equiv P(Z\leq z) & = P(||X-Y||_2^2 \leq z) \\[10pt] & = P((2 - 2cos \theta) \leq z) \\[7pt] & = P(cos \theta \geq \frac{2-z}{2}) \\[7pt] & = P(cos \theta \geq \frac{2-z}{2}) \\[7pt] & = P(\theta \leq \arccos\frac{2-z}{2}) \\[7pt] \end{align*}

We know

$$F_{\theta}(\theta) = \begin{cases} \frac{\theta}{\pi} & 0 \leq \theta \leq \pi \\[7pt] 0 & \text{ otherwise } \\ \end{cases}$$

So,

$$F_{Z}(z) = \begin{cases} \frac{1}{\pi} \arccos\frac{2-z}{2} & 0 \leq z \leq 4 \\[7pt] 0 & \text{ otherwise } \\ \end{cases}$$

So, pdf $ = \frac{1}{\pi} \frac{d(\arccos\frac{2-z}{2})}{dz} = \frac{1}{\pi} \frac{1}{\sqrt {4z-z^2}} \text { } (0 \leq z \leq 4)$

Math Lover
  • 51,819
  • 1
    Thanks! What is a bit unclear to me is the distribution of $\theta = \theta_x - \theta_y$. Since $\theta_x$ and $\theta_y$ range between $0$ and $2\pi$, their difference might as well go below zero or beyond $\pi$. E.g. If $\theta_x = 30^\circ$ and $\theta_y = 330^\circ$, difference is negative. IOW, can you clarify on how do you define $\theta_x$ and $\theta_y$ and how does it account for the cases like this? – Mustafa Aydın Oct 22 '20 at 11:51
  • 1
    @MustafaAydın We are interested in $Z = ||X-Y||^2$. The smaller angle between them will always be $\leq \pi$ (max $\pi$ when it is a diameter). The problem in taking $0$ to $2\pi$ is that $cos$ function is not monotonic whereas it is monotonic between $0$ and $\pi$ decreasing from $1$ to $-1$. – Math Lover Oct 22 '20 at 12:08