Algebra

Two random shuffles reach every shuffle

Pick two ways of rearranging n letters at random and allow them to be repeated in any order. Almost always the two together reach every rearrangement there is, or every even one — and when they fail, the usual reason is a coincidence about a single letter that both happen to leave alone. Eugen Netto guessed it in 1882 and John Dixon proved it in 1969.

Worth reading first: Five-eighths of the pairs, and no more · The blocks a subgroup cuts out.

Two random symmetries commute at most five times in eight, and for the rearrangements of many letters almost never. That was a question about how two elements of a group get along with each other. Here is a question about what two elements can do together.

Take two rearrangements of nn letters, aa and bb, chosen at random, and allow them to be used as often as wanted in any order: aa, then bb, then aa twice, then bb backwards, and so on. Every rearrangement that can be produced this way is said to be generated by aa and bb, and together they form a group, the subgroup that aa and bb generate. The question is how big it is. Can two arbitrary moves, chosen with no plan, shuffle the letters into every order there is?

The answer is that they almost always can, or nearly. Eugen Netto conjectured in 1882 that two random rearrangements generate either every rearrangement or exactly the even ones with probability tending to one as nn grows, and John Dixon proved it in 1969. The failures, when they happen, have a dull and specific cause, and it is the cause that makes the theorem easy to believe and hard to prove.

Four letters, every pair

The rearrangements of four letters are few enough to test every pair.

Every pair of rearrangements of four letters, and what the two generate. A 24 by 24 grid of ordered pairs of permutations of four letters: 216 generate S4, 96 generate A4, 264 generate a smaller subgroup.
Fig. 1 The 24 rearrangements of four letters down the side and across the top, grouped by their cycle lengths — the identity, the six swaps, the three double swaps, the eight 3-cycles and the six 4-cycles — and each of the 576 ordered pairs shaded by what the two generate together: everything (216), exactly the even rearrangements (96), or something smaller (264).

The pattern has structure. Pairs involving the identity generate only what the other element generates on its own — a cycle, never the whole group — so the top row and left column are pale. Two 3-cycles never leave the even rearrangements, so the block of 3-cycles against 3-cycles is cool where it is not pale: two 3-cycles that move different triples of letters generate all twelve even rearrangements, and two that are powers of each other generate only a cycle of three. The whole group appears only when at least one of the pair is odd, and then often but not always: a swap and a 4-cycle generate everything if the swap is not across the cycle’s diagonal, and only the eight symmetries of a square if it is — the same group whose commuting pairs counted five-eighths.

Two hundred and sixteen pairs of 576 reach everything: exactly three-eighths. Another ninety-six reach the twelve even rearrangements. Together that is 0.542 — not overwhelming. Four letters is too few for the theorem to be visible, because the group of 24 has thirty subgroups to fall into and a random pair lands in a small one often.

Counting every pair up to six letters

The same count can be done for a few more sizes before the pairs become too many.

How often two random rearrangements reach everything, counted exactly. n = 2: S 3/4, A 0/4; n = 3: S 18/36, A 8/36; n = 4: S 216/576, A 96/576; n = 5: S 6840/14400, A 2280/14400; n = 6: S 228960/518400, A 76320/518400.
Fig. 2 For two rearrangements chosen uniformly from all rearrangements of n letters, the exact chance that they generate every rearrangement (warm, number inside) or exactly the even ones (cool), counted over all 4, 36, 576, 14,400 and 518,400 ordered pairs.

The share reaching at least the even rearrangements dips at four letters and recovers: 0.722 at three, 0.542 at four, 0.633 at five, 0.589 at six. Five letters is better than four because the even rearrangements of five letters form a simple group, the rotations of the icosahedron, which has few subgroups compared with its size; the group of four letters has the even rearrangements of four letters inside it, which is not simple, and a normal subgroup of order four inside that, and every one of those subgroups is a trap.

From five letters on there is a second regularity. The cool share is almost exactly a third of the warm share. That has a two-line reason, and it is the first half of the theorem’s shape.

The quarter that parity takes

Every rearrangement is either even or odd — a product of an even or an odd number of swaps — and the parity is a fixed property, the one invariant that survives every way of writing a rearrangement down. Composing two even rearrangements gives an even one. So if aa and bb are both even, everything they generate is even, and the most they can reach is the even half of the group. If either is odd, what they generate contains odd elements and cannot be confined to the even half.

