Skip to content

Actuarial Statistics · Basic univariate distributions and generating samples

Acceptance-Rejection Method and Other Simulation Methods

Updated 11 October 2026 · Fact-checked

Acceptance-rejection simulates from a target density f by proposing values from an easier density g, where f(x) ≤ c·g(x) for all x. You accept a proposal x if U ≤ f(x) ÷ (c·g(x)), otherwise you reject it and repeat. The acceptance probability is 1/c.

Understand Acceptance-Rejection and Other Simulation Methods

Sometimes the inverse transform method fails because the CDF cannot be inverted in closed form. The normal distribution is the standard case. Acceptance-rejection gives another route that needs only the density.

The idea is simple. You want samples from a target density f. You pick a proposal density g that is easy to simulate from and that covers f. Covering means there is a constant c ≥ 1 with f(x) ≤ c·g(x) for every x where f(x) > 0. You draw a value Y from g and an independent U from U(0,1). You accept Y if U ≤ f(Y) ÷ (c·g(Y)). If not, you throw Y away and start again.

Why does it work? The curve c·g(x) sits above f(x). A point is accepted with probability f(x) ÷ (c·g(x)), so the accepted values have density proportional to g(x) × f(x)/(c·g(x)) = f(x)/c. After normalising, that is exactly f. The overall probability of accepting in one attempt is 1/c. So the number of attempts per accepted value is geometric with mean c. A smaller c means a faster method. You get the smallest c by choosing c = max of f(x) ÷ g(x).

The same idea works for discrete distributions, with probability functions in place of densities.

For normal variables, the Box-Muller method uses two independent U(0,1) values U1 and U2. It turns them into two independent standard normal values. The polar method (Marsaglia) avoids the sine and cosine by using acceptance-rejection on a point in the unit circle. Both give N(0,1) values. To get N(μ, σ²) you use X = μ + σZ.

Choosing a method: use inverse transform if the CDF inverts easily, as for the exponential. Use acceptance-rejection if you have the density and a good envelope. Use Box-Muller or polar for normals. The lognormal is then exp of a normal value.

Key rules to remember

Envelope condition
f(x) ≤ c·g(x) for all x with f(x) > 0, c ≥ 1
g must be a density you can simulate from. g(x) must be positive wherever f(x) is positive.
Acceptance test
Accept Y if U ≤ f(Y) ÷ (c·g(Y))
U ~ U(0,1), independent of Y. Y is drawn from g.
Acceptance probability
P(accept) = 1/c
Holds when both f and g are properly normalised densities.
Expected number of attempts
E[N] = c
N is geometric with success probability 1/c. Each attempt uses one Y and one U.
Best constant
c = max over x of f(x) ÷ g(x)
The smallest valid c gives the highest efficiency.
Box-Muller
Z1 = √(−2 ln U1) · cos(2πU2); Z2 = √(−2 ln U1) · sin(2πU2)
U1, U2 independent U(0,1). Z1, Z2 are independent N(0,1).
Polar method
V1 = 2U1 − 1, V2 = 2U2 − 1, W = V1² + V2². If W < 1 (and W > 0): Z1 = V1·√(−2 ln W ÷ W), Z2 = V2·√(−2 ln W ÷ W)
If W ≥ 1, reject the pair and redraw. About π/4 of pairs are accepted.
Normal scaling
X = μ + σZ
Turns a standard normal Z into N(μ, σ²). σ is the standard deviation.

How to solve Acceptance-Rejection and Other Simulation Methods questions

Use this method for any question that asks you to set up, apply or assess an acceptance-rejection scheme.

  1. 1Write down the target density f(x) and its range. Check it is a proper density, or note any normalising constant.
  2. 2Choose a proposal density g(x) that is easy to simulate from and positive wherever f is positive. A uniform on the range is common for bounded f.
  3. 3Find c = max of f(x) ÷ g(x). Use calculus or look at the shape of the ratio. State that f(x) ≤ c·g(x).
  4. 4Write the algorithm: generate Y from g, generate U from U(0,1), accept Y if U ≤ f(Y) ÷ (c·g(Y)), otherwise repeat.
  5. 5Apply it to the numbers given. Compute f(Y) ÷ (c·g(Y)) and compare it with U. State clearly whether you accept or reject.
  6. 6Give the efficiency: acceptance probability 1/c and mean number of attempts c.
  7. 7If the question asks for normals, use Box-Muller or polar and finish with X = μ + σZ.

Quickest way: Fast route for a bounded density on an interval

