You want samples from p(x)=6x(1−x) on [0,1] (the Beta(2,2) density) using a Uniform(0,1) proposal. Find the smallest valid envelope constant M, the acceptance rule and the acceptance probability. What changes if you only know the unnormalised density p~(x)=x(1−x)?

Probabilistic models, Sampling methods
Level L2 Elementary. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can set up rejection sampling and compute its efficiency, and know that the normalising constant is not needed.

Key idea

Rejection sampling needs M with Mq(x)≥p~(x) for all x. Draw x∼q, u∼U(0,1), accept if u≤p~(x)/(Mq(x)). The overall acceptance rate is ∫p~M, which is 1/M for a normalised p.

Steps

  1. The proposal is q(x)=1 on [0,1]. We need M≥p(x)=6x(1−x) everywhere. The maximum is at x=0.5, giving 6⋅0.25=1.5. So M=1.5.
  2. Acceptance rule: draw x∼U(0,1) and u∼U(0,1). Accept if u≤6x(1−x)1.5=4x(1−x). At x=0.5 the ratio is 1, and at x=0.25 it is 0.75.
  3. Why it works: the point (x, uMq(x)) is uniform under the curve Mq. We keep points under p, so the kept x have density proportional to p(x).
  4. Acceptance probability: ∫p(x)Mq(x)q(x)dx=1M∫p=11.5=23. So about one in three proposals is wasted.
  5. Unnormalised case: p~(x)=x(1−x) has maximum 0.25, so use M=0.25 and the same rule u≤4x(1−x). The samples are identical. The acceptance rate is ∫01x(1−x)dx/M=1/60.25=23, the same as before.
  6. So the normalising constant is never needed. Only the ratio p~/(Mq) is used. In high dimensions M grows exponentially and the acceptance rate collapses, which is why MCMC is used.

Common mistakes

How long your answer should be

Half a page; 4 minutes.

Last checked on 4 December 2026.

Read this

Previous in Probabilistic models: A coin has unknown heads probability θ with prior θ∼Beta(2,2). After 10 tosses you see 7 heads and 3 tails. Find the posterior, the MLE, the MAP estimate and the posterior mean. What is the probability that the next toss is heads, and the probability that the next two tosses are both heads?
Next in Probabilistic models: How do you derive the evidence lower bound (ELBO), and what is the gap?