# Transforming a uniform random variate to points on a circle

Sample $$U \sim \text{Uniform}(0,\sqrt{2}-1)$$. Accept $$U$$ with probability $$1/(1+U^2)$$ (else reject and sample again). Set $$X = 2U/(1+U^2)$$ and $$Y = 1-UX = (1-U^2)/(1+U^2)$$. With probability 1/2, switch the values of $$X$$ and $$Y$$. With probability 1/2, independently, change the signs of $$X$$ and $$Y$$.

Prove: The points $$(X,Y)$$ are uniformly distributed on the circumference of the unit circle.

I've simulated the points on R and can confirm that this method actually works. It's also clear that $$X^2+Y^2 = 1$$. But how does one show analytically that the points generated using this method lie on the unit circle?

• Hint: write $U=\tan(\theta)$ and show that $\theta$ is uniformly distributed on the interval $[-\pi/8, \pi/8].$ The rest is just trigonometry. – whuber Jul 8 at 16:03
• If $X^2+Y^2=1$ it should not be hard to prove "the points generated using this method lie on the unit circle". – Xi'an Jul 8 at 18:36

Let $$T$$ be the random variable sampled after accepting $$U$$. For $$t \in (0,\sqrt{2}-1)$$,
$$P(T \leq t) = P(U \leq t \vert V \leq 1/(1+U^2))$$ where $$V \sim \text{Unif}(0,1)$$ independent of $$U$$. This gives the following density for $$T$$: $$f_T(t) = \frac{1}{\arctan(\sqrt{2}-1)}\frac{1}{1+t^2} = \frac{1}{\pi/8}\frac{1}{1+t^2}, \ \ t \in (0,\sqrt{2} - 1)$$
Now, using the hint, let $$T = \tan \theta$$. Transform the density of $$T$$ to get $$\theta \sim \text{Unif}(0,\pi/8)$$. Write $$X$$ and $$Y$$ in terms of $$\theta$$ to get $$X = \sin 2\theta$$ and $$Y = \cos 2 \theta$$. Without applying the switch and sign change, $$(X,Y)$$ is uniformly distributed on the first quandrant of the unit circle. Apply the switch and sign change to conclude the proof.