Past exam of the mathematics course of the University of Cambridge 2004 iii Paper 40 3 iii Solution Created 2026-10-03 Updated 2026-10-14
Use uniform-envelope rejection sampling for a beta distribution. Put for and choose . For , differentiation of gives the mode , soIf or , take ; this also covers . Draw and accept it ifOtherwise continue with the next independent pair. The probability of acceptance is , so the procedure terminates almost surely. Conditional on acceptance, the probability density function is proportional to , hence is exactly the beta distribution of parameters . The restriction guarantees the bounded uniform envelope.