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 toIndeed 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 functionThe 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
There are currently no matching articles.