alphaFeedback

WorksComputer Science

Mixing Time of the Random-Pair Monte Shuffle

AI contributions
  • GPT-6 Astra
View details

Abstract

In the random-pair Monte shuffle on nn cards, each step chooses two positions independently and uniformly and exchanges their cards with probability 1/21/2. The chosen positions are public; the decisions to exchange cards remain hidden. We prove that the mixing time in expected conditional total variation distance is 2nlog⁡n+O(n)2n\log n+O(n), with an exact leading constant and an O(n)O(n) cutoff window. To our knowledge, this is the first public-schedule Monte shuffle whose full-permutation mixing time has been determined up to an additive O(n)O(n) term. The upper bound follows by comparing two executions with the same public schedule to a classical random-transposition walk. For the lower bound, we construct a schedule-dependent test function and estimate its variance using a matrix-averaging operator. Combined with the depth bound of Czumaj and Lingas, the mixing estimate gives public switching networks with at most 2nlog⁡n+O(n)2n\log n+O(n) switches and O(log⁡n)O(\log n) depth for fixed error and failure probabilities. The author obtained this result through interaction with GPT-6 Astra.

Introduction

The random-transposition shuffle chooses two positions independently and uniformly at each step and exchanges the cards at those positions. Diaconis and Shahshahani [5] proved that its mixing time is 12nlog⁡n+O(n)\frac{1}{2}n\log n+O(n). We ask how the mixing time changes when the chosen positions are revealed and the only hidden choice is whether to exchange the two cards.

We study the random-pair Monte shuffle, which exchanges the cards at a uniformly sampled pair of positions with probability 1/21/2. The sequence of pairs, called the schedule, is public, and the exchange decisions are independent hidden bits. For each schedule we measure the total variation distance of the resulting distribution on permutations from uniform, and then average this distance over schedules.

In this paper we prove that the mixing time is 2nlog⁡n+O(n)2n\log n + O(n). Revealing the schedule therefore doubles the leading term relative to the ordinary 1/21/2-lazy random-transposition shuffle, whose mixing time is nlog⁡n+Oε(n)n\log n + O_{\varepsilon}(n). Together with the factor of two due to laziness, this gives a factor of four relative to classical random transpositions.

Our shuffle is an instance of the Monte framework introduced by Morris [14]. Here we consider shuffles specified by a public schedule of fair switches, each of which either exchanges the cards at two specified positions or leaves them in place, with equal probabilities. The schedule may be fixed, as in the Thorp shuffle, or random, as in our model. Several Monte shuffles are known to mix in Θ(nlog⁡n)\Theta(n\log n) individual switches, including the Thorp shuffle by a recent result [19].

Our bounds determine both the leading constant and an O(n)O(n) cutoff window. Saloff-Coste and Zúñiga, in their refined analysis of classical random transpositions, observe that “It is quite rare to be able to capture the mixing time of a chain with such precision” [22]. To our knowledge, the random-pair Monte shuffle is the first public-schedule Monte shuffle whose full-permutation mixing time has been determined up to an additive O(n)O(n) term.

The public schedule defines a switching network, with the hidden bits determining the switch settings. Such networks have cryptographic applications in constructions of Oblivious RAM [8] and format-preserving encryption [9]. For an oblivious shuffle based on pairwise exchanges, a switching network captures its threat model: the adversary learns the network from the memory access pattern, while the switch settings remain hidden. Each step reads two records, re-encrypts them in private memory, and writes back, concealing whether they were exchanged. Security of shuffling-based Oblivious RAM requires the final permutation to remain indistinguishable from uniform even given the observed access pattern. Format-preserving encryption can be constructed from a switching network as long as the trajectory of any card can be efficiently traced in both directions.

Disjoint switches commute and can be executed in parallel, provided that their dependencies are respected. Combining our mixing bound with the dependency graph depth estimate of Czumaj and Lingas [2] gives, for fixed error and failure probabilities, public switching networks with at most 2nlog⁡n+O(n)2n \log n + O(n) switches and O(log⁡n)O(\log n) depth. The probability is over the choice of the network; the mixing guarantee is conditional on that choice. Explicit bounds are given in § 3.

Notation

All logarithms are natural unless a base is indicated. We use the following notation:

nnNumber of cards.
[n][n]{1,…,n}\{1,\ldots,n\}.
SnS_nSymmetric group on [n][n].
←$\overset{\$}{\leftarrow} | Uniform sampling.
UnU_nUniform distribution on SnS_n.
id\mathrm{id}Identity permutation.
1\mathbf{1}All-ones vector in Rn\mathbb{R}^n.
ei\mathbf{e}_iiith standard basis vector of Rn\mathbb{R}^n.
IIIdentity matrix.
RσR_\sigmaPermutation matrix of σ∈Sn\sigma\in S_n defined as Rσei=eσ(i)R_\sigma\mathbf{e}_i = \mathbf{e}_{\sigma(i)}.
L(X)\mathcal{L}(X)Distribution of a random variable XX.
⊕\oplusXOR, applied componentwise to bit vectors.
μ∗ν\mu* \nuConvolution: (μ∗ν)(σ)=∑γμ(γ)ν(γ−1σ)(\mu* \nu)(\sigma) = \sum_\gamma\mu(\gamma)\nu(\gamma^{-1}\sigma).
∥μ−ν∥TV\lVert\mu-\nu\rVert_{\mathrm{TV}}12∑x∣μ(x)−ν(x)∣\frac{1}{2}\sum_x \lvert\mu(x)-\nu(x)\rvert.
χ2(μ∥Un)\chi^2(\mu\mathbin\Vert U_n)n!∑σ∈Snμ(σ)2−1n!\sum_{\sigma\in S_n}\mu(\sigma)^2-1.
d∞(μ,Un)d_\infty(\mu,U_n)Relative L∞L^\infty error: max⁡σ∈Sn∣n!μ(σ)−1∣\max_{\sigma\in S_n}\lvert n!\mu(\sigma)-1\rvert.
tr⁡(A)\operatorname{tr}(A)Matrix trace, ∑iAii\sum_i A_{ii}.
Tr⁡W(L)\operatorname{Tr}_W(L)Operator trace of L:W→WL: W \to W.
∥A∥F2\lVert A\rVert_F^2Squared Frobenius norm, tr⁡(ATA)=∑i,jAij2\operatorname{tr}(A^\mathsf{T}A)=\sum_{i,j} A_{ij}^2.

Table 2.

Permutations map card labels to positions, and products act from right to left.

Random-pair Monte shuffle and main results

We define the random-pair Monte shuffle on nn cards as follows. At each step tt, sample xt,ytx_t,y_t independently and uniformly with replacement from [n][n], and set τt=(xt yt)\tau_t=(x_t\,y_t), with τt=id\tau_t=\mathrm{id} when xt=ytx_t=y_t. All endpoint samples are independent across steps. Each τt\tau_t specifies a switch.

Independently, sample a private bit vector B=(b1,…,bm)B=(b_1,\ldots,b_m) uniformly from {0,1}m\{0,1\}^m, and set

public schedule:Tt=(τ1,…,τt),T=Tm,realized permutation:πt(T,B)=τtbt⋯τ1b1,conditional distribution:ΠT=L(πm(T,B)∣T).(1)\begin{aligned} \text{public schedule:}\quad&T_t=(\tau_1,\ldots,\tau_t),\qquad T=T_m,\\ \text{realized permutation:}\quad&\pi_t(T,B)=\tau_t^{b_t}\cdots\tau_1^{b_1},\\ \text{conditional distribution:}\quad&\Pi_T=\mathcal{L}(\pi_m(T,B)\mid T). \tag*{(1)} \end{aligned}

For fixed TT, the distribution ΠT\Pi_T averages over the private bit vector BB. The function πt(T,B)\pi_t(T,B) uses only the first tt entries of each argument; we abbreviate it to πt\pi_t when the inputs are understood. We take T0T_0 to be the empty schedule and π0(T,B)=id\pi_0(T,B)=\mathrm{id}. All mm sampled pairs, including equal-endpoint null steps, count toward mixing time. Define the conditional error and its schedule average by

Δ(T)=∥ΠT−Un∥TV,dn(m)=ETΔ(T).(2)\Delta(T)=\lVert\Pi_T-U_n\rVert_{\mathrm{TV}},\qquad d_n(m)=\mathbb{E}_T\Delta(T). \tag*{(2)}

Equivalently,

dn(m)=∥L(T,πm(T,B))−L(T)⊗Un∥TV.(3)d_n(m)=\left\lVert\mathcal{L}(T,\pi_m(T,B))-\mathcal{L}(T)\otimes U_n\right\rVert_{\mathrm{TV}}. \tag*{(3)}

