For six block counts in every 144, a fixed order can pass a three-entry shuffle test
Why it matters
One way to test whether a list looks shuffled is to pick three entries and see whether their six possible orders occur equally often. Even with the blocks in a fixed order, shuffling inside each block can make the list pass this test as the blocks grow. We proved this for every block count in a repeating pattern: exactly six counts out of every 144 work.
One way to test a shuffle is to pick three entries, read them from left to right and see how often each of their six possible orders occurs. In a uniform shuffle all six are equally likely. Could the test give the same result if whole blocks stay in a fixed order and only their contents are shuffled? Previous work ruled out most block counts and found examples that pass, but left open which of the remaining counts work.
We prove that every count allowed by the arithmetic works. For exactly six block counts in every 144, there is a fixed order for which all six triple frequencies approach 1/6 as the blocks grow. The number of blocks leaves remainder 0, 1, 17, 64, 80 or 81 when divided by 144. This settles a conjecture of Khovanova and Zhang [2]. At every such length, the fixed order can even have a plot that looks the same after a quarter-turn.
How blocks affect the test
A permutation lists the ranks 1,\ldots,n in some order. A triple consists of entries at three distinct positions. Its order records their relative ranks: for instance, 5,9,2 has order 231 because the middle rank comes first, the largest second and the smallest last. The frequency of an order is the fraction of all triples that give it.
To enlarge a fixed permutation, called the seed, replace each entry with a block of b consecutive ranks. A higher seed entry gets a block whose ranks all exceed those of a lower entry's block. Shuffle the ranks within a block using a uniformly random permutation of length b, and use a copy of that same permutation in every block. This is random inflation. A seed is 3-inflatable if, with probability one, all six triple frequencies tend to 1/6 as b grows.
The test on the enlarged permutation translates into exact counts in the seed. In the large-block limit, drawing three entries gives three independent, uniformly distributed block labels before the entries are sorted by position. If all triple orders are equally frequent, a randomly chosen pair must be increasing half the time. A pair drawn within one block already has that probability. For pairs drawn from distinct blocks, the seed determines the order, so half its pairs must also be increasing. The required count for each pair order is therefore M=\binom n2/2, where \binom nr counts the ways to choose r of n positions.
Now consider a particular triple order, and let C be its count in the seed. There are n^3 equally likely ways to draw three block labels. The contribution to the triple frequency depends on how many labels are distinct.
Three distinct blocks. Each occurrence in the seed accounts for six draws, one for each way to draw its labels. Together these contribute 6C/n^3.
Two distinct blocks. For the order 123, both blocks must form an increasing pair. Either block can supply the repeated label. For 132, the pair must again increase, but only the higher block can repeat. In general there are k=2 choices for which block repeats for a monotone order (increasing or decreasing), and k=1 for each other order. There are M seed pairs of the required order, three placements of the repeated label in the draw, and probability 1/2 that its entries have the required internal order.
One block. There are n choices of label, and each order has limiting probability 1/6 within that block.
Adding these contributions gives the limiting frequency
These counts must be integers. That requirement gives the six possible remainders above [2, Lemma 15]. Length one works directly; length two cannot balance its pairs. Khovanova and Zhang found examples at lengths 17, 64, 80, 81, 144 and 145 and showed that the product of two lengths that work also works. This gave infinitely many examples but left gaps, including 161. Their Conjecture 18 says that every length with one of the six remainders works.
A quarter-turn reduces six counts to one
Plot each seed entry as a point with position on the horizontal axis and rank on the vertical axis. A 90-degree rotation turns an increasing pair into a decreasing pair. It exchanges the orders 123 and 321 and cycles through the other four triple orders. If the rotation leaves the whole plot unchanged, the two pair counts must be equal. The two monotone triple counts must also match, as must the other four counts. It is enough, then, to build a plot with this symmetry and exactly T increasing triples: every triple belongs to one of the six orders, and 2T+4S=\binom n3.