Each of aa and bb is even with probability one half, independently, so both are even one time in four. That splits the theorem in two: as nn grows, two random rearrangements generate every rearrangement with probability tending to 34\tfrac34, and exactly the even ones with probability tending to 14\tfrac14. The exact counts already show it at six letters: 228,960 pairs reach everything and 76,320 reach the even half, a ratio of exactly three. The question that remains is only whether the pair reaches at least the even half, and the parity of the pair then says which.

Thirty letters, sampled

Past six letters every pair cannot be checked. Instead pairs can be drawn at random and each tested — and the test needs care, because computing the group two permutations of thirty letters generate by listing its elements is impossible: there are 30!/230!/2 of them if the answer is yes.

Dixon's theorem: two random rearrangements almost always reach everything. n = 3: 0.722; n = 4: 0.542; n = 5: 0.633; n = 6: 0.589; n = 7: 0.795; n = 8: 0.810; n = 9: 0.869; n = 10: 0.881; n = 12: 0.906; n = 14: 0.913; n = 16: 0.927; n = 20: 0.948; n = 24: 0.953; n = 30: 0.966.
Fig. 3 The chance that two random rearrangements of n letters generate all of them or all the even ones: exact up to six letters (filled), estimated from 3,000 random pairs at each n from seven to thirty (rings, with two-standard-error bars), beside 1 − 1/n − 1/n² − 4/n³ (line).

The share climbs steadily: 0.795 at seven letters, 0.881 at ten, 0.948 at twenty, 0.966 at thirty. From about nine letters on the points sit on the curve 1−1/n−1/n2−4/n31 - 1/n - 1/n^2 - 4/n^3, which is the beginning of an expansion Dixon established in 2005, refining his own theorem: the chance of failure is 1/n1/n plus smaller terms. At thirty letters 1/n1/n is 0.033, and the measured failure rate is 0.034.

The test behind the rings is the interesting part, and it is one-sided in a useful way. Three properties are checked in turn. First, whether the two permutations between them move every letter to every other — whether the group is transitive. Second, whether they preserve no system of blocks — no way of grouping the letters into equal clusters that every move keeps intact — which makes the group primitive. Third, whether some product of them, raised to a suitable power, is a single cycle of prime length at most n−3n - 3. If all three hold, a theorem of Camille Jordan from 1873 says the group contains every even rearrangement, and the test has proved it without listing anything.

One word that certifies a pair

Jordan’s theorem turns an impossible enumeration into a search for one short product.

One word that certifies a random pair reaches everything. For a random pair of permutations of 12 points, the word b has cycle type 7,2,2,1 and its power 2 is a 7-cycle.
Fig. 4 Two rearrangements a and b of twelve letters drawn at random. A short word in them gives a permutation with cycles of lengths 7, 2 and 2 (left); raised to the power 2 it becomes a single 7-cycle (right), because the 2-cycles vanish and the 7-cycle survives. Together with transitivity and primitivity, that single cycle forces every even rearrangement into the group.

Raising a permutation to a power that is a multiple of every other cycle length, but not of the chosen prime pp, kills every other cycle and leaves a single pp-cycle. Random permutations have a cycle of prime length with no other cycle of that length surprisingly often — a random permutation’s cycle lengths behave like independent counts with means 1, ½, ⅓, … — so a handful of random products almost always supplies one. In the run behind the figures, every transitive, primitive pair of fourteen letters or more produced a witness within a few hundred products; at nine to twelve letters a handful did not, and each of those was settled by computing its group directly — they were the genuine exceptions described below.

The theorem behind the witness is a statement about how primitive groups can contain small pieces. A primitive group is “glued together”: no clusters, every letter reachable from every other. Jordan showed that such a group cannot contain a short prime cycle without containing them all, and the three-cycles generate the even rearrangements. The witness is a local fact — one cycle — that a global property turns into a statement about the whole group.

Why the failures fail

The second half of the theorem is the shape of the failures, and they have three possible causes.

