Note on Finite-Automata Bernoulli Factories for Rational Functions

Renato Paes Leme, Jon SchneiderarXiv 2026

TL;DR

This paper disproves a 20-year-old claim in probability theory regarding multivariable "Bernoulli factories"—algorithms that transform coin flips of unknown biases into a flip of a new target bias. The authors provide an explicit three-variable rational function that can be simulated generally but is mathematically impossible to implement using a finite-automata (block-based) approach, revealing a subtle geometric oversight in the original 2005 proof.

What Problem Does This Paper Address?

The Bernoulli factory problem asks a fundamental question: If you have a coin with an unknown bias $p$, can you run an algorithm to simulate a new coin with a target bias $f(p)$?

In 2005, Elchanan Mossel and Yuval Peres established a comprehensive framework for this problem. They paid special attention to finite-automata Bernoulli factories (also known as simulation via blocks), which are computationally simpler and more practical to implement than general factories. They proved that for a single variable, a function can be simulated by a finite automaton if and only if it is a rational function (a ratio of two polynomials).

Mossel and Peres claimed (in their Theorem 2.9) that this exact result extended to multivariable functions (where you sample from multiple coins with different unknown biases). However, this paper points out a subtle technical oversight in their extension: the original proof failed to account for how polynomials behave on the boundaries of multi-dimensional spaces, leaving a gap in the literature that this note aims to correct.

Methods

The authors disprove the long-standing theorem by constructing a direct, algebraic counterexample. They define a specific homogeneous rational function in three variables:

$$g(p_1, p_2, p_3) = \frac{p_1^3 p_2}{p_3^2(p_1 - p_2)^2 + p_1^3(p_1 + p_2 + p_3)}$$

To prove this is a valid counterexample, the authors split their analysis into two parts:

  1. Existence of a General Factory: They prove that $g(p_1, p_2, p_3)$ is strictly bounded between 0 and 1 on the open simplex (the valid probability space where $p_1 + p_2 + p_3 = 1$ and $p_i > 0$) and satisfies the necessary polynomial boundedness conditions near the boundaries. This guarantees it can be simulated by a general Bernoulli factory.
  2. Impossibility of a Finite-Automata Factory: For a function to be simulated via a finite automaton, it must be expressible as a ratio of Bernstein polynomials (homogeneous polynomials with strictly non-negative coefficients). The authors use algebraic techniques—specifically dehomogenizing the polynomial at a vertex ($p_3 = 1$) and analyzing its lowest-degree terms—to show that forcing the coefficients to be non-negative leads to a mathematical contradiction.

Notably, the authors include a tool use disclosure stating they leveraged the "DeepThink" mode of Gemini 3.1 Pro to help derive this specific counterexample and refine their mathematical presentation.

Datasets

Not discussed in the paper. As a theoretical paper in pure mathematics and probability, it relies on algebraic proofs rather than empirical datasets.

Key Insights and Ideas

  • The Boundary Danger: In a single-variable setting, any zeros on the boundary of the domain correspond to simple linear factors that can be easily factored out and canceled. In multiple dimensions, however, coprime polynomials can vanish simultaneously on the boundary without sharing common factors. This "cusp singularity" prevents negative coefficients from being cleared.
  • Pólya’s Theorem Misapplication: The original 2005 proof relied on Pólya’s Theorem to multiply the numerator and denominator by a high power of $(p_1 + \dots + p_{s+1})$ to eliminate negative coefficients. This paper highlights that Pólya’s Theorem requires strict positivity on the closed simplex, but rational functions for Bernoulli factories are only guaranteed to be well-behaved on the open simplex.
  • AI-Assisted Discovery: The paper highlights a modern workflow in pure mathematics, where advanced LLM reasoning models can be used to successfully hunt down complex algebraic counterexamples that eluded human researchers for decades.

Key Results

The primary result is the formal refutation of Theorem 2.9 from Mossel and Peres (2005). The authors successfully demonstrate that being a rational function is a necessary but not sufficient condition for a multivariable function to be implemented by a finite-automata Bernoulli factory.

Limitations and Future Work

Not discussed in the paper. The scope of this short note is strictly limited to presenting the counterexample and correcting the historical oversight. However, it implicitly reopens the question of how to fully characterize which multivariable rational functions can be implemented by finite-automata Bernoulli factories.

Summary updated

BibTeX
@misc{leme2026note,
  author = {Renato Paes Leme and Jon Schneider},
  title = {{Note on Finite-Automata Bernoulli Factories for Rational Functions}},
  year = {2026},
  eprint = {2606.29595},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.29595},
}
Figure