The target is therefore a uniform full permutation independent of its public schedule. For 0<ε<10<\varepsilon<1, let

mε(n)=min⁡{m≥0:dn(m)≤ε}.m_\varepsilon(n)=\min\{m\ge0:d_n(m)\le\varepsilon\}.

Theorem 1.1 (Main result). For every fixed 0<ε<10<\varepsilon<1, the mixing time of the random-pair Monte shuffle satisfies

mε(n)=2nlog⁡n+Oε(n).(4)m_\varepsilon(n)=2n\log n+O_\varepsilon(n). \tag*{(4)}

Moreover, for n≥10n\ge10 and an integer m=2nlog⁡n+cn≥0m=2n\log n+cn\ge0,

c<0⟹dn(m)≥1−8ec/2,(5)c<0\quad\Longrightarrow\quad d_n(m)\ge1-8e^{c/2}, \tag*{(5)}
c>0⟹dn(m)≤8e−c/2.(6)c>0\quad\Longrightarrow\quad d_n(m)\le8e^{-c/2}. \tag*{(6)}

We prove Theorem 1.1 in § 2. Doubling the leading term in the number of steps suffices for the stronger conditional pointwise guarantee of Proposition 2.3. For fixed 0<ε,δ<10<\varepsilon,\delta<1, a schedule of length 4nlog⁡n+Oε,δ(n)4n\log n+O_{\varepsilon,\delta}(n) satisfies

1−εn!≤ΠT(σ)≤1+εn!for every σ∈Sn\frac{1-\varepsilon}{n!}\le\Pi_T(\sigma)\le\frac{1+\varepsilon}{n!}\qquad\text{for every }\sigma\in S_n

with probability at least 1−δ1-\delta over the public schedule.

For the upper bound in Equation (6), we run two copies of the shuffle with the same schedule and independent private bits. After averaging over schedules, their relative permutation follows the ordinary 1/21/2-lazy random-transposition walk. The collision probability of the two copies is therefore the return probability of this auxiliary walk. Its normalized excess over 1/n!1/n! equals the expected conditional chi-square error of our shuffle. We bound this error using the L2L^2 estimate of Saloff-Coste and Zúñiga [22], then apply the standard inequality relating total variation and chi-square distance. Ordinary TV mixing of the auxiliary walk is not sufficient: the argument needs control of its return probability. This accounts for the additional factor of two beyond laziness.

For the lower bound (Equation (5)), we construct a test function of the schedule and the observed permutation. Its value is the expected number of cardwise agreements with an independent run under the same schedule, centered by subtracting one. This function aggregates the small biases in the destinations of individual cards. To turn the difference in means into a distinguisher, we control the statistic’s variance under the shuffle and uniform distributions. A change of schedule expresses its second moment as the trace of a matrix-averaging operator. We decompose the matrix space into four subspaces preserved by relabeling and compute the eigenvalue on each. The resulting variance estimate, together with Chebyshev’s inequality, gives the matching lower bound.

Related work

Morris [14 Section 3.1] introduced the collision/Monte framework and developed entropy methods for shuffles built from fair identity/transposition choices. A fair switch on positions x,yx,y is

Cb(x,y)=(xy)b,b←${0,1}.C^{b}(x,y)=(xy)^{b},\qquad b\overset{\$}{\leftarrow}\{0,1\}.

Each occurrence uses a fresh, independent private bit. A step applies one candidate switch; a round applies a complete layer of disjoint switches.

We review Monte shuffles and random-transposition shuffles below. Table 1 summarizes their definitions and mixing bounds.

NameDefinitionMixing timeReferences
Thorp shuffleTi={{x,y}:x⊕y=ei  mod ℓ}T_i=\{\{x,y\}:x\oplus y=e_i\ \bmod\ell\}<br>apply ∏{x,y}∈TiCb(x,y)\prod_{\{x,y\}\in T_i} C^{b}(x,y)Oε(log⁡3n)O_{\varepsilon}(\log^{3} n) rounds<br>Θε(log⁡n)\Theta_{\varepsilon}(\log n) rounds[15]<br>[19]
Swap-or-NotKi←$F2ℓ\boxed{K_i}\mathrel{\overset{\$}{\leftarrow}}\mathbb{F}_2^{\ell}<br>Ti={{x,y}:x⊕y=Ki}T_i=\{\{x,y\}:x\oplus y=K_i\}<br>apply ∏{x,y}∈TiCb(x,y)\prod_{\{x,y\}\in T_i} C^{b}(x,y) | Oε,α(log⁡n)†O_{\varepsilon,\alpha}(\log n)^{\dagger} rounds | [9]
Sometimes-RecurseFor i=ℓ,…,1i=\ell,\ldots,1, run rr rounds of<br>Swap-or-Not on the first 2i2^i positionsr=Oε(log⁡n)r=O_{\varepsilon}(\log n)<br>Oε(nlog⁡n)O_{\varepsilon}(n\log n) steps total[17]
Random<br>perfect-matching<br>MonteTi={{xj,yj}}j=1n/2T_i=\{\{x_j,y_j\}\}_{j=1}^{n/2} uniform<br>random partition of [n][n]<br>apply ∏{x,y}∈TiCb(x,y)\prod_{\{x,y\}\in T_i} C^{b}(x,y)Oε,α(log⁡n)†O_{\varepsilon,\alpha}(\log n)^{\dagger} rounds[3]
Random-pair Montex,y←$[n]\boxed{x,y}\mathrel{\overset{\$}{\leftarrow}}[n]<br>apply Cb(x,y)C^{b}(x,y) | Oε(nlog⁡n)‡O_{\varepsilon}(n\log n)^{\ddagger} steps<br>2nlog⁡n+Oε(n)2n\log n+O_{\varepsilon}(n) steps | [Ana26]<br>This work
Semi-random<br>transpositionsxi∈[n]\boxed{x_i}\in[n] fixed in advance; yi←$[n]y_i\mathrel{\overset{\$}{\leftarrow}}[n]<br>apply (xi yi)(x_i\,y_i) | Oε(nlog⁡n)O_{\varepsilon}(n\log n) steps | [16]
Random transpositionx,y←$[n]x,y\mathrel{\overset{\$}{\leftarrow}}[n]<br>apply (x y)(x\,y) | 12nlog⁡n+Oε(n)\frac{1}{2}n\log n+O_{\varepsilon}(n) steps | [5]

Table 1. Shuffling schemes on SnS_n and their mixing guarantees conditional on public information (boxed variables). Bounds are for fixed total variation distance from the uniform distribution 0<ε<10<\varepsilon<1; †\dagger marks bounds on the joint positions of any prescribed ⌊(1−α)n⌋\lfloor(1-\alpha)n\rfloor cards, with fixed α∈(0,1)\alpha\in(0,1); ‡\ddagger is convergence in the multiplicative point-wise distance. A step is one transposition or a fair switch; a round is one layer of disjoint switches. Each Cb(x,y)=(x y)bC^{b}(x,y)=(x\,y)^{b} uses a fresh private fair bit bb. The first three schemes assume n=2ℓn=2^{\ell}; each deck is identified with F2ℓ\mathbb{F}_2^{\ell}, and the eje_j are standard basis vectors. References are not exhaustive.

The Thorp shuffle. For n=2ℓn=2^{\ell}, identify positions with F2ℓ\mathbb{F}_{2}^{\ell} and let e0,…,eℓ−1\mathbf{e}_{0},\ldots,\mathbf{e}_{\ell-1} be its standard basis. In round ii, independently apply a fair switch to every unordered pair {x,x⊕ei mod ℓ}\{x,x\oplus\mathbf{e}_{i\bmod\ell}\}. This is the Thorp shuffle in a rotating coordinate frame. In the equivalent time-invariant description, the deck is cut in half and corresponding cards from the two halves are interleaved in independently chosen random orders [24]. The first polylogarithmic bound on the Thorp shuffle mixing time was Morris’s O(log⁡44n)O(\log^{44}n) estimate on the number of rounds [13], which was subsequently improved to the asymptotically optimal Θ(log⁡n)\Theta(\log n) [18, 14, 15, 10, 19].

XOR Swap-Or-Not. Hoang, Morris, and Rogaway [9] introduced the Swap-Or-Not shuffle. In its XOR form, round ii samples a public key Ki∈F2ℓK_i\in\mathbb{F}_{2}^{\ell} and applies independent fair switches to all pairs {x,x⊕Ki}\{x,x\oplus K_i\}. Conditional on the round keys, their proof bounds convergence in O(log⁡n)O(\log n) rounds for the joint positions of any prescribed fixed fraction of the cards, not a total variation bound for the full permutation. Dai, Hoang, and Tessaro [4] obtain tighter Swap-Or-Not bounds using the chi-squared method. Jho and Lee [11] generalize Swap-Or-Not by replacing the XOR pairings with keyed partitions, reducing the round count for the same fractional-deck guarantee.

