Skip to content

Rejection sampling a Beta(3,2) with the tightest box

Question

To simulate from Beta(3,2)\text{Beta}(3,2), whose density is f(x)=12x2(1−x)f(x)=12x^2(1-x) on (0,1)(0,1), you draw points uniformly from the box [0,1]×[0,a][0,1]\times[0,a] and keep a point only if it falls under the graph of ff. Choose a>0a>0 to minimise rejections. With this choice, what is the expected number of rejected points per accepted point?

Short answer

79\tfrac79. The box must cover the density, so the best aa is max⁡f=f(23)=169\max f=f(\tfrac23)=\tfrac{16}9. Each point is accepted with probability 1a=916\tfrac{1}{a}=\tfrac9{16}, so rejections before an acceptance are geometric with mean 1−9/169/16=79\tfrac{1-9/16}{9/16}=\tfrac79.

Adapted from QuantQuestions.io; question and answer rewritten by SelfMadeQuant.com.

See the hint and the full worked solution in the question bank (free account).

Open the worked solution

Lessons behind this question

Start with a free lesson: Expectation, Variance and Covariance is part of a free topic. Create a free account, no card needed, to read it in full with worked solutions.

Read it free