Back to all articles
StatisticsApr 6, 2026· 7 min read

Understanding Rejection–Inversion Sampling for Zipf Distributions

The theory behind sampling from Zipfian distributions, and why the inverse CDF is not always enough.

Statistics

Understanding Rejection–Inversion Sampling for Zipf Distributions

The theory behind sampling from Zipfian distributions, and why the inverse CDF is not always enough.

The inverse CDF gives a direct way to sample from a distribution, but for discrete monotone distributions it can be expensive to evaluate. Rejection inversion trades a little rejection for a much cheaper proposal step.

The tradeoff

You accept a proposal with a probability that corrects the distribution. The result is exact, provided the acceptance test is implemented carefully.

The best sampler is the one that is easy to reason about under load.