We use essential cookies to run the site (session, security, and your theme/language preferences). With your permission we also load embedded third-party content, such as YouTube videos. Cookie Policy
Barrington's Theorem
The surprising power of permuting just five elements
Author(s):Elier Rodríguez García
Index
Introduction
Imagine you are allowed to shuffle a deck of exactly five cards. At each step you peek at one bit of the input, then choose which shuffle to apply. After reading all the bits you check whether the deck ended up in the original order. How expressive can such a simple process be?
The answer — given by David A. Mix Barrington in 1989 — is stunning: this tiny model can compute every function that can be computed by efficient parallel circuits. It is proven (Barrington, 1989) that the class NC¹ (problems solvable by Boolean circuits of logarithmic depth and polynomial size) equals exactly the class of languages recognized by width-5 polynomial-length permutation branching programs.
Width 4 is too weak — four elements are not enough. Width 5 hits a sweet spot because the symmetric group S5 is non-solvable: it contains the alternating group A5, which is simple and non-abelian. That algebraic accident is the engine behind the entire theorem, and it connects everyday computation to deep abstract algebra.
Try It
The demo below runs a width-5 permutation branching program that evaluates the Boolean formula (x1∧x2)∨x3. Each row of the program reads one input bit and applies one of two permutations of {0,1,2,3,4}: the identity if the bit is 0, or a non-trivial permutation if the bit is 1.
Toggle the three input bits, then click Run program to watch the permutations compose step by step. The program accepts when the final composition is the identity permutation, and rejects otherwise.
Notice that the program never stores any Boolean state — it only tracks which permutation has accumulated so far. Yet by choosing the permutations carefully, the composition encodes the whole formula. This is Barrington's key insight: the non-solvability of S5 provides exactly the algebraic headroom needed to simulate AND with commutator gadgets.
The Real Complexity
How hard is computing with tiny permutation programs, really?
Width 1 programs are trivial: the only permutation of one element is the identity, so you can recognize only the empty language and Σ∗.
Width 2–4 programs are too weak: they can only recognize solvable languages (those in the quasi-AC⁰ closure of parity). Barrington proved this via the solvable group theory — small-width programs correspond to solvable groups, which cannot express all of NC¹.
Width 5 is exactly NC¹. The key is the commutator construction. The commutator of two permutations σ and τ is [σ,τ]=στσ−1τ−1. If the permutations are chosen from A5, the commutator can implement a controlled operation: it equals the identity when a subprogram accepts, and a fixed non-identity permutation when it rejects. This lets you simulate AND and NOT gates, and hence every Boolean circuit.
The depth-to-length blow-up is polynomial: a depth-d circuit of size s translates to a branching program of length at most 4d⋅s, which is polynomial when d=O(logn).
Width 5 cannot be lowered: no group of order ≤4 is non-solvable, so width 4 is provably insufficient for all of NC¹.
The theorem also implies that NC¹ ⊆ L (logarithmic space), since a width-5 program can be simulated by a log-space Turing machine that simply tracks the current permutation (one of at most 5!=120 possibilities). This is one of the tightest known inclusions between circuit and space complexity classes. Compare it with the still-open question of whether P equals NP — Barrington's result is a rare proved equality across seemingly different models.
Where It Matters
Barrington's theorem is not just a beautiful curiosity — it has concrete consequences:
Complexity lower bounds: to show a function is not in NC¹, it suffices to show it cannot be computed by any polynomial-length width-5 branching program. This has driven many lower-bound proofs in algebraic circuit complexity.
Algebraic automata theory: the theorem precisely maps the Krohn-Rhodes decomposition of finite automata onto circuit complexity classes. The solvability hierarchy of groups corresponds to levels of the AC⁰ and NC¹ hierarchy.
Cryptographic protocols: oblivious branching programs (where both branches apply a permutation, hiding which bit was read) are used in private information retrieval and secure computation. Barrington's encoding is directly relevant to these constructions.
Parallel computation: understanding NC¹ helps classify which problems can be solved extremely fast in parallel. Problems in NC¹ include integer addition, string matching, and regular language recognition.
Teaching group theory via computation: the theorem gives a concrete reason why A5 being simple matters — it is the algebraic reason why you cannot get away with width 4. See also P vs NP and circuit complexity for how NC classes fit into the big picture.
Conclusion
Barrington's theorem delivers one of the most satisfying punches in complexity theory: a model that looks laughably weak — shuffle five cards, never remember anything else — turns out to be exactly as powerful as the best parallel circuits in NC¹. Not approximately, not almost: exactly.
The reason hides in abstract algebra. The symmetric group S5 is non-solvable precisely because A5 is a non-abelian simple group, and that algebraic property translates into computational expressiveness through the commutator gadget. Width 4 falls short for the same algebraic reason. This tight correspondence between group theory and computation remains one of the most elegant proved results in all of theoretical computer science.
So the next time you shuffle a five-element sequence, remember: you are operating in a world rich enough to compute anything a logarithmic-depth circuit can — no memory required, just the right choice of permutations at every step.
Comments
Loading comments...