Random Permutations (Part 10)
Posted by John Baez
Groupoids generalize sets in an obvious way: while elements of a set can only be the same or different, objects of a groupoid can be ‘the same’ — that is, isomorphic — in more than one way.
Less obviously, groupoids also let us generalize the concept of cardinality. While the cardinality of a finite set is a natural number, the cardinality of a finite groupoid can be any nonnegative rational number!
This suggests that probabilities in combinatorics could secretly be cardinalities of groupoids. Indeed, Poisson distributions naturally show up this way. For a good self-contained introduction, see:
- Qiaochu Yuan, Groupoid cardinality, Annoying Precision, November 8, 2012.
Now I want to explain how groupoid cardinality can be used to prove some important (and well-known) facts about random permutations.
A while back we saw that many questions about random permutations could be answered using just this one fact: the expected number of cycles of length in a random permutation of an -element set is , at least if .
Last time we proved a stronger fact. To state this, we treat the number of cycles of length in a permutation of an -element set as a random variable, say . Then we have this: the first moments of match those of a Poisson distribution with mean .
We actually did more: we described all the moments! We did this by working with ‘factorial moments’. The th factorial moment of a random variable is the mean of
Then we have this: the first factorial moments of match those of the Poisson distribution of mean , while the rest vanish. Or if you prefer to leave Poisson distributions out of it:
The proof of this was a fairly easy calculation, which however involved some miraculous cancellations and provided no compelling story about why the answer turns out to be so simple.
I now think I think I’ve found that story. It doesn’t connect to Poisson distributions — not yet, anyway. But it does explain the meaning of the answer . It’s the cardinality of a groupoid.
A quick sketch
The idea is quite simple when you know the underlying concepts. We’ll show that is the cardinality of a certain groupoid. When this groupoid has no objects, so its cardinality is zero. Otherwise, this groupoid is equivalent to a product of a groupoid with cardinality and copies of the group , thought of as a one-object groupoid. Thus
The nice thing is that each copy of is naturally associated to a cycle of length in our random permutation. It’s no coincidence that is a ‘cyclic group’.
What is this groupoid, whose cardinality is ? Its objects are -element sets equipped with a permutation that in turn is equipped with an ordered -tuple of disjoint cycles of length . There’s an obvious concept of isomorphism between two such gadgets, so we get a groupoid of them. And then we just think about this groupoid a bit, and everything follows.
But let me slow down and start from the beginning.
Review of groupoid cardinality
To compute the cardinality of a groupoid , we go through its isomorphism classes of objects, pick one representative of each class, count the morphisms from to itself, take the reciprocal… and add up all these reciprocals. In a formula:
Here is the set of isomorphism classes of , and is the automorphism group of , an arbitrary representative of some isomorphism class.
To make sure the sum converges, we can play it safe and assume our groupoid is finite. We don’t need to do this: for example, for the groupoid of finite sets the sum converges to . But today I’ll only work with groupoids that are either finite or equivalent to one that’s finite. (Equivalent groupoids clearly have the same cardinality.)
One way to get a groupoid is by taking a set with a group acting on it. Then we get a groupoid where an object is an element and a morphism from to is a group element with . We compose these morphisms in the obvious way: by multiplication in .
We call the weak quotient of by . In the ordinary quotient , we declare and equal when there’s a group element with . In the weak quotient, we merely put in an isomorphism between and . Thus, the weak quotient retains more information.
Here’s one of my favorite equations:
It says that to understand division, we can use groupoids. If you take a 5-element set and mod out by a 2-element group, you don’t get a set with elements. But if you take the weak quotient, you get a groupoid with cardinality .
Groupoid cardinality and probability theory
If you have a group , how can you find a set that it acts on? One way is to use itself. acts on itself in three interesting ways: by left translations, by right translations, and by conjugation. No matter which method you choose, you’ll get
If acts on itself by left or right translation, every object of is isomorphic to every other object in a unique way. Thus, is equivalent to the groupoid with one object and one morphism. Groupoid cardinality is invariant under equivalence. So it’s no surprise that in this case.
It’s more interesting when acts on itself by conjugation. Then the weak quotient has many different isomorphism classes, one for each conjugacy class of . The fact that equals then says this: if we run through the conjugacy classes of , pick a representative of each one, take the reciprocal of the cardinality of its centralizer, and sum up these reciprocals, we get .
But the fun really starts when we consider a subset that’s invariant under conjugation. The probability that a random element of lies in is . But this equals . So, we can compute probabilities using groupoid cardinality!
Here, of course, we are treating as a probability measure space where each element has measure .
More generally, suppose is a map of -sets, where acts on itself by conjugation. Then we get a function that counts the points of that map to each element of :
We can think of as a random variable, since it’s a function on a probability measure space, namely . The expected value of is then the groupoid cardinality of . Here’s why:
This may seem like an impractical way to compute expected values. But it really works wonders in some cases, namely when is equivalent to a groupoid whose cardinality we can compute by other means.
And that’s what we’ll see now.
The calculation
The key fact is this: since the function
tells us the number of cycles of length in a permutation of an -element set,
tells us the number of ordered -tuples of distinct cycles of this sort. And since distinct cycles are the same as disjoint cycles, we can replace the word ‘distinct’ with ‘disjoint’ here — and we’ll do that from now on.
The expected value is thus the number of ordered -tuples of disjoint cycles of length of a permutation, summed over all permutations, divided by .
But this is the cardinality of a groupoid!
Let be the set whose elements are of this form: a permutation together with an ordered -tuple of disjoint cycles of length . The group acts on in obvious way: it acts by conjugation on itself, and the cycles go along for the ride. There’s a map
that forgets the cycles and only keeps the permutation . This is clearly a map of -sets. So, we can use the results described in the last section!
We get a function that counts the points of that map to each element of :
And this function is just what I’m calling . For each permutation , it gives the number of ordered -tuples of distinct cycles of length .
It follows that the expected value we’re trying to compute is a groupoid cardinality:
But this groupoid is equivalent to one I find more charismatic: the groupoid of -element sets equipped with a permutation that is itself equipped with a chosen -tuple of disjoint cycles of length . The morphisms in this groupoid are the obvious ones. (At this point I’m speeding up, assuming you can think like a category theorist.)
In other words, instead of fixing our ‘favorite’ -element set, which is sort of ridiculous, we use all of them.
Now, it’s easy to see that an -element set equipped with this structure is the same as a -tuple of cyclically ordered -element sets together with the ‘remainder’: a set with elements equipped with an arbitrary permutation. Thus, we have
Here is the groupoid of cyclically ordered -element sets, and is the groupoid of sets with elements equipped with a permutation.
But is equivalent to the groupoid , which has one object and the cyclic group as automorphisms. That’s because all objects of are isomorphic, and the symmetry group of a cyclically ordered -element set is . An easy calculation shows that
On the other hand,
where the symmetric group is acting on itself by conjugation. So, we get
We thus get
Voilà!
Afterthoughts
Experts in category theory will note that I’m vacillating between using various large groupoids, like , and various finite groupoids that are equivalent to these, like . In my own mind, I barely notice the distinction — I flit back and forth depending on what’s more convenient at the moment. But when I try to explain what I’m doing, I feel some need to talk about this, and then everything becomes more lengthy. It’s possible I could have given a more efficient treatment, but I wanted to show you a way of thinking.
I also introduced a bit more notation than strictly necessary. When you think of a group as a one-object groupoid, people often call that groupoid . The reason is that if we turn this groupoid into a space, it becomes a space known as the classifying space of , also denoted . But the groupoid is also a weak quotient:
where is acting on the -element set in the only possible way. So, it should be no surprise that
Also, we have
In other words, a -element cyclically ordered set is the same as a -element set equipped with a permutation having one chosen cycle of length .
Also, we have
In other words, an -element set equipped with a permutation is the same as an -element set equipped with a permutation having no chosen cycles of length . (It can have lots of cycles of length ; we’re just not choosing any of them.)
So, I didn’t need to talk about or or . But I thought that reducing notation to the absolute minimum would make things harder to understand, not easier.