Why two random rearrangements fail to reach everything. n = 7: fail 0.205, shared fixed letter 0.142, blocks 0.000; n = 8: fail 0.190, shared fixed letter 0.112, blocks 0.025; n = 9: fail 0.131, shared fixed letter 0.101, blocks 0.003; n = 10: fail 0.119, shared fixed letter 0.089, blocks 0.008; n = 12: fail 0.094, shared fixed letter 0.076, blocks 0.001; n = 14: fail 0.087, shared fixed letter 0.077, blocks 0.000; n = 16: fail 0.073, shared fixed letter 0.064, blocks 0.000; n = 20: fail 0.052, shared fixed letter 0.048, blocks 0.000; n = 24: fail 0.047, shared fixed letter 0.043, blocks 0.000; n = 30: fail 0.034, shared fixed letter 0.032, blocks 0.000.
Fig. 5 For each n from seven to thirty, the share of 3,000 random pairs that fail to reach at least the even rearrangements, split by reason: the letters fall into two or more groups that never mix — within that, the case where one letter is fixed by both — or they move as one group but in fixed blocks, or neither, and the pair still lands in a proper group. The dashed curve is 1/n.

The commonest cause by far is the plainest. If some letter is left in place by both aa and bb, then nothing they generate moves it, and the group is stuck inside the rearrangements of the other n−1n - 1 letters. Each permutation fixes a given letter with chance 1/n1/n, so both fix it with chance 1/n21/n^2, and there are nn letters: the expected number of shared fixed letters is 1/n1/n, and the chance of at least one is very nearly that. From twelve letters on, a shared fixed letter accounts for most of every failure, and the dashed curve 1/n1/n is the failure rate almost exactly.

Other intransitive pairs split the letters into a larger orbit and a smaller one in some other way — a shared pair of letters swapped between themselves by both, for instance — and those are rarer by a further factor of nn. Pairs that are transitive but keep blocks are rarer still: at eight letters, about one pair in forty keeps the letters in two blocks of four or four blocks of two; at fourteen and sixteen letters one pair in 3,000 did, and from twenty letters none. The third cause is the one the group theory was always about: a primitive group that is not the whole thing. At seven letters there are three of them that a random pair can land in — of orders 21, 42 and 168, the last being the symmetries of the seven-point plane — and they catch about three pairs in a hundred. At eight letters about as many pairs are caught, at nine letters thirteen in 3,000, at twelve letters one, and from fourteen letters none.

So the failures are local accidents, not structural traps. That is the content of Dixon’s theorem, and the reason a careful proof is still hard: it has to show that the third cause — landing in some primitive group other than the obvious ones — is negligible for every nn, and that requires knowing that primitive groups other than SnS_n and AnA_n are small. Dixon’s original argument used older bounds on how large such groups can be. Later sharpenings, including the expansion drawn above, used the classification of finite simple groups, which makes the list of primitive groups explicit.

Adding up the traps

The 1/n1/n can be derived rather than observed, and the derivation is the skeleton of Dixon’s proof. Two elements fail to generate a group exactly when both lie in some maximal subgroup — a proper subgroup with nothing between it and the whole group. For a particular subgroup MM, the chance that two random elements both land in it is (∣M∣/∣G∣)2(|M|/|G|)^2, the square of one over its index. Adding over every maximal subgroup gives an upper bound on the chance of failure, and for large groups the bound is close to the truth, because two different maximal subgroups rarely both contain a random pair.

For four letters the bound can be written out. The maximal subgroups of the 24 rearrangements are the even half (one of them, index 2), the rearrangements fixing one letter (four of them, index 4) and the symmetries of a square on the four letters (three, index 3). The bound is 1⋅14+4⋅116+3⋅19=0.831 \cdot \tfrac14 + 4 \cdot \tfrac1{16} + 3 \cdot \tfrac19 = 0.83, against a true failure rate to reach everything of 1−0.375=0.6251 - 0.375 = 0.625: an overestimate, because a pair lying in two maximal subgroups at once — two of the double swaps, for instance, which lie in the even half and in a square’s symmetries — has been counted twice.

