---
title: Block-Restricted One-Swap Permutations
url: https://www.emergentmind.com/topics/block-restricted-one-swap-permutations
type: topic
---

# Block-Restricted One-Swap Permutations

Block-restricted one-swap permutations are a highly structured class of permutations, relevant in both combinatorial sorting theory and the design of statistical permutation tests. The terminology spans two technical contexts: (1) structured test statistics in two-sample testing via block-restricted swaps between representatives, and (2) combinatorial characterization of permutations in the symmetric group that are sortable to the identity using exactly one prescribed block-interchange, as encoded by the context-directed swap (cds) operation. Both settings exhibit sharply restricted action spaces, admit exact analytical treatment, and find applications in statistical inference and permutation group theory.

## 1. Formal Definition of Block-Restricted One-Swap Permutations

In the statistical two-sample framework, suppose there are two groups $A = \{X_1, \ldots, X_{n_1}\}$ and $B = \{Y_1, \ldots, Y_{n_2}\}$, total $N = n_1 + n_2$ items. The set $\{1,2,\ldots,N\}$ is partitioned into $b$ disjoint blocks $\mathcal{B}_1, \ldots, \mathcal{B}_b$ via any label-invariant rule (e.g., quantiling on auxiliary covariates or kernel scores). A representative set $R \subset \{1, \ldots, N\}$ of size $|R| = \lfloor \rho N \rfloor$, $\rho \in (0,1]$, allocates quota per block. The permissible cross-swaps are
$$
\mathcal{P} = \{ (i, j) : i \in A \cap R \cap \mathcal{B}_r,\, j \in B \cap R \cap \mathcal{B}_s,\, r \neq s \}.
$$
A block-restricted one-swap permutation is any permutation obtainable from the identity via a single transposition in $\mathcal{P}$. More generally, an $L$-swap block-restricted path is a sequence of disjoint one-swap moves, with $L \leq |R|/2 = \rho N / 2$ [2512.00668].

In the combinatorial context, the cds sorting operation on $\mathfrak{S}_n$ acts by swapping two disjoint, specific blocks, determined by the occurrence pattern of pairs of “pointers” in the permutation’s pointer word. A permutation is block-restricted one-swap sortable if it requires exactly one cds operation to become the identity [2011.00706].

## 2. Algebraic and Combinatorial Structure

In the block-restricted two-sample setting, the set of admissible permutations forms a fixed subset $S_{\text{block}}$ of the symmetric group $S_N$, specified a priori by the blocks and representatives. These permutations are reachable via disjoint one-swap cross-block transpositions from the identity. This structure makes the analysis of test statistic increments and variance tractable, as the set structure is stable and independent of observed labels [2512.00668].

For cds one-swap-sortable permutations, there is an equivalent cycle-structure criterion: Define $X_n = (0\,1\,2\,\ldots\,n)$, $Y_\pi = (\pi(n)\,\pi(n-1)\,\ldots\,\pi(1)\,0)$, and $C_\pi = Y_\pi \circ X_n$. The permutation $\pi$ is cds one-swap-sortable if and only if $C_\pi$ has a unique $4$-cycle $(0\,n\,a\,b)$ for some distinct $a, b \in \{1,\ldots,n-1\}$ and all other cycles are fixed points. Equivalently, the strategic pile $\operatorname{SP}(\pi)$ has size two, and there is exactly one eligible pointer context [2011.00706].

## 3. Exact Validity and Increment Formulas in Statistical Testing

A principal advantage of block-restricted one-swap permutations in hypothesis testing is exact finite-sample validity. For any fixed (label-invariant) restricted set $S \subseteq S_N$, drawing i.i.d. permutations uniformly from $S$ and forming the usual permutation $p$-value yields type-I error control at all levels:
$$
\mathbb{P}_{H_0}\{P \leq \alpha\} \leq \alpha,\;\, \forall \alpha \in [0,1].
$$
When $S = S_\text{block}$ (all block-restricted one-swap permutations), randomization inference remains exact in finite samples without recourse to subgroup symmetry or worst-case conditions [2512.00668].

The restricted action space of single swaps enables closed-form increment calculations for common test statistics:

- **Mean Difference:** For $h = 1/n_1 + 1/n_2$, swapping $i \in A$, $j \in B$, $\Delta' - \Delta = h(Z_j - Z_i)$. Conditional variance under random one-swap is $h^2 \operatorname{Var}_w(Z_J - Z_I)$, contrasted with $O(h)$ variability under full-relabeling permutation.
  
