Log-concave probability density Created 2026-10-05 Updated 2026-10-06
A probability density is log-concave when its logarithm is a concave function on its support. Tangent lines to a differentiable concave log density lie above its graph, giving exponential envelopes for rejection sampling.
Past exam of the mathematics course of the University of Cambridge 2006 ia Paper 2 11F Solution Created 2026-09-24 Updated 2026-09-24
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 32 2 a Solution Created 2026-10-03 Updated 2026-10-07
Label batches before consulting the random-number table, so their labels are independent of the test results. A uniformly random permutation of , restricted to a smaller label set, induces a uniformly random ordering of that set. This provides a simple rejection-and-restriction scheme:
- For A, label each day's six batches . Use a fresh permutation, discard labels , and test the first remaining batch. Repeat independently on each working day. Each daily batch has inclusion probability , and five batches are tested per week.
- For B, label the fifteen weekly morning batches . Discard label 16 from a fresh permutation and choose the first three remaining labels. Use an independent permutation for the afternoon stratum. Every three-element subset within a stratum is equally likely, and each batch has inclusion probability . Six batches are tested per week.
- For C, label the weekdays . Keep the first label in this range from a fresh permutation and test all six batches on that day. Repeat independently each week. Every day, and hence every batch, has inclusion probability ; six batches are tested per week.
With independent random digits instead, rejection sampling gives the same uniform choices: for A keep only digits ; for C keep only . For B, use uniform two-digit numbers, retain labels , and reject repeats within a three-batch sample. Taking residues modulo six or fifteen from a table whose range is not divisible by that number would give unequal probabilities. These are respectively day-stratified simple random sampling, morning/afternoon stratified sampling, and a one-day design using cluster sampling. The printed word “rest” for A is interpreted as “test”, consistently with the surveillance task. If it instead meant leaving one batch untested, choose that omitted batch uniformly and test the other five; this alternative would test 25 batches per week, with inclusion probability , and has a different testing budget.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 36 4 b Solution Created 2026-10-03 Updated 2026-10-06
For each proposal , independently draw and accept it whenThe ratio is at most one, as required. For any measurable set ,so the acceptance probability is and the conditional distribution of an accepted proposal has density . Repeating independent trials until acceptance therefore gives an exact draw from , and repeating the whole procedure gives iid target draws. This proves rejection sampling.
The number of proposals for one successful draw is geometric with mean . Thus is also the expected proposal cost of this exact simulation method.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 208 5 c Solution Created 2026-10-03 Updated 2026-10-06
On , the exponential proposal is the proper density ; its integral is . The word “improper” in the question is therefore not applicable on its stated positive support.
The target-to-proposal ratio isIts maximum occurs at , so the smallest valid envelope constant isOne implementation draws and accepts it when , for independent random variables with the uniform distribution on . Accepted observations have the positive half-normal density by the usual rejection sampling calculation.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 216 1 b Solution Created 2026-10-03 Updated 2026-10-06
Adaptive rejection sampling is exact rejection sampling for a differentiable log-concave probability density. Given interior evaluation points , construct the upper envelopewhere is the unnormalized target probability density function. The concave function lies below all its tangent lines, so . Interpolation between adjacent evaluation points gives a lower envelope there, allowing a squeeze test. The normalized upper envelope is a piecewise exponential proposal distribution.
Draw and an independent from the uniform distribution, and accept when . A squeeze test can establish acceptance without evaluating . Otherwise evaluate and, whenever it is evaluated, add to the envelope's points. Repeat until acceptance. On each linear piece , its integral is on , with value when . These integrals select a piece; inverse transform sampling samples within it.
Here, with and , the log-posterior on hasChoose evaluation points strictly inside , avoiding any endpoint singularities of the logarithm. Every finite set of tangent lines gives a finite upper-envelope integral on this bounded interval; slope conditions needed for unbounded supports are unnecessary. When the posterior distribution is simply the uniform distribution and may be sampled directly.
For any fixed envelope, proposal times acceptance is proportional to . Conditional on all past evaluations and rejections, the next accepted value therefore has the same normalized posterior density. To see that adaptation does not spoil this, at every attempted draw its accepted mass is a scalar times that fixed posterior density; summing over possible rejection histories preserves it. The acceptance probability stays bounded below by its positive initial-envelope value because insertion only lowers the upper envelope. Thus acceptance occurs almost surely. With fresh independent randomness, successive accepted values are exact independent samples from the posterior distribution, even when the envelope is retained and improved between them.
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 216 3 b ii Solution Created 2026-10-03 Updated 2026-10-05
Given the parameters and , the coordinates are conditionally independent. Write , , and let denote the observed count. Their full conditional distributions have scalar densitiesEach is proper: the binomial distribution likelihood factor is bounded, and the remaining factor is a proper normal distribution density.
One completely specified exact algorithm is rejection sampling from . DefineFor ,for or , take , and for take . Propose and accept with probability , repeating until acceptance. The accepted density is proportional to the proposal times , exactly . Its acceptance probability is positive, so it terminates almost surely, although it can be inefficient.
An efficient exact alternative is adaptive rejection sampling. The log density hasThus it is a log-concave probability density. Choose one tangent point with positive derivative in the left tail and one with negative derivative in the right tail; these exist because the Gaussian term dominates there. Their tangent upper hull gives an integrable piecewise exponential rejection envelope. Sample that envelope, accept using the target-to-envelope ratio, and add evaluated points to improve it. Concavity guarantees the upper bound, so accepted samples remain exact. Sample each coordinate independently by either method; a finite number of Metropolis steps would not provide the requested exact draws.
Past exam of the mathematics course of the University of Cambridge 2022 ii Paper 4 28K b Solution Created 2026-09-24 Updated 2026-09-25
In one proposal of rejection sampling, the probability of both proposing a value in and accepting it isIntegrating shows that the acceptance probability is . Conditional on acceptance, the density of the proposed value is thereforeEach unsuccessful proposal restarts independently, so the eventual output has the same conditional density: