Online Random Sampling with Real Probabilities
Abstract
We develop an efficient online algorithm to sample a sequence of discrete random variables using an entropy source of i.i.d. fair coin flips, in a standard model of real computation where real-valued probabilities are represented by rational approximations. For any sequence of probability distributions, our sampler generates outputs using at most coin flips in expectation while carrying bits of persistent space, where is the Shannon entropy. Under standard assumptions, we prove that the space used by our sampler to achieve this information-theoretically optimal entropy rate is asymptotically optimal. The key idea is to replace the global arithmetic-decoding sampling scheme of Han and Hoshi (1997) with a local discrete uniform state, yielding an exponential reduction in space for a given entropy loss. Our approach applies to distributions with irrational probabilities and countably infinite supports, generalizing recent randomness-recycling methods beyond finite rational distributions with bounded denominator.
Cite
@article{arxiv.2607.13828,
title = {Online Random Sampling with Real Probabilities},
author = {Thomas L. Draper and David G. Harris and Feras A. Saad},
journal= {arXiv preprint arXiv:2607.13828},
year = {2026}
}