Exact Uniform Sampling of Contingency Tables with Arbitrary Margins

OpenAI

For any nonnegative row and column margins with equal totals, an exact uniform sampler for integer contingency tables terminates almost surely and has expected bit complexity polynomial in both dimensions and the binary input length. For every precision k≥1k\ge 1, a bounded-time algorithm samples a contingency table within total variation distance 2(−k)2^{(-k)} of uniform in time polynomial in the two dimensions, log⁡(N+1)\log (N+1) and k, where N is the common margin total. This holds for arbitrary nonnegative row and column margins of equal total.

The only tables with these margins have rows zero-two and one-one in either order. The exact uniform sampler gives each table probability one half.
The two arrays illustrate exact uniformity. For arbitrary nonnegative integer row and column sums with equal total, Theorem 1.1 gives a sampler with almost-sure termination and polynomial expected bit complexity. The separate approximate sampler has bounded running time.

What was already known

Earlier exact uniform samplers covered two-row tables, while other methods required dense, balanced, sparse, or fixed-dimension conditions according to the manuscript’s review.

How the result developed

  1. 24 Sept 2026 · Manuscript date [1]

    OpenAI reported the AI-assisted result in this manuscript.

Follow new evidence and revisions to this result.

Get email updates

Download contribution history

Contribution Assessment

AI involvementAI-led
ImportanceNotable
Technical verificationReported
Human understandingFew

AI involvement

OpenAI is the credited author of the manuscript. This repository contains mathematical manuscripts and supporting proof artifacts produced by an internal OpenAI model. The release leaves the human input for this result unspecified.

Importance

Gives exact uniform sampling with no structural restriction on the margins or dimensions.

Technical verification

The available Lean scope includes the bounded-time approximate sampler and its error and running-time guarantees. A completed execution for that statement is not documented.

Human understanding

The reviewed sources do not document a human explanation of the central argument for the expanded claim.

View revision history
· addition

Added the research timeline.

· addition

Added a source excerpt documenting AI involvement.

· amendment

Expanded the same manuscript’s assessed scope to include its explicitly stated additional result, preserving earlier claims and assessments in revision history. The research date follows the literal printed manuscript date; no discovery priority is inferred.

· publication

Exact uniform sampling for a two-by-two example

Open SVG

The only tables with these margins have rows zero-two and one-one in either order. The exact uniform sampler gives each table probability one half.
The two arrays illustrate exact uniformity. For arbitrary nonnegative integer row and column sums with equal total, Theorem 1.1 gives a sampler with almost-sure termination and polynomial expected bit complexity. The separate approximate sampler has bounded running time.OpenAI credits an unnamed internal model with the manuscript and supporting proof artifacts.