Random Permutations (Part 1)
Posted by John Baez
I’m going to solve some problems on random permutations in my combinatorics class, to illustrate some of the ideas on species and generating functions, but also to bring in some ideas from complex analysis.
In all these problems we choose permutations randomly from , with each permutation having probability of being chosen.
I’ll start with one that’s easy, given the stuff I’ve already explained in class.
Puzzle 1. What is the probability that a randomly chosen permutation of an -element set has exactly fixed points? What does this probability converge to as ?
In homework the students already computed the probability that a randomly chosen permutation of an -element set has no fixed points. A permutation with no fixed points is called a derangement, and the number of derangements of an -element set is called the subfactorial .
Using the inclusion-exclusion principle, the number of derangements of is the number of permutations of this set, minus the number of permutations that fix the point , minus the number that fix the point ,… minus the number that fix the point , plus the number that fix the points and , plus the number that fix the points and ,… minus the number that fix the points and ,… and so on.
In short:
We can simplify this to
Thus, the probability that a permutation of an -element set has no fixed points is
and this approaches as . So cool.
Now, what about fixed points? To choose a permutation of an -element set with fixed points, we need to choose points and then choose a derangement of the remaining -element set. There are
ways to do this. Thus, the probability that a permutation of an -element set has fixed points is
which can be written more charmingly as
We have seen that as we have
Thus, as , the probability that a permutation of an -element set has fixed points approaches
Note that these probabilities sum to , as they must.
Puzzle 2. In the limit, what is the expected number of fixed points of a permutation of an -element set?
You might naively think it would be infinite, but remember as we increase the size of our set we decrease the probability that any point gets mapped to itself.
We know that in the limit the probability of there being fixed points is
so in this limit, the expected number of fixed points is
Exactly one!
You might also wonder what’s the expected number of fixed points for an arbitrary finite , but I’ll leave that to you.
Re: Random Permutations (Part 1)
Is it clear why the limit as of the expected number of fixed points of a permutation on elements is the same as , where is the limit as of the probability of a permutation on elements having exactly fixed points? This seems like the sort of interchange-of-limits argument with which one must take some care.