Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2006/iii/paper-47/3/b/ii/solution

Integrating the two linear pieces gives the cumulative distribution function
The split probability is . Invert each branch to obtain the method of inversion:
Both expressions equal three at the split. For an ideal uniform draw, monotonicity gives , proving the target law. Inversion is preferable here: its quantile is explicit, it uses one uniform and one square root per output, and has no rejected draws. Rejection remains useful for densities with no convenient inverse CDF.

New to topics? Read the docs here!