Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2004/iii/paper-40/3/iv/solution

For , use the unnormalized normal shape . The ratio-of-uniforms method samples uniformly from
Its boundary is . The largest possible occurs at and equals , giving the normal ratio-of-uniforms envelope , .
Use independent uniform pairs to propose and . Accept precisely when
To verify its distribution, change coordinates from to , with and Jacobian determinant . The accepted point is uniform on , and the marginal probability density function of is proportional to
Thus the result is . The region has positive finite area , and the acceptance probability is . The case requires simply returning zero.

New to topics? Read the docs here!