For rejection sampling, independently generate a proposal with density and a uniform on . Accept if ; otherwise generate a fresh independent pair and repeat. Set the ratio to zero on where necessarily . The envelope condition makes the acceptance threshold at most one.
For any measurable set , a single attempt satisfies
Taking the whole space shows that acceptance has probability . Conditioning on acceptance therefore gives density . Repeating rejected independent attempts preserves that conditional law and terminates almost surely; the number of attempts is geometric with mean .
For fixed proposal density, admissibility requires under the pointwise convention in the question. Since decreases with , the smallest valid envelope gives the greatest acceptance probability:
For densities specified only almost everywhere, replace the supremum by the essential supremum. Integration of the envelope also gives .
Use the uniform proposal on , with density . The triangular distribution peaks at with height , so the optimal constant for this proposal is . At each attempt take two fresh pseudo-random uniforms , and propose . The rejection method accepts according to
Indeed these bounds are . Part (a) proves that the accepted value has the required density. Acceptance probability is , so the method needs two proposal attempts on average, and hence four uniforms on average if each attempt uses two. The validity of the ideal algorithm presumes independent uniform draws; merely belonging to does not by itself make a pseudo-random sequence uniform or independent.
Integrating the two linear pieces gives the cumulative distribution function
The split probability is . Invert each branch to obtain the method of inversion:
Both expressions equal three at the split. For an ideal uniform draw, monotonicity gives , proving the target law. Inversion is preferable here: its quantile is explicit, it uses one uniform and one square root per output, and has no rejected draws. Rejection remains useful for densities with no convenient inverse CDF.

Articles by others on the same topic (0)

There are currently no matching articles.