For nn letters, set the even half aside — it is the parity quarter already accounted for — and look at the rest. The subgroups fixing one letter are nn in number, each of index nn, and contribute n⋅1/n2=1/nn \cdot 1/n^2 = 1/n. That is the whole leading term. The subgroups that keep two letters among themselves have index (n2)\binom n2 and number (n2)\binom n2, contributing about 2/n22/n^2; the block systems have indices that grow faster than any power of nn; and the primitive maximal subgroups, by the theorems on how small such groups must be, contribute less than any power of 1/n1/n. So the chance of failure is 1/n1/n plus terms of order 1/n21/n^2 — the curve the samples follow — and the whole difficulty of the proof sits in that last clause about primitive groups, which a picture can only illustrate by showing them disappearing.

What two moves cannot share

A shuffled deck is the familiar setting. Two particular shuffles — a cut and a riffle, say — will usually generate every arrangement of the cards; the walk that repeats random shuffles is about how quickly a random product of them spreads over the group, and that question presupposes this one. The puzzles that are exactly half solvable are the parity half of the theorem made concrete: moves that are all even can never reach an odd arrangement, however many are combined, and that is the whole of their obstruction.

The theorem also says something about the rotations of a cube and other symmetry groups, by contrast. Those groups are tiny — twenty-four elements — and are generated by two well-chosen moves, but two random elements of them often fail to generate, because a small group has proportionately many small subgroups. Large symmetric groups are the opposite: they have relatively few subgroups for their size, and almost every pair escapes all of them.

Three thousand pairs stand in for all of them

The exact counts up to six letters are complete, and every share in the first two figures is a count of every pair. Beyond six letters the shares are estimates from 3,000 pairs at each size, with sampling errors of about half a per cent; the theorem is that the true values tend to one, and no finite sample shows a limit.

The classification of each sampled pair is rigorous in one direction. When the test says a pair reaches at least the even rearrangements, it has proved it, by Jordan’s theorem at nine letters or more and by computing the group outright or by Bochert’s bound on primitive groups below that. When it says a pair fails, the reason it gives — two orbits, a block system, or a small primitive group closed and measured — is also a proof. The single pair of twelve letters that resisted the witness search was settled by computing its group outright: it stopped short of 100,000 elements, below the largest primitive group of degree twelve that falls short of the even rearrangements, so it is one of those small primitive groups and is counted as a failure. Nothing in the figures rests on a guess about what a pair generates.

What the figures cannot show is the expansion’s later terms. The curve 1−1/n−1/n2−4/n31 - 1/n - 1/n^2 - 4/n^3 fits from nine letters, and at those sizes the next term is a fraction of a per cent — smaller than the sampling error. The coefficients beyond it are known from theory, not from anything drawn here.

Still open: how fast the rest of the group comes along

For the symmetric groups the question is closed in its first form: two random elements generate, and the failure rate is 1/n1/n to first order. The open questions are about other families and other counts. For every finite simple group, two random elements generate it with probability tending to one as the group grows — a theorem of Liebeck and Shalev and of Kantor and Lubotzky, from the 1990s, that again needs the classification — but how fast the probability tends to one, family by family, is understood only in part.

The question also has a converse shape: how many random elements are needed to generate a group that is not simple, such as a product of many copies of one group? There the answer is not “two”, and the number can jump without warning — Philip Hall’s computation for the icosahedral group is the classic case — and the expected number of random elements needed to generate a general finite group is bounded in terms of its structure in ways that are still being sharpened. Even for products of symmetric groups, the exact chance that two random elements generate is a sum over subgroups that nobody has evaluated in closed form.

A local accident, not a structural trap

Two randomly chosen moves are enough to reach every arrangement of nn letters, apart from the parity they jointly carry, with probability tending to one. The number that is left over, 1/n1/n, is almost entirely the chance that both moves happen to leave the same letter alone. Everything else that could stop them — orbits, blocks, the small primitive groups — fades faster than that.

The proof needs more than the picture. It needs to know that the large symmetric groups contain no large primitive subgroups beyond the obvious ones, and that knowledge is among the deepest facts about finite groups. But the figures show the phenomenon the proof explains: generation is the rule, the failures are coincidences about single letters, and a single prime cycle in a short word is enough to certify that two random moves reach everything.

What links here

Computed from the collection, not written here: the essays that point at this one.

Reads more easily once this is understood

Essays that name this one as worth reading first.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

Alternating groupCycleGenerating setParityPermutationProbabilitySubgroup