When to use it: Use this when f is bounded on [a, b] and the question lets you choose the proposal.

  1. Take g as the uniform density on [a, b], so g(x) = 1 ÷ (b − a).
  2. Find M = max f(x) on [a, b]. Then c = M·(b − a).
  3. The acceptance test simplifies to U ≤ f(Y) ÷ M, where Y is uniform on [a, b].
  4. Efficiency is 1/c = 1 ÷ (M·(b − a)). Quote it at once.

Common mistakes in Acceptance-Rejection and Other Simulation Methods

  • Choosing c so that c·g(x) is below f(x) somewhere.

    Students check only a few points rather than the whole range.

    Fix: Find the maximum of f ÷ g properly, using calculus if needed. Then check the tails and endpoints.

  • Using c < 1 or forgetting that c ≥ 1.

    Students confuse c with the acceptance probability.

    Fix: Remember that acceptance probability is 1/c, and c ≥ 1 because both f and g integrate to 1.

  • Using the same U for both the proposal and the acceptance test.

    Saving random numbers feels efficient.

    Fix: Use independent random numbers. Y comes from g using one stream; U is a separate U(0,1) value.

  • Keeping the rejected values or averaging them in.

    Students think rejected values are still part of the sample.

    Fix: Discard rejected values completely. Only accepted values form the sample, and each acceptance needs a fresh attempt.

  • Forgetting to scale the Box-Muller output to N(μ, σ²).

    Box-Muller gives N(0,1), and students stop there.

    Fix: Always finish with X = μ + σZ. Check whether the question gives variance or standard deviation.

  • Calculating the Box-Muller angle in degrees.

    Calculators default to degrees.

    Fix: Use radians for 2πU2. Set the calculator mode before you start.

Worked examples

Example 1

Let f(x) = 2x for 0 < x < 1. Use the proposal g(x) = 1 on (0, 1). (a) Find the smallest valid c. (b) State the acceptance probability. (c) Given Y = 0.6 and U = 0.7, decide whether to accept.

Show the solution
  1. f(x) ÷ g(x) = 2x. Its maximum on (0, 1) is 2, at x = 1.
  2. So c = 2, and f(x) ≤ 2·g(x).
  3. Acceptance probability = 1/c = 1/2.
  4. Test value: f(0.6) ÷ (c·g(0.6)) = 1.2 ÷ 2 = 0.6.
  5. Compare: U = 0.7 > 0.6, so reject.

Answer: (a) c = 2. (b) Acceptance probability = 0.5. (c) Reject Y = 0.6, because 0.7 > 0.6.

Example 2

Use the Box-Muller method with U1 = 0.5 and U2 = 0.25 to obtain two standard normal values. Then produce a value from N(100, 25).

Show the solution
  1. Compute the radius: √(−2 ln 0.5) = √(2 × 0.693147) = √1.386294 = 1.17741.
  2. Angle: 2π × 0.25 = π/2 radians.
  3. cos(π/2) = 0 and sin(π/2) = 1.
  4. Z1 = 1.17741 × 0 = 0.
  5. Z2 = 1.17741 × 1 = 1.17741.
  6. For N(100, 25), σ = 5. Using Z2: X = 100 + 5 × 1.17741 = 105.887.

Answer: Z1 = 0 and Z2 ≈ 1.1774. Using Z2, X ≈ 105.89 from N(100, 25).

Exam tips

  • Write the envelope condition f(x) ≤ c·g(x) explicitly. Examiners award marks for showing c is valid.
  • Always give the acceptance probability 1/c when asked about efficiency. Link a smaller c to fewer wasted attempts.
  • In MCQs, check whether the question gives variance or standard deviation before scaling a normal value.
  • Be ready to compare methods: inverse transform needs an invertible CDF, acceptance-rejection needs only the density and a covering g.
  • In computer-based work, state the algorithm in the same order: draw Y, draw U, test, repeat.

Practice questions from Basic univariate distributions and generating samples

Acceptance-Rejection and Other Simulation Methods: frequently asked questions

What is the difference between inverse transform and acceptance-rejection?

Inverse transform uses the inverse CDF, so it needs a CDF you can invert and uses one uniform per value. Acceptance-rejection needs only the density and a proposal that covers it. It uses at least two random numbers per attempt and rejects some of them.

How do I measure the efficiency of acceptance-rejection?

The probability of acceptance on each attempt is 1/c. The expected number of attempts for each accepted value is c. So you want c as close to 1 as possible.

Does the proposal density have to be uniform?

No. Any density you can simulate from works, as long as c·g(x) is at least f(x) everywhere. A proposal that is shaped like f gives a smaller c and a faster method.

What is the difference between Box-Muller and the polar method?

Both turn uniform values into independent standard normals. Box-Muller uses a logarithm, sine and cosine directly. The polar method uses acceptance-rejection on a point in the unit circle and avoids the trigonometric functions, at the cost of rejecting some pairs.