Ristenpart and Yilek’s Mix-and-Cut shuffle [20] obtains full-permutation statistical security by recursively randomizing the partition of a deck into two halves. For n=2ℓn=2^{\ell}, their construction applies rr rounds of Swap-Or-Not to each block, cuts it in half, and independently shuffles the two halves by the same procedure. For fixed error, their analysis gives Oε(log⁡2n)O_{\varepsilon}(\log^{2}n) layers and a total of Oε(nlog⁡2n)O_{\varepsilon}(n\log^{2}n) switches.

Morris and Rogaway’s Sometimes-Recurse shuffle [17] recurses on only one half after each Swap-Or-Not stage. With independent randomness at each stage, it is a Monte shuffle whose public schedule consists of matching layers on successively smaller subdecks. Their recursive argument, combined with the Swap-Or-Not bound on the partial deck mixing, gives full-permutation conditional TV mixing in Oε(nlog⁡n)O_{\varepsilon}(n\log n) switches and Oε(log⁡2n)O_{\varepsilon}(\log^{2}n) layers.

Random matching layers. One can construct a switching network by sampling a uniform perfect matching in each round. Czumaj [3] proves that perfect-matching networks mix any prescribed fixed fraction of the cards in O(log⁡n)O(\log n) layers with probability 1−O(n−2)1-O(n^{-2}) over the choice of the network. The same work gives a separate explicit full-permutation network with O(nlog⁡n)O(n\log n) switches and O(log⁡2n)O(\log^2 n) depth.

The iid random-pair upper bound. In the work closest to ours, Anari [Ana26] proves multiplicative pointwise near-uniformity for a random-pair Monte shuffle, with high probability over the public schedule, in O(nlog⁡n)O(n\log n) steps. We obtain the sharp leading constant for conditional TV mixing and a matching lower bound. Our multiplicative pointwise guarantee uses 4nlog⁡n+O(n)4n\log n+O(n) steps, twice the leading count for conditional total variation.

Czumaj and Lingas [2] show by a counting argument that m=Ω(nlog⁡n)m=\Omega(n\log n) independent uniform distinct-pair interactions have dependency depth Θ(m/n)\Theta(m/n) in expectation and with high probability. We apply this result in § 3.

Random transpositions. The random transposition shuffle samples x,yx,y independently and uniformly from [n][n] and applies (xy)(xy). Diaconis and Shahshahani [5] proved the sharp total-variation upper bound of 12nlog⁡n+Oε(n)\frac{1}{2}n\log n+O_{\varepsilon}(n) steps for each fixed error 0<ε<10<\varepsilon<1. Saloff-Coste and Zúñiga [22] refined the classical L2L^2 estimates with explicit constants in discrete and continuous time; we use their continuous-time bound in spectral form (Proposition 2.2).

A matching lower bound follows by tracking the number of untouched cards, known as the coupon-collector problem. In a series of works, this lower bound was shown to be optimal in several senses: by White for convergence in separation distance [25], by Teyssier through an exact total-variation cutoff profile [23], and by Jain and Sawhney [12], who proved that the walk is asymptotically uniform at the first time every card has been touched.

Semi-random transpositions. Fix a sequence of positions x1,x2,…x_1,x_2,\ldots before execution. At step ii, sample yiy_i uniformly from [n][n] and apply (xiyi)(x_i y_i). Mossel, Peres, and Sinclair [16] proved an Oε(nlog⁡n)O_{\varepsilon}(n\log n) mixing bound uniformly over the fixed sequence. Saloff-Coste and Zúñiga [21] and, independently, Ganapathy [7] sharpened this to nlog⁡n+Oε(n)n\log n+O_{\varepsilon}(n), with the leading constant optimal over all fixed endpoint sequences, as witnessed by the star-transposition shuffle.

Upper and matching lower bounds for conditional mixing

We first prove the upper bound by comparing two executions with a common schedule. We then construct a test function for the lower bound and estimate its first two moments.

The shared-schedule collision identity

Let PP be the classical random-transposition kernel: independently sample x,yx,y uniformly from [n][n] and apply (xy)(xy), including the identity when x=yx=y. Our schedule-averaged kernel is its 1/21/2-lazification,

Q=I+P2.Q=\frac{I+P}{2}.

Write qm=L(πm(T,B))=ETΠTq_m=\mathcal{L}(\pi_m(T,\mathcal{B}))=\mathbb{E}_{T}\Pi_T for its mm-step distribution from id. Define the expected conditional chi-square error and the pointwise relative error of the schedule-averaged distribution by

χn(m)=ETχ2(ΠT∥Un),ηm=d∞(qm,Un)=max⁡σ∈Sn∣n!qm(σ)−1∣.\chi_n(m)=\mathbb{E}_{T}\chi^2(\Pi_T\Vert U_n),\qquad \eta_m=d_{\infty}(q_m,U_n)=\max_{\sigma\in S_n}|n!q_m(\sigma)-1|.

Note that ηm\eta_m concerns the averaged distribution qmq_m. The conditional relative error d∞(ΠT,Un)d_\infty(\Pi_T,U_n) is a different quantity, which we bound in Proposition 2.3.

Lemma 2.1 (Shared-schedule collision identity). For every n≥2n \ge2 and integer m≥0m \ge0,

Xn(m)=n!qm(id⁡)−1=ηm.(7)X_n(m) = n!q_m(\operatorname{id}) - 1 = \eta_m. \tag*{(7)}

