Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2012/iii/paper-38/3/ii/solution

Introduce . Solving the quadratic and using its product of roots gives
Both roots are positive, with ; equality occurs only for . For computation, the smaller root has the equivalent cancellation-free form
This is stable root evaluation for inverse Gaussian sampling.
Define . It decreases from infinity to zero on and increases from zero to infinity on , since
The two roots are precisely its inverse branches. This supplies the Jacobians needed for the reciprocal-root inverse Gaussian sampler.

New to topics? Read the docs here!