Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 216 1 c Solution Created 2026-10-03 Updated 2026-10-06
An exact finite mixture model follows from the binomial theorem:Define positive mixture weightsHere is the Beta function, so the component probability distributions are . All coefficients are computable from the observed integer counts.
Use inverse transform sampling with the supplied to choose : writing and , take . Then recycle its position inside that interval,Recycling a uniform random variable after discrete sampling makes uniform independently of , since . It is also independent of all supplied random variables with gamma distributions. Transform these by the probability integral transform:They are independent random variables with uniform distributions because has a unit-rate exponential distribution.
Conditional on , put and . Form the values and return their th order statistic. This uses at most the supplied random variables with gamma distributions, since . The uniform order statistic formula givesAveraging these component probability density functions with weights recovers exactly the normalized posterior density. Unused inputs can be discarded. When , , , and the output is , as required. Interval endpoints and ties have probability zero; any consistent convention there is harmless. Exactness here concerns the mathematical algorithm; finite-precision arithmetic can be stabilized with logarithmic mixture weights.