Proof. Run two copies Xt=πt(T,B)X_t = \pi_t(\mathrm{T},B) and Yt=πt(T,B′)Y_t = \pi_t(\mathrm{T},B') with the same public schedule and independent private bits. Their relative permutation Zt=Xt−1YtZ_t = X_t^{-1}Y_t evolves as

Zt=(Xt−1−1τtXt−1)bt⊕bt′Zt−1.Z_t = \left(X_{t-1}^{-1}\tau_tX_{t-1}\right)^{b_t\oplus b'_t}Z_{t-1}.

Conditional on the past, the conjugated endpoints are still independent and uniform, and bt⊕bt′b_t \oplus b'_t is a fresh fair bit. Hence ZtZ_t has transition kernel QQ and starts at id⁡\operatorname{id}. Conditional on T\mathrm{T}, the walks XmX_m and YmY_m are independent draws from ΠT\Pi_T. Thus, for every σ∈Sn\sigma\in S_n,

qm(σ)=ET∑π∈SnΠT(π)ΠT(πσ).q_m(\sigma) = \mathbb{E}_{\mathrm{T}}\sum_{\pi\in S_n}\Pi_T(\pi)\Pi_T(\pi\sigma).

At σ=id⁡\sigma= \operatorname{id}, this gives n!qm(id⁡)−1=Xn(m)n!q_m(\operatorname{id}) - 1 = X_n(m). Subtracting the uniform baseline, we have

qm(σ)−1n!=ET∑π∈Sn(ΠT(π)−1n!)(ΠT(πσ)−1n!).q_m(\sigma)-\frac{1}{n!}=\mathbb{E}_{\mathrm{T}}\sum_{\pi\in S_n}\left(\Pi_T(\pi)-\frac{1}{n!}\right)\left(\Pi_T(\pi\sigma)-\frac{1}{n!}\right).

The map π↦πσ\pi\mapsto\pi\sigma permutes SnS_n, so the two vectors in this inner product have the same Euclidean norm. Cauchy–Schwarz for each fixed schedule, followed by averaging, gives

∣n!qm(σ)−1∣≤n!ET∑π∈Sn(ΠT(π)−1n!)2=Xn(m).\left|n!q_m(\sigma)-1\right|\le n!\mathbb{E}_{\mathrm{T}}\sum_{\pi\in S_n}\left(\Pi_T(\pi)-\frac{1}{n!}\right)^2=X_n(m).

Taking the maximum over σ\sigma, with equality at id⁡\operatorname{id}, proves (2.1). □\square

The collision identity explains the additional factor of two relative to the ordinary lazy random-transposition shuffle. Since QQ is symmetric, the ordinary chi-square error satisfies

χ2(qm∥Un)=n!q2m(id⁡)−1,\chi^2(q_m\|U_n)=n!q_{2m}(\operatorname{id})-1,

whereas the expected conditional chi-square error is Xn(m)=n!qm(id⁡)−1X_n(m)=n!q_m(\operatorname{id})-1 by (2.1). Thus a chi-square bound for the ordinary lazy walk gives the same bound on the expected conditional error at twice the time. This explains the additional factor of two in our upper bound, beyond the slowdown from laziness. The matching lower bound shows that this additional factor is also necessary for conditional TV mixing. The next subsection obtains the required return-probability bound from the L2L^2 estimate of Saloff-Coste and Zúñiga [22].

Conditional mixing upper bound

Let p0=1,p1,…,pn!−1p_0=1,p_1,\ldots,p_{n!-1} be the eigenvalues of PP, counted with multiplicity, with p0p_0 corresponding to constant functions. Proposition 4.6 of Saloff-Coste and Zúñiga [22] gives the following estimate in our normalization:

n≥10,c≥4⟹∑j≠0exp⁡[−n(log⁡n+c2)(1−pj)]≤e4−c.(8)n\ge10,\qquad c\ge4\quad\Longrightarrow\quad\sum_{j\ne0}\exp\left[-n\left(\log n+\frac{c}{2}\right)(1-p_j)\right]\le e^{4-c}. \tag*{(8)}

We use their continuous-time L2L^2 bound only in this spectral form.

Proposition 2.2 (Averaged pointwise and conditional-TV upper bounds). For n≥10n \ge10 and c≥4c \ge4,

m≥2nlog⁡n+cn⟹Xn(m)=ηm≤e4−c,dn(m)≤12e2−c/2.(9)m \ge2n\log n + cn \quad\Longrightarrow\quad X_n(m)=\eta_m \le e^{4-c},\qquad d_n(m)\le\frac{1}{2}e^{2-c/2}. \tag*{(9)}

Proof. By (7) and translation invariance, n!qm(id)=tr⁡(Qm)n!q_m(\mathrm{id})=\operatorname{tr}(Q^m). Since Q=(I+P)/2Q=(I+P)/2,

ηm=Xn(m)=tr⁡(Qm)−1=∑j≠0(1+pj2)m\eta_m=X_n(m)=\operatorname{tr}(Q^m)-1=\sum_{j\ne0}\left(\frac{1+p_j}{2}\right)^m
≤∑j≠0exp⁡[−m2(1−pj)]≤e4−c.\le\sum_{j\ne0}\exp\left[-\frac{m}{2}(1-p_j)\right]\le e^{4-c}.

The first inequality uses zm≤e−m(1−z)z^m\le e^{-m(1-z)} for 0≤z≤10\le z\le1; the last uses m/2≥nlog⁡n+cn/2m/2\ge n\log n+cn/2 and (8). Finally, Cauchy–Schwarz for each conditional distribution and Jensen’s inequality give

dn(m)≤12ETχ2(ΠT∥Un)≤12Xn(m)≤12e2−c/2.(10)d_n(m)\le\frac{1}{2}\mathbb{E}_{\mathsf{T}}\sqrt{\chi^2(\Pi_{\mathsf{T}}\Vert U_n)} \le\frac{1}{2}\sqrt{X_n(m)}\le\frac{1}{2}e^{2-c/2}. \tag*{(10)}

For n≥10n\ge10 and 0<ε≤1/20<\varepsilon\le1/2, a sufficient number of sampled steps for joint error at most ε\varepsilon is

m≥⌈2n(log⁡n+2+log⁡12ε)⌉.(11)m\ge\left\lceil2n\left(\log n+2+\log\frac{1}{2\varepsilon}\right)\right\rceil. \tag*{(11)}

We can also bound the probability of a bad schedule. Since Δ(T)2≤14χ2(ΠT∥Un)\Delta(\mathsf{T})^2\le\frac{1}{4}\chi^2(\Pi_{\mathsf{T}}\Vert U_n),

PT{Δ(T)>ε}≤Xn(m)4ε2.(12)\mathbb{P}_{\mathsf{T}}\{\Delta(\mathsf{T})>\varepsilon\}\le\frac{X_n(m)}{4\varepsilon^2}. \tag*{(12)}

Consequently, for n≥10n\ge10, 0<ε≤1/20<\varepsilon\le1/2, and 0<δ<10<\delta<1, a sufficient number of sampled steps for this probability to be at most δ\delta is

m≥⌈2n(log⁡n+2+log⁡12ε+12log⁡1δ)⌉.(13)m\ge\left\lceil2n\left(\log n+2+\log\frac{1}{2\varepsilon}+\frac{1}{2}\log\frac{1}{\delta}\right)\right\rceil. \tag*{(13)}

We next obtain a pointwise bound conditional on the schedule. The argument uses two independent blocks of the shuffle. Write

Δ∞(T)=d∞(ΠT,Un)=max⁡σ∈Sn∣n!ΠT(σ)−1∣.\Delta_\infty(\mathsf{T})=d_\infty(\Pi_{\mathsf{T}},U_n)=\max_{\sigma\in S_n}|n!\Pi_{\mathsf{T}}(\sigma)-1|.

This is a schedule-dependent bound, unlike in ηm=d∞(qm,Un)\eta_m=d_\infty(q_m,U_n).

Proposition 2.3 (Conditional relative L∞L^\infty mixing). Let n≥10n\ge10, c≥4c\ge4, and let m≥2nlog⁡n+cnm\ge2n\log n+cn be an integer. For an iid public schedule T\mathsf{T} of length 2m2m,

ETΔ∞(T)≤e4−c.(14)\mathbb{E}_{\mathsf{T}}\Delta_\infty(\mathsf{T})\le e^{4-c}. \tag*{(14)}

In particular, for 0<ε,δ<10<\varepsilon,\delta<1, a schedule of length

M=2⌈2nlog⁡n+n(4+log⁡1εδ)⌉(15)M=2\left\lceil2n\log n+n\left(4+\log\frac{1}{\varepsilon\delta}\right)\right\rceil \tag*{(15)}

satisfies, with probability at least 1−δ1-\delta over its public schedule,

1−εn!≤ΠT(σ)≤1+εn!for every σ∈Sn.(16)\frac{1-\varepsilon}{n!}\le\Pi_{\mathsf{T}}(\sigma)\le\frac{1+\varepsilon}{n!}\qquad\text{for every }\sigma\in S_n. \tag*{(16)}

Proof. For any two probability distributions μ,ν\mu,\nu on SnS_n, centered convolution and Cauchy–Schwarz give

d∞(μ∗ν,Un)≤χ2(μ∥Un)χ2(ν∥Un).d_{\infty}(\mu* \nu,U_n) \le\sqrt{\chi^2(\mu\Vert U_n)\chi^2(\nu\Vert U_n)}.

Split T\mathrm{T} into two independent length-mm schedules T(1),T(2)\mathrm{T}^{(1)},\mathrm{T}^{(2)}. Conditional on these schedules, ΠT=ΠT(2)∗ΠT(1)\Pi_{\mathrm{T}}=\Pi_{\mathrm{T}^{(2)}}*\Pi_{\mathrm{T}^{(1)}}, so

ETΔ∞(T)≤(ET(1)χ2(ΠT(1)∥Un))2≤Xn(m)≤e4−c.\mathbb{E}_{\mathrm{T}}\Delta_{\infty}(\mathrm{T}) \le\left(\mathbb{E}_{\mathrm{T}^{(1)}}\sqrt{\chi^2(\Pi_{\mathrm{T}^{(1)}}\Vert U_n)}\right)^2 \le X_n(m) \le e^{4-c}.

Taking c=4+log⁡(1/(εδ))c=4+\log(1/(\varepsilon\delta)) and applying Markov’s inequality proves (16).

Thus 4nlog⁡n+Oε,δ(n)4n\log n+O_{\varepsilon,\delta}(n) steps suffice for fixed ε,δ\varepsilon,\delta. This is the conditional pointwise guarantee studied by Anari [Ana26], with an explicit sufficient constant.

A schedule-dependent distinguisher

Counting possible outputs gives the lower bound 2m≥(1−ε)n!2^m\ge(1-\varepsilon)n!, whose leading term is (nlog⁡n)/log⁡2(n\log n)/\log2, which falls short of the goal of proving the tightness of the constant 2. We instead use a test function that combines the biases in the destinations of all cards, conditional on the schedule.

For a schedule prefix Tt\mathrm{T}_t, let

MTt(j,i)=P{πt(T,B)(i)=j∣Tt}.M_{\mathrm{T}_t}(j,i)=\mathbb{P}\{\pi_t(\mathrm{T},B)(i)=j\mid\mathrm{T}_t\}.

The probability is over b1,…,btb_1,\ldots,b_t, with the schedule fixed. Thus column ii is the distribution of the position of card ii. Write MT=MTmM_{\mathrm{T}}=M_{\mathrm{T}_m} for the final matrix. To measure its deviation from uniform, subtract the matrix JJ whose entries are all 1/n1/n:

J(j,i)=1n(i,j∈[n]),CTt=MTt−J,CT(j,i)=MT(j,i)−1n.J(j,i)=\frac{1}{n}\quad(i,j\in[n]),\qquad C_{\mathrm{T}_t}=M_{\mathrm{T}_t}-J,\qquad C_{\mathrm{T}}(j,i)=M_{\mathrm{T}}(j,i)-\frac{1}{n}.

The rows and columns of CTC_{\mathrm{T}} sum to zero. The squared Frobenius norm ∥CT∥F2=∑i,jCT(j,i)2\lVert C_{\mathrm{T}}\rVert_{\mathrm{F}}^2=\sum_{i,j}C_{\mathrm{T}}(j,i)^2 measures the total squared single-card destination bias.

Given the schedule and a candidate permutation σ\sigma, consider the test function

F(T,σ)=∑i=1nMT(σ(i),i)−1.(17)F(\mathrm{T},\sigma)=\sum_{i=1}^{n}M_{\mathrm{T}}(\sigma(i),i)-1. \tag*{(17)}

Equivalently, F(T,σ)=∑iCT(σ(i),i)F(\mathrm{T},\sigma)=\sum_i C_{\mathrm{T}}(\sigma(i),i). The quantity F(T,σ)+1F(\mathrm{T},\sigma)+1 is the expected number of cardwise agreements between σ\sigma and an independent execution of the same schedule.

We will distinguish the two distributions by thresholding FF in the proof of Theorem 2.8. Let RR denote the joint distribution of the schedule and realized permutation, (T,πm(T,B))(\mathrm{T},\pi_m(\mathrm{T},B)), and II the distribution of (T,σ)(\mathrm{T},\sigma) with σ∼Un\sigma\sim U_n independent of T\mathrm{T}. By (3), dn(m)=∥R−I∥TVd_n(m)=\lVert R-I\rVert_{\mathrm{TV}}.

Throughout the lower-bound proof, assume n≥4n\ge4 and let

λ=1−1n.(18)\lambda=1-\frac{1}{n}. \tag*{(18)}

Lemma 2.4 (First moments and ideal variance). The statistic (17) satisfies

ERF=(n−1)λm,EIF=0,Var⁡IF=λm.(19)\mathbb{E}_R F=(n-1)\lambda^m,\qquad\mathbb{E}_I F=0,\qquad\operatorname{Var}_I F=\lambda^m. \tag*{(19)}

Proof. For τ=(u v)\tau=(u\ v) obtained from independent uniform endpoints u,v∈[n]u,v\in[n], set

Jτ=12(eu−ev)(eu−ev)T,Pτ=I−Jτ.J_\tau=\frac{1}{2}(\mathbf{e}_u-\mathbf{e}_v)(\mathbf{e}_u-\mathbf{e}_v)^{\mathsf{T}},\qquad P_\tau=I-J_\tau.

A fair switch averages the probabilities at its two positions. Thus, if pp is a card’s position-probability column vector before the switch, it becomes PτpP_\tau p afterward: the entries at uu and vv are both (pu+pv)/2(p_u+p_v)/2, and the others are unchanged. When u=vu=v, Jτ=0J_\tau=0 and Pτ=IP_\tau=I.

Since card ii starts at position ii, its initial distribution is ei\mathbf{e}_i. Applying the updates to all columns gives

MTt=Pτt⋯Pτ1.M_{T_t}=P_{\tau_t}\cdots P_{\tau_1}.

Coordinate averaging fixes JJ on both sides. Thus the centered matrices satisfy

CT0=I−J,CTt=PτtCTt−1,CT=CTm.C_{T_0}=I-J,\qquad C_{T_t}=P_{\tau_t}C_{T_{t-1}},\qquad C_T=C_{T_m}.

Here and below, Eτ\mathbb{E}_\tau uses this endpoint-sampling distribution, including τ=id\tau=\mathrm{id} with probability 1/n1/n. Averaging gives

EτJτ=I−Jn,EτPτ=λI+Jn,Pτ2=Pτ.\mathbb{E}_\tau J_\tau=\frac{I-J}{n},\qquad\mathbb{E}_\tau P_\tau=\lambda I+\frac{J}{n},\qquad P_\tau^2=P_\tau.

Since JCTt−1=0JC_{T_{t-1}}=0, symmetry and idempotence of PτtP_{\tau_t} imply

E[∥CTt∥F2∣τ1,…,τt−1]=tr⁡(CTt−1TE[Pτt]CTt−1)=λ∥CTt−1∥F2.\mathbb{E}\left[\left\|C_{T_t}\right\|_{\mathrm{F}}^2\mid\tau_1,\ldots,\tau_{t-1}\right] =\operatorname{tr}\left(C_{T_{t-1}}^{\mathsf{T}}\mathbb{E}[P_{\tau_t}]C_{T_{t-1}}\right) =\lambda\left\|C_{T_{t-1}}\right\|_{\mathrm{F}}^2.

Starting from ∥I−J∥F2=n−1\left\|I-J\right\|_{\mathrm{F}}^2=n-1, iteration yields

ET∥CT∥F2=(n−1)λm.(20)\mathbb{E}_T\left\|C_T\right\|_{\mathrm{F}}^2=(n-1)\lambda^m. \tag*{(20)}

Under the actual shuffle, P{πm(i)=j∣T}=MT(j,i)\mathbb{P}\{\pi_m(i)=j\mid T\}=M_T(j,i), with probability over B←${0,1}mB\mathrel{\overset{\$}{\leftarrow}}\{0,1\}^m. Hence

ER[F∣T]=∑i,jMT(j,i)P{πm(i)=j∣T}−1=∑i,jMT(j,i)2−1.\mathbb{E}_R[F\mid T]=\sum_{i,j}M_T(j,i)\mathbb{P}\{\pi_m(i)=j\mid T\}-1 =\sum_{i,j}M_T(j,i)^2-1.

Since ∑i,jMT(j,i)=n\sum_{i,j}M_T(j,i)=n, the last expression equals ∑i,j(MT(j,i)−1/n)2=∥CT∥F2\sum_{i,j}(M_T(j,i)-1/n)^2=\left\|C_T\right\|_{\mathrm{F}}^2. Averaging over TT and applying (2.14) computes the realized mean.

For an independent uniform permutation, the conditional mean is zero because CTC_T has zero column sums. Expanding the square under a uniform permutation gives

Eσ∼Un(∑iCT(σ(i),i))2=1n−1∥CT∥F2.\mathbb{E}_{\sigma\sim U_n}\left(\sum_i C_T(\sigma(i),i)\right)^2 =\frac{1}{n-1}\left\|C_T\right\|_{\mathrm{F}}^2.

Indeed, the diagonal terms contribute ∥CT∥F2/n\left\|C_T\right\|_{\mathrm{F}}^2/n. The remaining terms contribute ∥CT∥F2/[n(n−1)]\left\|C_T\right\|_{\mathrm{F}}^2/[n(n-1)], using the zero row and column sums and the uniform distribution on distinct images. Averaging over TT and using (2.14) completes the proof.

The realized second moment

The mean gap alone is not enough: it could be due to rare large values of FF. We now estimate the second moment ERF2=ET,B[F(T,πm(T,B))2]\mathbb{E}_R F^2=\mathbb{E}_{T,B}[F(T,\pi_m(T,B))^2]. The next lemma absorbs the realized walk into a change of schedule, leaving an expectation over schedules alone.

Lemma 2.5. With CTC_T as above,

ERF2=ET[(tr⁡CT)2].(21)\mathbb{E}_{\mathbb{R}}F^2=\mathbb{E}_T[(\operatorname{tr}C_T)^2]. \tag*{(21)}

Proof. Let f(σ)=∣{i:σ(i)=i}∣−1f(\sigma)=|\{i:\sigma(i)=i\}|-1 be the centered fixed-point count. For a fixed schedule TT and any candidate permutation σ\sigma,

F(T,σ)=EDf(σ−1πm(T,D)),F(T,\sigma)=\mathbb{E}_D f(\sigma^{-1}\pi_m(T,D)),

where DD is uniform on {0,1}m\{0,1\}^m. Fix TT, BB, and independently sample B~\widetilde{B} uniformly from {0,1}m\{0,1\}^m. Let

πt=πt(T,B),π~t=πt(T,B~).\pi_t=\pi_t(T,B),\qquad\widetilde{\pi}_t=\pi_t(T,\widetilde{B}).

Both walks use the original schedule TT. Define a new schedule by

τ~t=πt−1−1τtπt−1,T~=(τ~1,…,τ~m).\widetilde{\tau}_t=\pi_{t-1}^{-1}\tau_t\pi_{t-1},\qquad\widetilde{T}=(\widetilde{\tau}_1,\ldots,\widetilde{\tau}_m).

For every choice of B~\widetilde{B}, the relative walk satisfies

πt−1π~t=πt−1−1τtbt⊕b~tτ~t−1=τ~tbt⊕b~tπ~t−1−1τ~t−1.\pi_t^{-1}\widetilde{\pi}_t =\pi_{t-1}^{-1}\tau_t^{b_t\oplus\widetilde{b}_t}\widetilde{\tau}_{t-1} =\widetilde{\tau}_t^{b_t\oplus\widetilde{b}_t}\widetilde{\pi}_{t-1}^{-1}\widetilde{\tau}_{t-1}.

Iterating from π0=π~0=id⁡\pi_0=\widetilde{\pi}_0=\operatorname{id} yields

πm−1π~m=πm(T~,B⊕B~).\pi_m^{-1}\widetilde{\pi}_m=\pi_m(\widetilde{T},B\oplus\widetilde{B}).

The schedule T~\widetilde{T} depends on TT, BB, but not on B~\widetilde{B}. Since B⊕B~B\oplus\widetilde{B} is uniform for fixed BB, we obtain

F(T,πm)=EB~f(πm−1π~m)=EB~f(πm(T~,B⊕B~))=EB~f(πm(T~,B~)).F(T,\pi_m)=\mathbb{E}_{\widetilde{B}}f(\pi_m^{-1}\widetilde{\pi}_m) =\mathbb{E}_{\widetilde{B}}f(\pi_m(\widetilde{T},B\oplus\widetilde{B})) =\mathbb{E}_{\widetilde{B}}f(\pi_m(\widetilde{T},\widetilde{B})).

Now fix BB and average over TT. Conditional on the preceding public transpositions, πt−1\pi_{t-1} is fixed and τt\tau_t is fresh. Conjugation by πt−1−1\pi_{t-1}^{-1} preserves the distribution of its endpoints, including equal endpoints. Thus T~\widetilde{T} has the same distribution as TT for each fixed BB, and

ERF2=ET,B{EB~f(πm(T~,B~))}2=ET{EBf(πm(T,B))}2.\mathbb{E}_{\mathbb{R}}F^2 =\mathbb{E}_{T,B}\left\{\mathbb{E}_{\widetilde{B}}f(\pi_m(\widetilde{T},\widetilde{B}))\right\}^2 =\mathbb{E}_T\left\{\mathbb{E}_Bf(\pi_m(T,B))\right\}^2.

Finally, EBf(πm(T,B))=Eσ∼ΠTf(σ)=tr⁡MT−1=tr⁡CT\mathbb{E}_Bf(\pi_m(T,B))=\mathbb{E}_{\sigma\sim\Pi_T}f(\sigma)=\operatorname{tr}M_T-1=\operatorname{tr}C_T, as claimed.

Equip Rn×n\mathbb{R}^{n\times n} with the Frobenius inner product ⟨X,Y⟩F=tr⁡(XTY)\langle X,Y\rangle_F=\operatorname{tr}(X^{\mathsf{T}}Y). To evaluate the remaining second moment, consider the matrix space and averaging operator

Z={X∈Rn×n:X1=XT1=0},A(X)=Eτ[PτXPτT](X∈Z).\mathcal{Z}=\{X\in\mathbb{R}^{n\times n}:X\mathbf{1}=X^{\mathsf{T}}\mathbf{1}=0\},\qquad \mathcal{A}(X)=\mathbb{E}_{\tau}[P_\tau XP_\tau^{\mathsf{T}}]\quad(X\in\mathcal{Z}).

Each update averages two rows and the corresponding columns, preserving Z\mathcal{Z}. By independence of the public pairs, for X∈ZX\in\mathcal{Z} we have

Am(X)=ET[MTXMTT]=ET[CTXCTT],\mathcal{A}^m(X)=\mathbb{E}_T[M_TXM_T^{\mathsf{T}}]=\mathbb{E}_T[C_TXC_T^{\mathsf{T}}],

where the last equality uses JX=XJ=0JX=XJ=0. The operator X↦CTXCTTX\mapsto C_TXC_T^{\mathsf{T}} has trace (tr⁡CT)2(\operatorname{tr}C_T)^2: its diagonal coefficients in the matrix-unit basis are CT(i,i)CT(j,j)C_T(i,i)C_T(j,j). Since CTJ=JCT=0C_TJ=JC_T=0, it vanishes on Z⊥\mathcal{Z}^{\perp}, and its trace on Z\mathcal{Z} is unchanged. Taking expectations and applying Lemma 2.5 gives

ERF2=Tr⁡Z(Am).(22)\mathbb{E}_{\mathbb{R}}F^2=\operatorname{Tr}_{\mathcal{Z}}(\mathcal{A}^m). \tag*{(22)}

It remains to determine the spectrum of A\mathcal{A} on Z\mathcal{Z}.

Lemma 2.6 (Averaging-operator spectrum). On Z\mathcal{Z}, the operator A\mathcal{A} has the following eigenvalues and multiplicities:

ModeEigenvalueMultiplicity
Common symmetric componentλ1=λ=1−1/n\lambda_1 = \lambda= 1 - 1/n11
Symmetric vertex effectsλ2=1−3/(2n)\lambda_2 = 1 - 3/(2n)n−1n - 1
Symmetric residual edge effectsλ3=λ2=(1−1/n)2\lambda_3 = \lambda^2 = (1 - 1/n)^2n(n−3)/2n(n - 3)/2
Skew-symmetric componentλ4=1−2/n\lambda_4 = 1 - 2/n(n−1)(n−2)/2(n - 1)(n - 2)/2

Table 3 (PDF p. 12).

Proof. Simultaneously relabeling rows and columns gives a representation ρ\rho of SnS_n on Z\mathcal{Z}:

ρ(σ)X=RσXRσT\rho(\sigma)X = R_\sigma X R_\sigma^{\mathsf{T}}

Let H=I−JH = I - J. The following four subspaces of Z\mathcal{Z} are preserved by every relabeling, in the order listed in the lemma:

common:span⁡{H},vertex:{Hdiag⁡(z)H: ∑izi=0},residual:{X∈Z:XT=X, Xii=0 for all i},skew:{X∈Z:XT=−X}.\begin{aligned} \text{common}:&\quad\operatorname{span}\{H\},\\ \text{vertex}:&\quad\{H\operatorname{diag}(z)H:\ \sum_i z_i = 0\},\\ \text{residual}:&\quad\{X \in\mathcal{Z}: X^{\mathsf{T}} = X,\ X_{ii} = 0\text{ for all }i\},\\ \text{skew}:&\quad\{X \in\mathcal{Z}: X^{\mathsf{T}} = -X\}. \end{aligned}

Here diag⁡(z)\operatorname{diag}(z) is the diagonal matrix with diagonal zz. These subspaces have the dimensions in the lemma and form a direct sum: split into symmetric and skew-symmetric parts, then use the common and vertex components to match the diagonal, leaving the residual component. Indeed, (Hdiag⁡(z)H)ii=(1−2/n)zi(H\operatorname{diag}(z)H)_{ii} = (1 - 2/n)z_i for zero-sum zz.

To justify irreducibility, let V=1⊥V = \mathbf{1}^{\perp} be the standard zero-sum-vector representation. The map u⊗v↦uvTu \otimes v \mapsto uv^{\mathsf{T}} identifies its tensor square V⊗VV \otimes V with Z\mathcal{Z} and respects relabeling, since (Rσu)(Rσv)T=Rσ(uvT)RσT(R_\sigma u)(R_\sigma v)^{\mathsf{T}} = R_\sigma(uv^{\mathsf{T}})R_\sigma^{\mathsf{T}}. For n≥4n \ge4, this tensor square has exactly four irreducible summands [6 Exercise 4.19]. Our four nonzero invariant subspaces must therefore each be irreducible: none contains a smaller nonzero subspace preserved by every relabeling.

Let the operator K\mathcal{K} be the average over transpositions of distinct labels:

K=1(n2)∑i<jρ((i j)).\mathcal{K} = \frac{1}{\binom{n}{2}}\sum_{i<j}\rho((i\,j)).

This operator preserves each component and commutes with every relabeling. It is self-adjoint for the Frobenius inner product, so its eigenspaces are also preserved by every relabeling. By Schur’s lemma, K\mathcal{K} multiplies each irreducible component WW by a scalar. All transpositions have the same trace on WW, giving that scalar as

rW=Tr⁡Wρ((1 2))dim⁡W.(23)r_W = \frac{\operatorname{Tr}_W \rho((1\,2))}{\dim W}. \tag*{(23)}

Thus only the trace of one transposition on each component is needed.

To relate this relabeling average to our shuffle, observe that Pτ=(I+Rτ)/2P_\tau= (I + R_\tau)/2. With independent uniform endpoints,

EτRτ=(1−2n)I+2nJ,Eτρ(τ)=1nIZ+n−1nK.\mathbb{E}_\tau R_\tau= \left(1 - \frac{2}{n}\right)I + \frac{2}{n}J,\qquad\mathbb{E}_\tau\rho(\tau) = \frac{1}{n}I_{\mathcal{Z}} + \frac{n - 1}{n}\mathcal{K}.

The identity term in the second formula accounts for equal endpoints. Since JX=XJ=0JX = XJ = 0 for X∈ZX \in\mathcal{Z}, expansion gives

A(X)=14Eτ[X+RτX+XRτ+RτXRτT]=n−14n(3X+K(X)).(24)\mathcal{A}(X) = \frac{1}{4}\mathbb{E}_{\tau}\left[X + R_{\tau}X + XR_{\tau} + R_{\tau}XR_{\tau}^{\mathsf{T}}\right] = \frac{n-1}{4n}\left(3X + \mathcal{K}(X)\right). \tag*{(24)}

Hence its eigenvalue on WW is (n−1)(3+rW)/(4n)(n-1)(3+r_W)/(4n).

It remains to compute the four traces and the dimensions of the respective eigenspaces. On the common component the trace is 11. On the vertex component, relabeling simply permutes zz, so the trace is n−3n-3: a transposition fixes n−2n-2 coordinate vectors, and the constant direction contributes 11.

The symmetric matrices in Z\mathcal{Z} have basis J(ij)=12(ei−ej)(ei−ej)TJ_{(ij)} = \frac{1}{2}(e_i-e_j)(e_i-e_j)^{\mathsf{T}}, i<ji<j, which is permuted by relabeling. The transposition (1 2)(1\ 2) fixes {1,2}\{1,2\} and the (n−22)\binom{n-2}{2} pairs avoiding those labels. Subtracting the common and vertex traces gives the residual trace

1+(n−22)−1−(n−3)=(n−3)(n−4)2.1+\binom{n-2}{2}-1-(n-3)=\frac{(n-3)(n-4)}{2}.

On all skew-symmetric matrices, the trace is (n−22)−1\binom{n-2}{2}-1: the basis matrix on {1,2}\{1,2\} changes sign, disjoint pairs are fixed, and the other basis matrices are exchanged. This space splits into the skew component of Z\mathcal{Z} and the matrices z1T−1zTz\mathbf{1}^{\mathsf{T}}-\mathbf{1}z^{\mathsf{T}} with ∑izi=0\sum_i z_i=0. The latter transform as zero-sum vectors and have trace n−3n-3. The skew component therefore has trace

(n−22)−1−(n−3)=(n−2)(n−5)2.\binom{n-2}{2}-1-(n-3)=\frac{(n-2)(n-5)}{2}.

Dividing these traces by the dimensions in Equation (23) yields, in order,

rW=1,n−3n−1,n−4n−1,n−5n−1.r_W=1,\qquad\frac{n-3}{n-1},\qquad\frac{n-4}{n-1},\qquad\frac{n-5}{n-1}.

Substitution into (2.18) gives the four stated eigenvalues; their multiplicities are the component dimensions.

Proposition 2.7 (Variance under the realized distribution). For n≥4n\geq4 and m≥0m\geq0,

Var⁡RF≤λm+(n−1)λ2m.(25)\operatorname{Var}_{R} F \leq\lambda^{m}+(n-1)\lambda_{2}^{m}. \tag*{(25)}

Proof. By (2.16), we sum the mmth powers of the eigenvalues in Lemma 2.6, with their multiplicities:

ERF2=λm+(n−1)λ2m+n(n−3)2λ32m+(n−1)(n−2)2λ4m≤λm+(n−1)λ2m+((n−1)2−n)λ2m.(26)\begin{aligned} \mathbb{E}_{R}F^2=\lambda^m+(n-1)\lambda_2^m+\frac{n(n-3)}{2}\lambda_3^{2m}+\frac{(n-1)(n-2)}{2}\lambda_4^m \\ &\leq\lambda^m+(n-1)\lambda_2^m+\left((n-1)^2-n\right)\lambda^{2m}. \tag*{(26)} \end{aligned}

where the last inequality follows from 0≤λ4=1−2/n≤(1−1/n)2=λ20\leq\lambda_4=1-2/n\leq(1-1/n)^2=\lambda^2. Recalling that ERF=(n−1)λm\mathbb{E}_{R}F=(n-1)\lambda^m (Lemma 2.4), we have

Var⁡RF≤λm+(n−1)λ2m−nλ2m≤λm+(n−1)λ2m.\operatorname{Var}_{R}F\leq\lambda^m+(n-1)\lambda_2^m-n\lambda^{2m}\leq\lambda^m+(n-1)\lambda_2^m.

The variance of FF under RR can also be bounded without determining the full operator spectrum. One approach is to write FF as a sum of nn random variables using Equation (17) and compute their pairwise covariances. For m=2nlog⁡n+O(n)m=2n\log n+O(n), the total covariance contribution is lower order than the sum of the individual variances. We use the spectral argument because, although less elementary, it makes the structure of the second moment more transparent.

The lower bound and the cutoff window

The moment estimates now give the lower bound by Chebyshev’s inequality.

Theorem 2.8 (Explicit lower bound). For n≥4n \ge4 and m≥0m \ge0, with λ\lambda and λ2\lambda_2 as in Lemma 2.6,

dn(m)≥[1−8(n−1)2λm−4n−1(λ2λ2)m]+.(27)d_n(m) \ge\left[1-\frac{8}{(n-1)^2\lambda^m}-\frac{4}{n-1}\left(\frac{\lambda_2}{\lambda^2}\right)^m\right]_+. \tag*{(27)}

Proof. Write s=(n−1)λm>0s=(n-1)\lambda^m>0 for the mean under the realized distribution. The ideal mean is zero, so we distinguish the two experiments using {F≥s/2}\{F \ge s/2\}. Chebyshev’s inequality, Lemma 2.4, and Proposition 2.7 give

dn(m)≥1−PR(F<s/2)−PI(F≥s/2)≥1−4(λm+(n−1)λ2m)(n−1)2λ2m−4λm(n−1)2λ2m=1−8(n−1)2λm−4n−1(λ2λ2)m.\begin{aligned} d_n(m) &\ge1-\mathbb{P}_{\mathrm{R}}(F<s/2)-\mathbb{P}_{\mathrm{I}}(F\ge s/2)\\ &\ge1-\frac{4(\lambda^m+(n-1)\lambda_2^m)}{(n-1)^2\lambda^{2m}}-\frac{4\lambda^m}{(n-1)^2\lambda^{2m}}\\ &=1-\frac{8}{(n-1)^2\lambda^m}-\frac{4}{n-1}\left(\frac{\lambda_2}{\lambda^2}\right)^m. \end{aligned}

Taking the positive part is valid because TV distance is nonnegative.

Proof of Theorem 1.1. Write c=m/n−2log⁡nc=m/n-2\log n. Suppose first that c<0c<0, and put ρm=((n−1)2λm)−1\rho_m=((n-1)^2\lambda^m)^{-1}. Convexity gives λ2≤λ3/2\lambda_2\le\lambda^{3/2}, so Theorem 2.8 yields

1−dn(m)≤8ρm+4ρm.1-d_n(m)\le8\rho_m+4\sqrt{\rho_m}.

Using −log⁡λ≤1/n+1/[2n(n−1)]-\log\lambda\le1/n+1/[2n(n-1)] and log⁡(n/(n−1))≤1/(n−1)\log(n/(n-1))\le1/(n-1), we obtain

log⁡ρm≤c+log⁡n+2n−1≤c+log⁡2(n≥10).\log\rho_m\le c+\frac{\log n+2}{n-1}\le c+\log2\qquad(n\ge10).

Set z=ec/2z=e^{c/2}. If z≥1/8z\ge1/8, (1.5) is trivial. Otherwise,

1−dn(m)≤16z2+42 z≤(2+42)z<8z,1-d_n(m)\le16z^2+4\sqrt{2}\,z\le(2+4\sqrt{2})z<8z,

proving the left-hand bound.

If c≥4c\ge4, Proposition 2.2 gives dn(m)≤(e2/2)e−c/2≤8e−c/2d_n(m)\le(e^2/2)e^{-c/2}\le8e^{-c/2}. For 0<c<40<c<4, the same bound follows from dn(m)≤1<8e−c/2d_n(m)\le1<8e^{-c/2}. This proves (1.6). Finally, monotonicity of dnd_n and these two bounds place each fixed-error mixing time within Oε(n)O_\varepsilon(n) of 2nlog⁡n2n\log n, proving (1.4).

The test function can be computed from the schedule and the candidate permutation. Starting from the identity matrix, form MTM_T by averaging the corresponding rows, and then evaluate (2.11), aggregating single-card biases across the entire deck.

A shallow public switching network

We now apply the mixing bound to parallel switching networks. Sample a schedule of a Monte shuffle. Form a directed dependency graph where two switches are connected if they share an endpoint; the arc goes in the direction of their order in the schedule. Switches that are not logically dependent can be executed in parallel.

Write HmH_m for the number of parallel layers, equivalently the maximum number of switches on a directed dependency path. This is a random variable determined by the public schedule. Czumaj and Lingas [2] show that for m=Ω(nlog⁡n)m = \Omega(n \log n) independent uniform distinct-pair interactions, the depth is O(m/n)O(m/n) in expectation and with high probability. Their path-counting estimate supplies the constants below. It also applies to our with-replacement schedule: replacing every public null step by a fresh uniform distinct pair gives their model, and deleting those replacements cannot increase depth.

Corollary 3.1 (A shallow public switching network). Let n≥10n \ge10, 0<ε≤1/20 < \varepsilon\le1/2, and 0<δ<10 < \delta< 1. Sampling a public schedule of length

m=⌈2n(log⁡n+2+log⁡12ε+12log⁡2δ)⌉(28)m = \left\lceil2n\left(\log n + 2 + \log\frac{1}{2\varepsilon} + \frac{1}{2}\log\frac{2}{\delta}\right)\right\rceil \tag*{(28)}

and parallelizing its nonnull switches yields, with probability at least 1−δ1-\delta, a network with conditional TV error at most ε\varepsilon, at most mm switches, and depth at most

⌈max⁡{16emn,log⁡22nδ}⌉(29)\left\lceil\max\left\{\frac{16em}{n},\log_2\frac{2n}{\delta}\right\}\right\rceil \tag*{(29)}

For fixed ε\varepsilon, δ\delta, these bounds are 2nlog⁡n+Oε,δ(n)2n\log n + O_{\varepsilon,\delta}(n) switches and 32elog⁡n+Oε,δ(1)32e\log n + O_{\varepsilon,\delta}(1) layers.

Proof. Equation (13) bounds the mixing failure probability by δ/2\delta/2. To complete the union bound, let kk be the ceiling in (29). The path-counting estimate of Czumaj and Lingas [2 Section 4], with k!≥(k/e)kk! \ge(k/e)^k, gives

P(Hm≥k)≤n(8m/n)kk!≤n(8emnk)k≤n2−k≤δ2.\mathbb{P}(H_m \ge k) \le\frac{n(8m/n)^k}{k!} \le n\left(\frac{8em}{nk}\right)^k \le n2^{-k} \le\frac{\delta}{2}.

References

References

  1. [2]Artur Czumaj and Andrzej Lingas. On parallel time in population protocols. Information Processing Letters, 179:106314, 2023. doi:10.1016/j.ipl.2022.106314.DOI
  2. [3]Artur Czumaj. Random permutations using switching networks. In Proceedings of the 47th Annual ACM Symposium on Theory of Computing (STOC), pages 703–712, 2015. doi:10.1145/2746539.2746629.DOI
  3. [4]Wei Dai, Viet Tung Hoang, and Stefano Tessaro. Information-theoretic indistinguishability via the chi-squared method. In Advances in Cryptology—CRYPTO 2017, Part III, volume 10403 of Lecture Notes in Computer Science, pages 497–523. Springer, 2017. doi:10.1007/978-3-319-63697-9_17.
  4. [5]Persi Diaconis and Mehrdad Shahshahani. Generating a random permutation with random transpositions. Zeitschrift für Wahrscheinlichkeitstheorie und Verwandte Gebiete, 57:159–179, 1981. doi:10.1007/BF00535487.DOI
  5. [6]William Fulton and Joe Harris. Representation Theory: A First Course, volume 129 of Graduate Texts in Mathematics. Springer-Verlag, 1991. doi:10.1007/978-1-4612-0979-9.DOI
  6. [7]Murali K. Ganapathy. Robust mixing. Electronic Journal of Probability, 12:262–299, 2007. doi:10.1214/EJP.v12-398.DOI
  7. [8]Oded Goldreich and Rafail Ostrovsky. Software protection and simulation on oblivious RAMs. J. ACM, 43(3):431–473, May 1996.
  8. [9]Viet Tung Hoang, Ben Morris, and Phillip Rogaway. An enciphering scheme based on a card shuffle. In Advances in Cryptology—CRYPTO 2012, volume 7417 of Lecture Notes in Computer Science, pages 1–13. Springer, 2012. arXiv:1208.1176, doi:10.1007/978-3-642-32009-5_1.
  9. [10]Yunjiang Jiang. A subquadratic upper bound for the mixing time of the Thorp shuffle, 2026. arXiv:2610.18884.
  10. [11]Nam-Su Jho and Jooyoung Lee. Partition and Mix: Generalizing the Swap-or-Not shuffle. Designs, Codes and Cryptography, 91:2237–2254, 2023. doi:10.1007/s10623-023-01199-4.
  11. [12]Vishesh Jain and Mehtaab Sawhney. Hitting time mixing for the random transposition walk. Probability Theory and Related Fields, 196:1697–1722, 2026. arXiv:2410.23944, doi:10.1007/s00440-026-01479-9.
  12. [13]Ben Morris. The mixing time of the Thorp shuffle. SIAM Journal on Computing, 38(2):484–504, 2008. arXiv:math/0507307, doi:10.1137/050636231.DOI
  13. [14]Ben Morris. Improved mixing time bounds for the Thorp shuffle and L-reversal chain. The Annals of Probability, 37(2):453–477, 2009. doi:10.1214/08-AOP409.
  14. [15]Ben Morris. Improved mixing time bounds for the Thorp shuffle. Combinatorics, Probability and Computing, 22(1):118–132, 2013. doi:10.1017/S0963548312000478.
  15. [16]Elchanan Mossel, Yuval Peres, and Alistair Sinclair. Shuffling by semi-random transpositions. In Proceedings of the 45th Annual IEEE Symposium on Foundations of Computer Science (FOCS), pages 572–581, 2004. arXiv:math/0404438, doi:10.1109/FOCS.2004.60.DOI
  16. [17]Ben Morris and Phillip Rogaway. Sometimes-recurse shuffle: Almost-random permutations in logarithmic expected time. In Advances in Cryptology—EUROCRYPT 2014, volume 8441 of Lecture Notes in Computer Science, pages 311–326. Springer, 2014. doi:10.1007/978-3-642-55220-5_18.
  17. [18]Ravi Montenegro and Prasad Tetali. Mathematical aspects of mixing times in Markov chains. Foundations and Trends in Theoretical Computer Science, 1(3):237–354, 2006. doi:10.1561/0400000003.
  18. [19]OpenAI. Optimal-order mixing of the Thorp shuffle. OpenAI Math Release preprint, September 26 2026. URL: https://github.com/openai/math/blob/main/preprints/Optimal-order-mixing-of-the-Thorp-shuffle-September-26-2026/paper.pdf.hub.valency.io/works/W_b99ez7mr
  19. [20]Thomas Ristenpart and Scott Yilek. The Mix-and-Cut shuffle: Small-domain encryption secure against N queries. In Advances in Cryptology—CRYPTO 2013, Part I, volume 8042 of Lecture Notes in Computer Science, pages 392–409. Springer, 2013. doi:10.1007/978–3–642–40041–4_22.DOI
  20. [21]Laurent Saloff-Coste and J. Zuñiga. Convergence of some time inhomogeneous Markov chains via spectral techniques. Stochastic Processes and their Applications, 117(8):961–979, 2007. doi:10.1016/j.spa.2006.11.004.
  21. [22]Laurent Saloff-Coste and J. Zuñiga. Refined estimates for some basic random walks on the symmetric and alternating groups. ALEA. Latin American J. of Probability and Mathematical Statistics, 4:359–392, 2008.
  22. [23]Lucas Teyssier. Limit profile for random transpositions. The Annals of Probability, 48(5):2323–2343, 2020. arXiv:1905.08514, doi:10.1214/20-AOP1424.DOI
  23. [24]Edward O. Thorp. Nonrandom shuffling with applications to the game of Faro. Journal of the American Statistical Association, 68(344):842–847, 1973. doi:10.1080/01621459.1973.10481434.DOI
  24. [25]Graham White. A strong stationary time for random transpositions, 2019. arXiv:1910.00770.arxiv.org/abs/1910.00770

Paper details

vlnc:W_56ewnx9f
v1 · latestHistory (1)

published · Fresh — added to the Hub within the last 30 days

added ·

Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

CC BY 4.0

Original source

  • Computer Science

GPT-6 Astra · View statement →

Looking for related papers…
Contents