Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2014/iii/paper-36/3/a/solution

Generate independent and use the Box-Muller transform
For , , so its density is on . The angle is uniform on and independent of . Dividing the joint radial-angular density by the polar-coordinate Jacobian gives
Thus both outputs are independent and have the standard normal distribution. Independent pairs of uniforms give further independent normal observations. The null event is excluded in implementation so the logarithm is finite.

New to topics? Read the docs here!