Random Permutations (Part 8)
Posted by John Baez
Last time we saw a strong connection between random permutations and Poisson distributions. Thinking about this pulled me into questions about partitions and the moments of Poisson distributions. These may be a bit of a distraction — but maybe not, since every permutation gives a partition, namely the partition into cycles.
Here’s a good puzzle to start with:
Puzzle 11. Suppose raindrops are falling on your head, randomly and independently, at an average rate of one per minute. What’s the average of the cube of the number of raindrops that fall on your head in one minute?
To get started we need a bit of probability theory. Suppose random events are happening at an average rate of one per minute, in a nice independent way so that the history so far doesn’t affect the rate of new events now. Let be the probability that events have happened between time and time . Then:
since if events have happened an extra event will bring the total to , while if events have already happened an extra one will make the total stop being .
Now, it takes a bit of work to figure out given this equation and the obvious initial conditions
But if someone tells you the answer, you just need elementary calculus to check that it’s right:
So, let’s be happy someone has already figured out the answer!
Back to our raindrop problem. Here the time is 1 minute, so the probability of raindrops landing on your head in this time is
Sanity check: these probabilities sum to 1.
We’re trying to figure out the expected value of the cube of the number of raindrops that land on your head in a minute. We now know this is
So this is the sum we need to do. But being mathematicians, let’s generalize. Let’s figure out the expected value of the th power of the number of raindrops that land on your head in a minute:
The sum here looks like a mutant version of
But I mention this only so you don’t get confused and take a wrong turn!
To compute
it’s nice to express the powers in terms of ‘falling powers’:
The power counts the number of functions from to , where now I’m identifying a natural number with a set having that number of elements. Similarly, the falling power counts the number of injections from to . Why? With an injection, the first element of has choices of where to go, but the next one has only , and so on.
There’s a nice formula expressing ordinary powers as linear combinations of falling powers:
Here is just the number of partitions of into parts.
This formula has a wonderfully slick proof. Any function factors as a surjection followed by an injection:
and the surjection gives a partition of into parts, where is the number of points in the image . Conversely a partition of into parts together with an injection determines a function . So, the number of functions is the sum over of the number of partitions of into parts times the number of injections . And that’s all the formula says!
So, the expected value of the th power of the number of raindrops that fall on your head is
But in fact we can simplify this! Since there are no injections when , the falling power vanishes in this case, so our sum is just
And now we can do the sum over first. Since
we get
which is the total number of partitions of an -element set!
In our original question we were interested in . There are 5 partitions of a 3-element set:
So, the expected value of the cube of the number of raindrops that land on your head in a minute is 5.
Now that we’re done, let’s reflect on what happened, and introduce more jargon so you can read more about the concepts involved.
The function
is called a Poisson distribution. It’s the answer whenever you want to know the probability of a given number of events occurring in some amount of time if these events occur with a constant average rate, set here to for convenience, independently of the time since the last event.
The parameter is the mean of the Poisson distribution. We worked out the th moment of the Poisson distribution with mean . In other words, we worked out the expected value of in this case:
We got the number of partitions of an -element set, which is called the Bell number , after the author of a fantasy novel about a planet where all mathematics is done by men.
This result is called Dobiński’s formula:
Dobiński published a paper about it in 1877, but it seems to me that he only proved some special cases:
- G. Dobiński, Summirung der Reihe für , Grunert’s Archiv 61 (1877), 333–336.
The number of partitions of an -element set into parts, , is called a Stirling number of the second kind. Given the definitions it’s obvious that
(We can stop the sum at without changing its value.)
The identity
is more interesting, since it connects Stirling numbers of the second kind to falling powers, which are also known as falling factorials, falling sequential products, and various other things. The proof I gave comes from here:
- Gian-Carlo Rota, The number of partitions of a set, American Mathematical Monthly 71 (1964), 498–504.
Category theorists will say it relies on the uniqueness of the epi-mono factorization of a function between finite sets. Rota doesn’t use these terms, but he talks about the ‘kernel’ of a function, which is his name for the epi in this factorization.
In this paper Rota goes ahead and proves Dobiński’s formula, but he does not explicitly discuss its connection to the Poisson distribution. Someone on Wikipedia translated his argument into the language of probability, which I like. Unfortunately the Wikipedia article merely reduces Dobiński’s formula to the identity
and stops there, remarking that the th factorial moment of the Poisson distribution of mean equals . Factorial moments are like ordinary moments but with the power replaced by the falling power .
I was frustrated to see the argument fizzle out before it ended. Then I saw why
It follows from some facts about species and groupoid cardinality.
If you have a species, namely a functor from the groupoid of finite sets to the category of sets, you can think of it as describing a type of structure you can put on finite sets. For each natural number , is the set of structures of this type that you can put on a -element set. The species has a generating function
and the number has a nice meaning if the sum involved is well-defined. The category of elements has finite sets equipped with the given structure as objects and bijections preserving the structure as morphisms. This category is a groupoid, and the number is just the groupoid cardinality of .
Now fix a finite set . There’s a species that assigns to each finite set the set of all injections . The generating function of this species is
Thus,
is the cardinality of the groupoid whose objects are finite sets equipped with an inclusion of the set . But this groupoid is equivalent to the groupoid of finite sets and bijections! Why? Because the morphisms in are bijections that preserve the inclusion of the set . Thus, points in the image of this inclusion have no ‘freedom of movement’, and our morphism boils down to an arbitrary bijection between the remaining points.
Since is equivalent to the groupoid of finite sets, it must have the same cardinality, namely
So, we get
Later, Akiva Weinberger pointed out to me that this identity can be shown by a simple reindexing:
This is precisely a decategorified version of my observation that is equivalent to the groupoid of finite sets.
By the way, Dobiński’s formula, written this way:
says the cardinality of the groupoid of finite sets equipped with a function from a fixed finite set is times the number of partitions of that set. After a while this starts to seem obvious, if you keep thinking about epi-mono factorizations.
So groupoid cardinality establishes a nice connection between Poisson distributions, partitions, and injections. I doubt I’ve gotten to the bottom of it, since I haven’t really seen why the combinatorics is connected to Poisson processes. I’m also not sure how much all this will help me with permutations. But it was fun.
Re: Random Permutations (Part 8)
While probably all your regular audience here knows, it may be appropriate to mention for the benefit of passersby that Bell didn’t realise, or at least didn’t acknowledge, that his work was a fantasy. (I like the description, though!)