Past exam of the mathematics course of the University of Cambridge 2001 iii Paper 33 1 b Solution Created 2026-10-03 Updated 2026-10-14
For normal rejection sampling with an exponential envelope, complete the square in the probability density function ratio:The maximum occurs at , which lies in the support because . ThusThe PDF exponent is inside the square root; this distinction is lost in the converted TeX.
The acceptance rule simplifies toAn exponential proposal can be generated as from an independent uniform distribution value . Since the target is normalized, the overall acceptance probability is . To maximize it,Therefore the optimal rate is , with acceptance probability .
Finally, give each accepted half-normal distribution value an independent fair sign and output . On each half-line its probability density function is half the reflected half-normal distribution probability density function:Consequently . The sign must be drawn independently; rejection itself does not supply it.
Past exam of the mathematics course of the University of Cambridge 2010 iii Paper 33 3 Solution Created 2026-10-03 Updated 2026-10-14
Choose a proposal probability density function and a finite envelope constant such that wherever the target has positive density. A rejection sampling trial draws and, independently, ; accept whenotherwise repeat with fresh independent draws. For any measurable set ,In particular , so the conditional accepted density is . More explicitly, summing over the possible first accepted trial givesThus the algorithm terminates almost surely and its output has exactly the requested law.
The envelope constant satisfies and is the expected number of proposal trials for one output, by the geometric distribution of the waiting time. This is the quantity often called the rejection rate . The actual probability of rejecting a particular proposal is , and the expected number of rejections before one acceptance is ; these conventions should not be conflated.
To generate a standard normal distribution, first generate its absolute value, whose half-normal distribution density isWith the given exponential distribution proposal, the density ratio isIts maximum is at , hence the normal rejection sampling with an exponential envelope constant isDraw and a fresh uniform ; accept when . An accepted has density . Independently choose a sign, positive or negative with probability , and output with that sign and magnitude . On either half-line its density is , proving the normal output law.
To optimize the rejection rate, differentiateIts derivative is , negative before one and positive after one; equivalently its second derivative is . ThusThe rejection probability is consequently about .
To use only uniforms, apply inverse transform sampling: for an independent ,has survival probability for . Use a second independent uniform for acceptance, and, after acceptance, a third independent uniform to choose the sign. Repeat with fresh uniforms after any rejection. No exponential generator is then needed.