Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2007/iii/paper-48/3/i/solution

Substitute , with , when integrating the target density. Since , its cumulative distribution function is
Inverting gives the arcsine distribution sampler
The inverse transform sampling proof in the root solution shows that it has the required probability density function. Use successive independent uniforms for successive samples. A draw at the endpoint one can be discarded if values strictly inside the support are desired; this event has probability zero under the ideal continuous uniform distribution.

New to topics? Read the docs here!