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

Generating Zipfian Distributions Using Rejection Inversion

Rejection inversion is a sampling method for discrete monotone distributions. Here is how to use it to benchmark and test software.

Statistics

Generating Zipfian Distributions Using Rejection Inversion

Rejection inversion is a sampling method for discrete monotone distributions. Here is how to use it to benchmark and test software.

Rejection inversion is a sampling method for discrete monotone distributions. It is useful when you need realistic skew in benchmarks, simulations or tests.

Why Zipfian?

Real workloads are rarely uniform. A small number of keys attract most requests, while the long tail is accessed rarely. Zipfian sampling lets you reproduce that shape instead of guessing.

  • Model hot keys with a tunable exponent.
  • Keep sampling fast enough for large benchmark runs.
  • Compare cache policies against a realistic access distribution.
A benchmark with uniform keys will flatter almost every cache.