---
title: Betting-Game Random Permutations in Polynomial Time
url: https://www.emergentmind.com/topics/polynomial-time-betting-game-random-permutation
type: topic
---

# Betting-Game Random Permutations in Polynomial Time

A polynomial-time betting-game random permutation formalizes the notion of algorithmic unpredictability for permutations in the context of resource-bounded martingales and adaptive betting games. This concept sits at the intersection of computational randomness, permutation group theory, and complexity theory. It captures the unpredictability of a permutation from the perspective of any polynomial-time adaptive gambler, generalizing the classical random-oracle paradigm from strings to the permutation group. The measure and separation theory of such random permutations provide a basis for individual-sequence analogues of classical oracle results in computational complexity, including major class separations.

## 1. Foundations: Permutation Martingales and Betting Games

Let $\Sigma = \{0,1\}$, and denote by $\Pi$ the set of length-preserving permutations $\pi:\Sigma^* \to \Sigma^*$, where $|\pi(x)| = |x|$. The canonical product probability measure $\mu$ on $\Pi$ is defined so that for any prefix partial permutation $g=[g(s_0),\ldots,g(s_{N-1})]$, where the $s_i$ are standard enumerations of $\Sigma^*$ and $|g(s_i)|=|s_i|$, the cylinder set $[g]=\{\pi\in\Pi\,|\,\pi(s_i)=g(s_i)\;\forall i<N\}$ has measure given explicitly by a product of factorials.

A **permutation martingale** is a function $d:\mathrm{PP}\to[0,\infty)$ over prefix partial permutations, satisfying the fairness condition
$$
d(g) = \frac{1}{|free(g)|}\sum_{x\in free(g)} d(g,x)
$$
where $free(g)$ is the set of possible images for the next unassigned input. Success is defined analogously to standard algorithmic randomness: $d$ succeeds on $\pi$ if $\limsup_{N\to\infty} d(\pi\!\restriction\!N) = \infty$.

**Permutation betting games** generalize this framework by allowing a polynomial-time gambler to adaptively choose which queries to make (not just monotonic reveals), and distribute capital among all possible next moves in a way consistent with the fairness condition. Polynomial-time betting games are restricted to $t(n)=\mathrm{poly}(n)$ total computation when querying all of $\Sigma^n$ inputs.

A permutation $\pi$ is **polynomial-time betting-game random** if no polynomial-time betting game succeeds on $\pi$—that is, such $\pi$ cannot be algorithmically exploited for unbounded capital gain in polynomial time under any adaptive querying strategy [2511.08786].

## 2. Characterization and Complexity-Theoretic Implications

The main structural property is that the class of sets of permutations of betting-game measure zero is captured by polynomial-time permutation martingales and adaptive games. This aligns with Bennett–Gill-style measure theory for permutation spaces: betting-game randomness (in polynomial time) corresponds to escaping all efficiently computable exploitative strategies.

A pivotal complexity-theoretic theorem establishes that **for every polynomial-time betting-game random permutation $\pi$, the separation $P^\pi \neq NP^\pi \cap coNP^\pi$ holds**. This yields the first truly individual-sequence separation at the permutation level, in contrast to prior "almost-everywhere" results of Bennett and Gill [2511.08786]. The proof constructs adaptive polynomial-time betting games aimed at languages such as the half-range problem $HRNG_k^\pi$, and leverages bi-immunity arguments to show that any $\pi$ not satisfying the separation must be captured by some successful betting game, and so is non-random.

An analogous result holds in the quantum setting: for every polynomial-space betting-game random $\pi$, $NP^\pi \cap coNP^\pi \not\subseteq BQP^\pi$, strengthening Bennett–Bernstein–Brassard–Vazirani's separation for quantum complexity classes. The framework also establishes that random oracles are polynomial-time reducible from random permutations, i.e., the existence of a ptime betting-game random permutation implies the associated language is also ptime betting-game random, though the converse remains open [2511.08786].

## 3. Permutation Randomness Versus Sequence Randomness

Classical (recursively enumerable) randomness is invariant under computable permutations, but **polynomial-time betting-game randomness is not closed under all polynomial-time computable permutations**. Specifically, if BPP contains a superpolynomial deterministic time class, then there exists a polynomial-time computable permutation $S$ and a polynomial-time random bit sequence $Z$ such that $Z\circ S$ is not polynomial-time random. However, closure holds for polynomial-space randomness: if $S$ is a ptime bijection with polynomially bounded inverse, $Z$ polynomial-space random implies $Z\circ S$ is as well; if $P=PSPACE$, then polynomial-time randomness is preserved by such permutations [1709.08792]. These results demonstrate a sharp distinction between martingale randomness notions at different resource bounds.

