Efficient Rejection Sampling in the Entropy-Optimal Range

Read full text
Authors: T. Draper, Feras A. Saad
Cited by: 0

Abstract

We study the problem of generating a random variate X from a finite discrete probability distribution P using an entropy source of independent fair coin flips. A classic result from Knuth and Yao shows that the optimal expected number of input coin flips per output sample lies betweenH(P)andH(P)+2, whereHis the Shannon entropy function. However, implementing the Knuth and Yao “entropy-optimal” sampler entails a tradeoff between using either exponential space with low runtime per sample, or linear space with high runtime per sample. We introduce a new sampling algorithm that avoids this tradeoff: it requires linearithmic space, incurs negligible runtime overhead per sample, and uses an expected number of coin flips that lies in the entropy-optimal range [H(P),H(P)+2). No previous sampler for discrete distributions simultaneously achieves these space, time, and entropy characteristics. Numerical experiments demonstrate improvements in runtime and entropy of the proposed method compared to the celebrated alias method.

Fields of Study & Subjects

Chaos-based Image/Signal Encryption Markov Chains and Monte Carlo Methods Toxic Organic Pollutants Impact

Publication details

Journal / source
IEEE Transactions on Information Theory
Volume
72
Issue
5
Pages
2801–2822
Publication date
27 January 2026
Language
EN