English

Optimal rolling of fair dice using fair coins

Data Structures and Algorithms 2024-12-31 v1 Probability Computation

Abstract

In 1976, Knuth and Yao presented an algorithm for sampling from a finite distribution using flips of a fair coin that on average used the optimal number of flips. Here we show how to easily run their algorithm for the special case of rolling a fair die that uses memory linear in the input. Analysis of this algorithm yields a bound on the average number of coin flips needed that is slightly better than the original Knuth-Yao bound. This can then be extended to discrete distributions in a near optimal number of flips again using memory linear in the input.

Keywords

Cite

@article{arxiv.2412.20700,
  title  = {Optimal rolling of fair dice using fair coins},
  author = {Mark Huber and Danny Vargas},
  journal= {arXiv preprint arXiv:2412.20700},
  year   = {2024}
}

Comments

11 pages, 2 figures