## 4. Explicit Polynomial-Time Random Permutation Generation

For explicit generation of random permutations subject to algorithmic unpredictability constraints, two major approaches appear:

- **Shuffling with resource bounds:** In the context of online generation (Dealer-Guesser games), the goal is to generate a permutation such that at each round, an adaptive adversary (“Guesser”) cannot predict the next card with high expectation. With bounded $m$-bit memory Dealer, the best achievable bound is $O(n/m+\log m)$ correct guesses; even with open-book (memory-revealing) strategies, this is tight, and secrecy does not improve over this lower bound [2505.01287].

- **Maximum-entropy and market-based approaches:** The “Proportional Betting” mechanism formalizes markets over permutations, using polynomial-time convex programming to determine unique $n\times n$ marginal prices, then reconstructs the maximum-entropy joint distribution over permutations matching those marginals. Here, polynomial-time sampling is achieved via approximate exponential family log-partitions and Markov-chain sampling over weighted perfect matchings [0804.2288]. This mechanism provides a practical approach for generating random (or pseudo-random) permutations consistent with observed market marginals or partial constraints.

## 5. Markov Chains and Rapid Mixing for Biased Permutation Models

The **nearest-neighbor transposition Markov chain $M_{nn}$**, which models adjacent swaps biased by local probabilities $p_{i,j}$, is a canonical “betting-game”-flavored random permutation generator. For the uniform case ($p_{i,j}=1/2$), $M_{nn}$ converges to the uniform permutation in time $\Theta(n^3\log n)$. In the constant bias case ($p_{i,j}=p>1/2$), $M_{nn}$ is equivalent to an ASEP and rapidly mixes in $\Theta(n^2)$.

In more general variable-bias cases, rapid mixing is only guaranteed for structured classes:
- **Choose-Your-Weapon class:** If $p_{i,j}$ depends only on the left index as $r_i \geq 1/2$, rapid mixing with polynomial time is achieved, specifically $O(n^8\log(n/\epsilon))$ if any $r_i<1$ and $O(n^7\log(n/\epsilon))$ if all $r_i$ are bounded away from $1/2$.
- **League Hierarchies class:** If $p_{i,j}$ is determined by a tree-based tournament structure (“league hierarchy”), under weak monotonicity, $M_{nn}$ mixes in $O(n^9\log(n/\epsilon))$.
- For some choices of $p_{i,j}$ with all $p_{i,j}\geq 1/2$, mixing time is exponential, disproving the general “positive-bias implies rapid-mixing” conjecture and showing that sampling polynomial-time random permutations via “betting-game” chains necessitates strong structural conditions on the bias matrix [1204.3239].

## 6. Online Betting Games on Random Permutations

A related variant is the **online stopping game** on random permutations of zero-sum multisets, where an agent observes elements sequentially and must choose when to stop to maximize expected gain, corresponding to the unrevealed portion of the permutation. Three polynomial-time strategies are established for the binary $\pm1$ case, achieving expected gains of $\Theta(\sqrt{n})$ per play. The simplest variant (“stop in the middle” rule) generalizes to arbitrary zero-sum multisets to guarantee $\Omega(\mu\sqrt{n})$ expected gain, where $\mu$ is the average absolute value. All strategies are efficiently implementable in $O(n)$ time per play, and the analysis is driven by the reflection principle, dynamic programming, and symmetrization arguments [2411.13206].

## 7. Open Directions and Context

Designing efficient sampling algorithms for polynomial-time betting-game random permutations under minimal structural constraints remains open. The presence of hidden bottlenecks in the state space of certain Markov chains on permutations indicates that structural regularity is necessary for efficient unbiased permutation sampling. From a complexity-theoretic perspective, understanding the relationships between permutation and oracle randomness—such as whether every random oracle arises from a random permutation—remains unresolved [2511.08786].

These frameworks establish a full analogy to classical resource-bounded measure and randomness theory in the context of permutations, providing a foundation for separation results, complexity lower bounds, and practical online randomness extraction in polynomial time.

Source: https://www.emergentmind.com/topics/polynomial-time-betting-game-random-permutation