HackerPapers

arXiv:2003.03830stat.CO

The Fast Loaded Dice Roller: A Near-Optimal Exact Sampler for Discrete Probability Distributions

Feras A. Saad, Cameron E. Freer, Martin C. Rinard, Vikash K. Mansinghka

Abstract

This paper introduces a new algorithm for the fundamental problem of generating a random integer from a discrete probability distribution using a source of independent and unbiased random coin flips. We prove that this algorithm, which we call the Fast Loaded Dice Roller (FLDR), is highly efficient in both space and time: (i) the size of the sampler is guaranteed to be linear in the number of bits needed to encode the input distribution; and (ii) the expected number of bits of entropy it consumes per sample is at most 6 bits more than the information-theoretically optimal rate. We present fast implementations of the linear-time preprocessing and near-optimal sampling algorithms using unsigned integer arithmetic. Empirical evaluations on a broad set of probability distributions establish that FLDR is 2x-10x faster in both preprocessing and sampling than multiple baseline algorithms, including the widely-used alias and interval samplers. It also uses up to 10000x less space than the information-theoretically optimal sampler, at the expense of less than 1.5x runtime overhead.

arXiv comments
12 pages, 5 figures, 1 table. Appearing in AISTATS 2020
Journal reference
Proceedings of the 23rd International Conference on Artificial Intelligence and Statistics, PMLR 108:1036-1046, 2020
DOI
Subjects
stat.COComputation (Statistics) cs.DMDiscrete Mathematics cs.DSData Structures and Algorithms cs.ITInformation Theory math.PRProbability

On Hacker News

Linked by 3 identifiable commenters in 3 comments across 2 threads, from May 2020 to Jul 2020.

Comments linking this paper, per year.

Discussed in comments2 threads

    • The article is not about randomness in general, once one reads the whole. It's just the title and the longish intro that can mislead. It's about: https://arxiv.org/abs/2003.03830 "The Fast Loaded Dice Roller: A Near-Optimal Exact Sampler for Discrete Probability Distributions"…

      acqqView on HNParent context

    • So this is not what the article is about. It discusses a new method to generate integer values according to an arbitrary probability distribution, using as input a uniform random generator. Whether the input generator is truly random, pseudorandom, cryptographically secure etc…

      binarycoffeeView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.