Combinatorial Bernoulli Factories: Matchings, Flows and Other Polytopes

Rad Niazadeh, Renato Paes Leme, Jon Schneider

Abstract

This paper establishes a complete geometric characterization of the combinatorial structures that can be sampled exactly using only "noisy" Bernoulli access to their marginal probabilities. We demonstrate that a polytope $\mathcal{P}$ admits a Bernoulli factory if and only if it is the intersection of a unit hypercube with an affine subspace. Beyond this theoretical foundation, we provide efficient, explicit algorithms for sampling complex structures, including perfect matchings, flows, and matroids, while identifying fundamental limits regarding convergence at the boundaries of the probability space.

Introduction

The "Bernoulli factory" problem traditionally asks: given a coin with unknown bias $p$, can we simulate a coin with bias $f(p)$? While well-studied for single parameters, many modern applications in Bayesian mechanism design and quantum physics require scaling this to high-dimensional combinatorial objects. In these settings, we often have "black box" access to the marginal probabilities $x_{ij}$ of a structure (e.g., the probability that an edge $(i, j)$ belongs to a perfect matching) via Bernoulli trials, but we lack the exact values of $x$.

This research addresses the challenge of exact simulation: given a point $x$ inside a polytope $\mathcal{P}$, can we output a vertex $v \in \text{vert}(\mathcal{P})$ such that the expected value of our choice is exactly $x$? Exactness is paramount; in iterative systems, even minor approximation errors can compound, leading to significant divergence.

Geometric Characterization

The central contribution of this work is a definitive "if and only if" condition for the existence of these factories. The authors prove that a polytope $\mathcal{P}$ admits a Bernoulli factory if and only if it is defined by the intersection of the unit hypercube $[0, 1]^n$ and an affine subspace.

This implies that the existence of a factory is tied strictly to the linearity of the polytope's constraints. If a polytope's boundaries are non-linear or "curved," an exact Bernoulli factory is mathematically impossible. This characterization provides a clear roadmap for which combinatorial problems are amenable to exact sampling from noisy marginals.

Algorithmic Framework

To construct these factories, the authors bridge probability, algebra, and geometry through several innovative techniques:

1. Bernoulli Races and Bernstein Polynomials

The core algorithm utilizes a "Bernoulli race." By associating each vertex of a polytope with a specific Bernstein polynomial, the algorithm runs a randomized competition. The first polynomial to "win" the race determines the sampled vertex. This framework allows the algorithm to operate without ever knowing the underlying probabilities $x$ explicitly.

2. Zonotope Tilings

The proof of correctness for general polytopes relies on the geometry of zonotopes—polytopes formed by the Minkowski sum of line segments. The authors demonstrate that the algebraic identities required for a successful Bernoulli race correspond to specific ways of "tiling" a geometric space, providing a visual and structural justification for the algorithm's validity.

3. The Matrix-Tree Theorem for Matchings

For the specific case of the Birkhoff-von Neumann polytope (the convex hull of perfect matchings), the authors derive an elegant algorithm. By utilizing Kirchhoff’s and Tutte’s matrix-tree theorems, they link the sampling of matchings to the enumeration of directed spanning trees (arborescences). This allows for an efficient sampling procedure that involves picking random permutations and sampling edges based on tree orientations.

Key Results and Applications

Perfect Matchings and Flows

The paper provides the first explicit Bernoulli factory for perfect matchings that runs in polynomial time. Similar constructive recipes are provided for flow polytopes, which are essential in network optimization and transport problems.

Unifying Sampford Sampling

A significant theoretical insight is the connection to "Sampford sampling," a technique used in statistics for over 50 years to sample $k$-sets. The authors show that Sampford sampling is actually a specific instance of a Bernoulli factory for $k$-uniform matroids, providing a new, rigorous theoretical foundation for this classical method.

The Boundary Wall and Impossibility

The research distinguishes between "weak" factories (which function in the interior of a polytope) and "strong" factories (which must also function on the boundaries where probabilities are 0 or 1). The authors establish an impossibility theorem for $k$-subsets: no strong Bernoulli factory exists that can guarantee fast (exponential) convergence near the boundaries. This settles a long-standing question regarding the limits of these algorithms in edge cases.

Limitations and Future Directions

While this work provides a comprehensive framework for polytopes, several challenges remain:

  • Boundary Convergence: Algorithms often "hang" or experience high sample complexity as marginal probabilities approach 0 or 1. Improving the "speed" of termination in these regions is a priority for future work.
  • Computational Complexity: While existence is proven, the number of required coin flips (sample complexity) can be prohibitively high for extremely high-dimensional or complex polytopes.
  • Non-Convex Structures: The current theory is strictly limited to convex polytopes. Extending exact sampling to non-convex structures or more general manifolds remains an open frontier in computational statistics.

Summary updated

BibTeX
@inproceedings{niazadeh2021combinatorial,
  author = {Rad Niazadeh and Renato Paes Leme and Jon Schneider},
  title = {{Combinatorial Bernoulli Factories: Matchings, Flows and Other Polytopes}},
  booktitle = {STOC},
  year = {2021},
  doi = {10.1145/3406325.3451072},
}
Figure