Solution
ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2002/iii/paper-40/1/a/iv/solution
Past exam of the mathematics course of the University of Cambridge 2002 iii Paper 40 1 a iv Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-14
Independently generate uniform on and uniform on , using the bounds above. Accept the proposal ifotherwise generate a fresh pair. On acceptance return . The bounding rectangle contains the entire ratio region: , and lies between the extrema of . Conditioning a uniform rectangle point on acceptance makes it uniform on , so the preceding marginal distribution calculation proves that the returned value has the desired Laplace distribution.
For this target , so the region has area two. The rejection sampling acceptance probability isEndpoints have zero probability and can be excluded to avoid divisions by zero in implementation.
New to topics? Read the docs here!