Metrics on S_n
Anchor (Master): Diaconis 1988 IMS Lecture Notes 11 Ch. 6; Critchlow 1985; Diaconis-Graham 1977 Adv. Appl. Math.
Intuition [Beginner]
When two people rank the same set of items differently, you want a number measuring "how far apart" their rankings are. Several natural distances exist: count how many items are in different positions, count how many pairs are in opposite order, or count the minimum number of swaps needed to turn one ranking into the other.
Each of these distances has a character-theoretic formula: it can be expressed as a sum involving the irreducible characters of the symmetric group. This is not a coincidence — the characters encode the deep symmetry structure of the group, and any function invariant under certain group operations can be expanded in characters.
Why does this concept exist? Because the most useful distances on permutations all have spectral expressions that connect them to representation theory, enabling character-based computations and statistical tests on ranking data.
Visual [Beginner]
A diagram showing three permutations of four items as sequences of numbered balls, with curved arrows indicating the swaps needed to transform one into another. Below each pair, the Cayley distance (number of transpositions), the Hamming distance (number of displaced items), and the Kendall tau distance (number of pairwise inversions) are displayed.
The three metrics give different answers for the same pair of permutations, reflecting different notions of "closeness."
Worked example [Beginner]
Consider the permutations and in one-line notation on four items. We compute three distances.
Step 1. Cayley distance: the minimum number of transpositions needed to transform into . The permutation has cycle decomposition . A 3-cycle requires transpositions. So .
Step 2. Hamming distance: the number of positions where the two permutations differ. Comparing position by position: position 1 has 2 vs 1 (differ), position 2 has 3 vs 2 (differ), position 3 has 1 vs 3 (differ), position 4 has 4 vs 4 (same). So .
Step 3. Kendall tau distance: the number of pairs in opposite relative order. In : the pair has but appears before , which is the wrong order compared to . Counting inversions: = 2 inversions. So .
What this tells us: different metrics capture different aspects of the disagreement between two rankings. Cayley counts swaps; Hamming counts displaced items; Kendall counts pairwise disagreements.
Check your understanding [Beginner]
Formal definition [Intermediate+]
Let denote the symmetric group. We define four metrics on .
Cayley distance. where is the number of cycles in the cycle decomposition of (counting fixed points as cycles of length 1).
Hamming distance. . Equivalently, where is the number of fixed points of .
Kendall tau distance. . This counts the number of pairs whose relative order is reversed between and .
Spearman rho (squared) distance. .
Each metric is right-invariant: for all . This means , so every metric is determined by its values on pairs involving the identity.
Definition (Character-theoretic expression). A metric on has a character-theoretic expression if there exist coefficients such that
for all , where is the irreducible character indexed by .
Counterexamples to common slips
- Confusing right-invariance with left-invariance. All four metrics are right-invariant but not all are left-invariant. The Cayley distance is bi-invariant (since it depends only on cycle structure), but the Kendall tau distance is not left-invariant.
- Spearman rho as a metric. The sum of squared position differences is not a metric in the strict sense (it does not satisfy the triangle inequality without taking square root). The square root is a metric.
- Kendall tau normalisation. The raw inversion count ranges from to . The normalised version is the Kendall tau correlation coefficient used in statistics.
Key theorem with proof [Intermediate+]
Theorem (Character-theoretic expressions for metrics on — Diaconis 1988). Each of the four metrics has a character-theoretic expansion. In particular, for with cycle type :
and the Kendall tau distance satisfies
where denotes the character of the representation carried by the -th graded piece of the coinvariant algebra and is a combinatorial multiplicity.
Proof. We prove the Hamming distance character formula; the others follow similar strategies.
Step 1 (Hamming as a class function). The number of fixed points can be written as . This is the character of the permutation representation on , which decomposes as where is the identity representation. So .
Step 2 (Inversion via Plancherel). Express using the orthogonality relations. The function is a class function (it depends only on the cycle type), so by character inversion:
The inner product equals the multiplicity of in the permutation representation. By the decomposition , only and contribute:
Therefore .
Step 3 (Express via all characters). Using the column orthogonality of the character table, the fixed point function can also be written as:
since the transposition class generates the -invariant bilinear form that pairs with . This gives the stated formula for .
Bridge. The character-theoretic expressions for metrics build toward the spectral analysis of permutation data in 07.05.11 where distances between distributions are measured by spectral norms, and appear again in 07.05.13 where metrics on cosets extend the framework to partial rankings. The foundational reason the character expansion works is that every right-invariant function on is a class function of , and the characters form an orthonormal basis for class functions. This is exactly the content that identifies the metric geometry of with the representation-theoretic Fourier analysis; the bridge is that computing a distance between two permutations is the same as evaluating a character sum, which is the same as computing a Fourier coefficient at each irreducible representation. Putting these together with the Diaconis-Graham inequalities, the four metrics are ordered by the first and second Diaconis-Graham bounds: and .
Exercises [Intermediate+]
Advanced results [Master]
Theorem 1 (Diaconis-Graham inequalities 1977). For all :
These bounds are tight. The lower bound is achieved when is a single transposition of adjacent elements. The upper bound is achieved when is a product of disjoint transpositions that maximise the displacement.
Theorem 2 (Cayley distance and characters). The Cayley distance has the closed-form character expression:
where is the cycle type of and is the number of parts. The inner sum simplifies because only the identity and standard representations contribute substantively for small Cayley distance.
This expression was derived by Diaconis 1988 using the fact that the Cayley distance is a class function depending only on cycle type.
Theorem 3 (Hamming distance and Fourier transform). The Hamming distance decomposes spectrally as:
This is the simplest character formula among the four metrics because only the standard representation contributes.
Theorem 4 (Spearman footrule and its spectral expansion). The Spearman footrule has a Fourier expansion involving the characters of the standard representation and its exterior powers. Diaconis and Graham 1977 showed that and .
Theorem 5 (Metric properties and the Bruhat order). The Kendall tau distance (equivalently, the Coxeter length) respects the Bruhat order on : if in Bruhat order, then . The Bruhat order is the partial order generated by the relation whenever is a transposition that increases the inversion count.
This connects the metric geometry of to the combinatorics of the Bruhat order, which is fundamental in Schubert calculus.
Theorem 6 (Expected distances under uniformity). Under the uniform distribution on :
where is the -th harmonic number. These expected values are computed from the character expressions by taking expectations of the characters, which evaluate to 0 for non-identity representations under the uniform distribution.
Synthesis. The character-theoretic expressions for metrics on provide the foundational reason that representation theory unifies the metric geometry of permutations. The central insight is that right-invariant metrics on are determined by their values at the identity, which are class functions with Fourier expansions in the irreducible characters. Putting these together with the Diaconis-Graham inequalities, the four standard metrics are ordered and related by universal bounds, and each has a clean spectral formula. This is exactly the content that builds toward the analysis of partial rankings in 07.05.13 where metrics on cosets are defined by lifting through the quotient map, and appears again in 07.05.11 where distances between probability distributions on are measured by character sums via the Upper Bound Lemma. The bridge is between the combinatorial definition of each metric and its Fourier-analytic representation; the pattern generalises from bi-invariant metrics (Cayley) to right-invariant metrics (all four), and identifies the character table of as the universal conversion device between different notions of distance on permutations.
Full proof set [Master]
Proposition 1 (Hamming distance character formula). For all :
Proof. The permutation representation decomposes as , where is the identity representation and is the standard representation. The character of the permutation representation at is , the number of fixed points. So . Since .
Proposition 2 (Expected Hamming distance). Under the uniform distribution on , .
Proof. . The expected character value under the uniform distribution is by the orthogonality of characters (the inner product of any non-identity character with the identity character is 0). Hence .
Connections [Master]
Spectral analysis of permutation data
07.05.11. The character-theoretic expressions for metrics are computed using the same Fourier transform on that decomposes ranking data into spectral components. The first-order spectral coefficient in07.05.11determines the Hamming distance between the empirical distribution and uniformity; the metric formulas of this unit provide the pointwise versions.Random walk upper bound lemma
07.05.05. The Upper Bound Lemma bounds total variation distance by a character sum, which is a spectral expression of the same type as the metric formulas. The mixing time analysis in07.05.05uses the character values on transpositions, which are the same values appearing in the Cayley and Hamming distance formulas.Partially ranked data
07.05.13. Metrics on extend to partial rankings via the coset structure , where the induced metrics on cosets are defined by minimising the metric over coset representatives. The Gelfand pair structure in07.05.13ensures that these induced metrics retain clean character-theoretic expressions.Symmetric group representation
07.05.01. The character table of , the hook-length formula for dimensions, and the Murnaghan-Nakayama rule for computing character values developed in07.05.01and07.05.10are the computational tools needed to evaluate the metric formulas for specific permutations.
Historical & philosophical context [Master]
The systematic study of metrics on the symmetric group was initiated by Diaconis and Graham in their 1977 paper Spearman's Footrule as a Measure of Disarray [DiaconisGraham1977], which established the inequalities relating the four standard metrics. Diaconis developed the character-theoretic expressions in his 1988 monograph Group Representations in Probability and Statistics [Diaconis1988], showing that the Fourier analysis on provides a unified framework for computing all standard metrics.
Critchlow 1985 Metric Methods for Analyzing Partially Ranked Data [Critchlow1985] extended the metric framework to partial rankings and developed the induced metrics on cosets. The connection between the Kendall tau distance and the Coxeter length function of was observed in the combinatorics literature by Björner and Brenti 2005 in Combinatorics of Coxeter Groups.
Bibliography [Master]
@article{DiaconisGraham1977,
author = {Diaconis, Persi and Graham, R. L.},
title = {Spearman's Footrule as a Measure of Disarray},
journal = {J. Roy. Statist. Soc. Ser. B},
volume = {39},
year = {1977},
pages = {262--268},
}
@book{Diaconis1988metrics,
author = {Diaconis, Persi},
title = {Group Representations in Probability and Statistics},
publisher = {Institute of Mathematical Statistics},
year = {1988},
series = {IMS Lecture Notes--Monograph Series},
volume = {11},
}
@book{Critchlow1985,
author = {Critchlow, Douglas E.},
title = {Metric Methods for Analyzing Partially Ranked Data},
publisher = {Springer},
year = {1985},
series = {Lecture Notes in Statistics},
volume = {34},
}
@book{BjornerBrenti2005,
author = {Bj\"orner, Anders and Brenti, Francesco},
title = {Combinatorics of Coxeter Groups},
publisher = {Springer},
year = {2005},
}