- **Unbiased $\widehat{\mathrm{MMD}}^2$:** The one-swap change is $\psi_J^{B \to A} - \psi_I^{A \to B}$, and the conditional variance is the sum of within-class variances of the swap effectors.

The variance contraction (from $O(h)$ to $O(h^2)$) leads to tighter control of permutation quantiles and better Bernstein–Freedman tail proxies.

## 4. Power Enhancement and Critical Value Behavior

Under full relabeling, the null permutation distribution of the statistic $T$ admits Chebyshev or normal-approximation quantile bounds:
$$
q_{1-\alpha}^{\mathrm{full}} \leq \mathbb{E}[T] + \sqrt{\operatorname{Var}_{\mathrm{full}}(T)/\alpha}.
$$
The block-restricted scheme, by contrast, yields Bernstein–Freedman upper bounds:
$$
q_{1-\alpha}^{\mathrm{rest}} \leq \mathbb{E}[T\,|\,S_N] + 2\sqrt{L v_\ast \log(1/\alpha)},
$$
with $v_\ast = h^2 \operatorname{Var}_w(Z_J - Z_I)$ for the mean or $\tau_A^2+\tau_B^2$ for MMD, $L = \rho N/2$. Because $h \ll 1$, $q_{1-\alpha}^{\mathrm{rest}}$ is substantially below $q_{1-\alpha}^{\mathrm{full}}$ for the same $\alpha$, for large $n$. The result is higher statistical power under alternatives:
$$
\beta^{\mathrm{rest}}(\delta) \approx 1 - \Phi\left(\frac{q_{1-\alpha}^{\mathrm{rest}} - \delta}{\sigma_{\mathrm{alt}}}\right),\quad
\beta^{\mathrm{full}}(\delta) \approx 1 - \Phi\left(\frac{q_{1-\alpha}^{\mathrm{full}} - \delta}{\sigma_{\mathrm{alt}}}\right).
$$
Pointwise, $\beta^{\mathrm{rest}}(\delta) \geq \beta^{\mathrm{full}}(\delta)$ [2512.00668]. Empirically, gains are maximized for balanced, large samples and block schemes that exploit high-contrast structures (e.g., kernel-score stratification).

## 5. Enumeration and Structure in $\mathfrak{S}_n$

Within the cds framework, every one-swap-sortable permutation corresponds uniquely to an unordered pair $\{a, b\} \subset \{1,\ldots,n-1\}$, $a \neq b$, and a choice of orientation for the 4-cycle. The total number is $2\binom{n-1}{2} = (n-1)(n-2)$. These permutations are extremely sparse, $\Theta(n^2)$ in total against $n!$ overall. Detecting single-swap-sortability is $O(n)$: compute the strategic pile and scan for pointer-interleaving [2011.00706].

Such permutations sit at the minimal nontrivial end of the cds complexity spectrum: the first nonzero member in the species-by-contexts partition $M_{n, k}$ at $k=1$. They admit two equivalent block forms depending on the context’s order in the pointer word, e.g.,
$$
[\; y+1, y+2, \dots, n;\;\; 1, 2, \dots, x;\;\; x+1, \dots, y\; ]
$$
for pointer pairs $(x,x+1), (y, y+1)$ with $1 \leq x < y \leq n-1$.

## 6. Relationship to Broader Permutation and Testing Theory

Block-restricted one-swap permutations provide a test-bed for studying the trade-off between label-exchange symmetry and power in permutation tests. Their a priori definition ensures exact validity and sharp variance behavior, exploiting fixed group structure rather than average- or worst-case coverage.

In the cds sorting paradigm, block-restricted one-swap permutations characterize the boundary of “minimal non-sortability”—the fewest possible eligible pointer contexts and smallest possible strategic pile size (2) to require any block-interchange operation. This positions them as a combinatorial extreme, with implications for sorting complexity and group action enumeration.

These frameworks, found in "Restricted Block Permutation for Two-Sample Testing" [2512.00668] and "Classifying Permutations under Context-Directed Swaps and the cds game" [2011.00706], exemplify structured, low-complexity randomization mechanisms enabling rigorous finite-sample statistical guarantees and rich algebraic properties.

Source: https://www.emergentmind.com/topics/block-restricted-one-swap-permutations