Figure 1. A seed of length 80. In the leftmost square, the points descend in runs of 4, 7 and 9. Each run lies above the preceding one. Rotating this square gives the other three. The seed has 13,430 triples of each monotone order and 13,825 of each other order. After random inflation all six frequencies tend to the same value.
To build such a plot, divide n by four and write n=4m+e. The six permitted remainders ensure that e is either 0 or 1. Each square will hold m points, with a point at the center if e=1. Choose a permutation \sigma of length m to determine the order within the leftmost square. Number both positions and ranks from zero and plot the points (i,m+\sigma(i)) for 0\le i<m. Add the three successive rotations of these points using the quarter-turn R(x,y)=(n-1-y,x). The four squares use disjoint intervals on each axis. For odd n, only the center coordinate remains on either axis; add the point (2m,2m). Beniamini, Lavee and Linial [3] used this geometry to make all six counts equal before inflation. Here the inflated plot must have equal frequencies, so the seed needs the two distinct counts T and S. For lengths from 400,000 onward we choose the order within the first square by a single rule. For the shorter lengths we verify explicit seeds.
To choose the order within the first square, we need to know how it affects the count in the full plot. Let A be the number of increasing pairs in \sigma, and U its number of nonmonotone triples. The number of increasing triples in the full plot is
For triples that cross between squares, read the heights of the four squares from left to right. Their order is 2413. No three squares are in increasing order. The first and last squares each have two partners with which they form an increasing pair of squares. Each of these outer squares offers A increasing pairs to go with any of the m points in a partner. The other two squares each have one partner and offer \binom m2-A pairs. This accounts for the second term, as in [3, Lemma 3.6] for even lengths.
The last term applies only at odd lengths. An increasing triple containing the center uses two points southwest of it, two northeast, or one in each square. These choices contribute 2A+m^2.
Adjusting the increasing-triple count
Start with all m points in the first square in increasing order. The full plot then has the following number of increasing triples:
Within the first square, divide \sigma into consecutive groups of positions. Give each group higher ranks than its predecessor, as in Figure 1. We use these inner blocks to adjust the triple count in known amounts. Suppose one block of length j has I inversions (decreasing pairs) and u nonmonotone triples of its own. It removes I from A and contributes u+(m-j)I to U: any one of the m-j outside points makes a nonmonotone triple with an inversion in the block. No other triple crossing blocks is nonmonotone. Thus this block contributes (2m+e-j)I+u to the reduction D, and the contributions add.
In a descending run of length j, all \binom j2 pairs are inversions and all triples are monotone. Writing H=2m+e-2, its contribution is
Why the corrections fit at every large length
For m\ge100{,}000, we can reach the exact reduction D in two steps. One long descending run supplies most of it. Shorter blocks supply the rest. The long run must leave both a large enough reduction for those corrections to work and enough positions to hold the blocks.
Let a be the largest run length at most m with c(a)\le D. Stop one point short, at length L=a-1. This leaves more than 0.3m positions free and a remaining reduction d=D-c(L), by the following bounds:
A run of length 48 supplies 46 units of discount per inversion, since 3\binom j3=(j-2)\binom j2. We use this run as a reference: if every correction run had this length, each inversion would supply h=H-46 units of reduction. Choose a total of
Choose t\in\{0,1,2\} so 2t\equiv HP-d\pmod 3, and use t copies of 2413. The descending runs must now supply a total of
This choice meets the discount target. Two checks remain: can we complete the inversion count with descending pairs, which carry no discount, and can all the blocks fit in m positions?
For the first check, compare the inversions in each run with the number it would take to supply the same internal triples using runs of length 48. A 48-run uses exactly 3/46 inversions per internal triple; every smaller run uses more. Write the total inversion count of the runs as 3Q/46+E. The excess E is bounded by all the inversions in the runs of length below 48. After allocating runs of a given length, too few triples remain for another run of that length. Thus the counts of runs of lengths (24,12,6,3) are at most (8,9,10,19) respectively. Together these use at most 3,009 inversions and 417 positions. The remaining inversion count is therefore
Second, the r descending pairs and all earlier blocks must fit in the inner permutation. Since the inversion budget holds, the 48-runs occupy at most 2P/47 positions: each uses \binom{48}2 inversions in 48 positions. Adding the leading run, the special blocks, the 48-runs, the smaller runs and the final pairs uses fewer than
Exact verification below 400,000
For each of the 16,667 permitted positive lengths below 400,000, the list of seeds gives an explicit example. Each example serves as a certificate: its counts can be checked without searching for a permutation. Each line gives the length and either the full seed or a list of inner blocks with multiplicities. D followed by a number denotes a descending run of that length; other digits give a block in rank order. A colon precedes the multiplicity. The list is sorted by block type, but the blocks can be placed in any order provided each uses higher ranks than all preceding blocks. Their contributions add, so reordering them preserves the required count. The two full seeds are marked with an exclamation point and use letters for ranks above nine.
We verified the certificates independently of the reduction formula. For each inner block we selected one, two or three positions at a time and counted how often each relative order occurred. When we combined blocks, selections lying entirely in one block kept their order. For two occupied blocks we multiplied the local counts and read the order from the relative heights of the blocks. Three occupied blocks contribute the product of their lengths to their own triple order. We combined the inner blocks this way, rotated the resulting counts and combined the four squares, including the center at odd lengths. For the two seeds given in full, we checked rotation directly. Every certificate met the required counts, and the list of lengths agreed exactly with the list obtained by testing the integer divisibilities. As a check on this counting method, we expanded all 27 seeds through length 640 and enumerated their pairs and triples individually.
Length one is immediate. The seed at length 17 is (4,12,13,17,3,2,10,7,9,11,8,16,15,1,5,6,14) from the Khovanova–Zhang archive. Table 1 gives examples of the block lists, including cases that use blocks other than descending runs and 2413.
Table 1. Inner permutations for seven finite certificates. Place the additional block first, then the indicated descending runs, each on ranks higher than all preceding blocks. A parenthesis gives the number of copies.
| Seed length | Additional block | Descending run lengths |
|---|---|---|
| 64 | 87531246 | 7, 1 |
| 81 | 7531264 | 11, 2 |
| 144 | 7642153 | 21, 4, 2 (×2) |
| 161 | 87543216 | 24, 2, 1 (×6) |
| 224 | 53124 | 35, 4, 2, 1 (×10) |
| 225 | 641352 | 35, 4, 2, 1 (×9) |
| 640 | none | 78, 55, 4, 3 (×3), 1 (×14) |
Together the verified seeds and the construction cover every positive length that passes divisibility. At each one, the three-entry test can miss a fixed block order even when the seed has quarter-turn symmetry.
Using four entries changes what the test can detect. Král’ and Pikhurko [1] proved that uniform limiting frequencies for all four-entry orders force quasirandomness. In particular, when both axes of the plot are scaled to the unit interval, the limiting fraction of points in each rectangle must equal its area. For a seed of length greater than one, the first block occupies only one of the n rank intervals. Pair its position interval with any other rank interval and the resulting rectangle has area 1/n^2 but contains no points. Triples are therefore the last case in which an inflation of such a seed can pass.
References
- D. Král’ and O. Pikhurko (2013). Quasirandom permutations are characterized by 4-point densities. Geometric and Functional Analysis.
- T. Khovanova and E. Zhang (2021). Limit densities of patterns in permutation inflations. Electronic Journal of Combinatorics.
- G. Beniamini, N. Lavee and N. Linial (2025). How balanced can permutations be?. Combinatorica.