Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 40 3 b Solution Created 2026-10-03 Updated 2026-10-14
The region usually has a curved boundary, so sampling uniformly inside it directly is inconvenient. Rejection sampling replaces it by an easily sampled envelope, usually a rectangle. Choose finite bounds withThen up to null boundaries. A general rectangle algorithm uses only independent uniform deviates: draw on , set , , and return if ; otherwise repeat. If a numerical generator returns , discard that draw before division. No knowledge of is required to run the method. Its acceptance rate is the ratio of the two areas:More generally the same area ratio applies to any finite-area envelope sampled uniformly. A change in the proportionality constant of scales both ratio coordinates and their areas consistently.
Finite rectangle bounds are a real condition, not a consequence of integrability alone. For instance is integrable, but is unbounded. A finite-area envelope for a ratio-of-uniforms region gives a general extension: choose a finite-area open envelope containing , decompose it up to null boundaries into countably many disjoint rectangles, and select a rectangle with probability proportional to its area using a uniform draw and cumulative probabilities. Use two more uniforms to sample within it, then apply the same acceptance test. This samples the envelope uniformly and has acceptance . Such envelopes exist for every finite-area measurable ; obtaining usable bounds or an effective rectangle decomposition is density-specific. The finite-rectangle version above is the usual practical implementation.