Abstract
Given a p-coin that lands heads with unknown probability p, we wish to produce an -coin for a given function . This problem is commonly known as the Bernoulli factory and results on its solvability and complexity have been obtained in (ACM Trans. Model. Comput. Simul. 4 (1994) 213–219; Ann. Appl. Probab. 15 (2005) 93–115). Nevertheless, generic ways to design a practical Bernoulli factory for a given function f exist only in a few special cases. We present a constructive way to build an efficient Bernoulli factory when is a rational function with coefficients in . Moreover, we extend the Bernoulli factory problem to a more general setting where we have access to an m-sided die and we wish to roll a v-sided one; that is, we consider rational functions between open probability simplices. Our construction consists of rephrasing the original problem as simulating from the stationary distribution of a certain class of Markov chains—a task that we show can be achieved using perfect simulation techniques with the original m-sided die as the only source of randomness. In the Bernoulli factory case, the number of tosses needed by the algorithm has exponential tails and its expected value can be bounded uniformly in p. En route to optimizing the algorithm we show a fact of independent interest: every finite, integer valued, random variable will eventually become log-concave after convolving with enough Bernoulli trials.
Funding Statement
KŁ acknowledges funding from the Royal Society via the University Research Fellowship scheme. AW has been supported by EPSRC and GM has been supported by EPSRC through the OxWaSP Programme. PN was supported by the National Science Centre, Poland, grant 2018/31/D/ST1/01355. Finally, AW and KŁ thank the Warwick Undergraduate Research Scholarship Scheme for supporting the project in its initial stages in the summer of 2013.
Acknowledgments
We would like to thank anonymous referees for their helpful suggestions that greatly improved the presentation of the paper. We thank Susanna Brown, Oliver Johnson and Krzysztof Oleszkiewicz for helpful discussions. We are also very grateful to Renato Paes Leme for helping us avoid an error in Theorem 3.1 by pointing out that in an earlier version of the paper we were using an incorrect formulation of Pólya’s theorem that is circulating in some of the literature.
Citation
Giulio Morina. Krzysztof Łatuszyński. Piotr Nayar. Alex Wendland. "From the Bernoulli factory to a dice enterprise via perfect sampling of Markov chains." Ann. Appl. Probab. 32 (1) 327 - 359, February 2022. https://doi.org/10.1214/21-AAP1679
Information