Extra Credit (5pts). Suppose that I want to choose a random direction on the XY plane (in two dimensions). One commonly encountered incorrect way of doing so is the following. I choose randomly x in the interval (-1,1), then I choose randomly y in the same interval. Note that x and y are chosen from a uniform probability distribution equal to 1/2 between -1 and 1 and to zero elsewhere. In this way, I choose randomly a point inside the square of side 2 and centered at the origin of the XY plane (the blue point in the drawing below). The sides of this square are parallel to the axes. The point can be anywhere inside the square with the uniform (constant) probability density. However, the distance from this point to the origin is not expected to be equal to 1, in general. So, I normalize it as follows:
$\left(x, y\right) \rightarrow \left(\frac{x}{\sqrt{x^2 + y^2}}, \frac{y}{\sqrt{x^2 + y^2}}\right)$
The new point is shown as the red dot below. If my original point turns out to be (0,0), which will happen very rarely if at all, I discard it. Now, my new points are all on the unit circle and can be characterized by the polar angle \(\varphi\), which varies in \([0, 2\pi)\). See the illustration below.
AY
X
For a truly random direction, I would expect that the probability distribution of the angles \(\varphi\) of the generated points would be uniform in \([0, 2\pi)\). However, it is easy to see that, in the procedure described above, the points will accumulate more densely in the directions pointing towards the square corners.
Question: Find the probability distribution \(P(\varphi)\) for the points generated by the procedure described above.