Random Permutations (Part 4)
Posted by John Baez
Last time I listed a bunch of facts designed to improve our mental picture of a typical randomly chosen permutation. Many of these facts are fun to prove using generating functions. But one has a more elementary proof.
Namely: a random permutation of a large finite set has an almost 70% chance of having a single cycle that contains at least half the elements!
This really solidifies my image of a typical permutation of a large finite set. It consists of one big cycle involving most of the elements… and the rest, which is a typical permutation of the remaining smaller set.
Suppose is a permutation of an -element set. Let’s say a cycle of is a giant cycle if it has length . A permutation can contain at most one giant cycle — and as we shall see, this makes this puzzle easy:
Puzzle 10. What is the probability that a randomly chosen permutation of an -element set has a giant cycle?
We’ll actually solve a more detailed problem. Suppose . What is the probability that our permutation has a cycle of length ?
To solve this, we can just count permutations with a cycle of length and divide by . There is no problem with double counting, since each permutation has at most one giant cycle.
Take an -element set . Choosing a permutation of with a cycle of length is the same as choosing a -element subset , a cyclic ordering on , and an arbitrary permutation of .
There are choices of , cyclic orderings on , and permutations of . Multiplying these, we get
So that’s the number of permutations of an -element set with a cycle of length .
Dividing by , we get
So that’s the probability that a random permutation of an -element set has a cycle of length , assuming .
Now we can answer the puzzle! The probability that a random permutation of an -element set has a giant cycle is just the sum of over all with :
Again there’s no double-counting problem, since these cases are exclusive.
As this sum approaches
So, a random permutation of a huge set has about a 69.3% chance of containing a giant cycle.
We can have a bit more fun with this: in the limit as , there’s a 50% probability that a random permutation of an -element set will have a cycle of length at least . Since
we know the median length of the largest cycle in a random permutation of a huge set! It’s about 60.6% the size of the set itself.
This is a nice counterpart to a harder result we saw before: the mean length of the longest cycle is about 62.4% times the size of the set. Sometimes the mean and median are vastly different, but not here.
In all these calculations it was crucial that we worked with giant cycles. With more work perhaps we could handle subgiant cycles: that is, those containing more than 1/3 of the elements of our set. A permutation can have at most two subgiant cycles, so the double-counting problems we dodged above might still be manageable. But in general, computing the probability that a random permutation has a certain number of cycles of lengths in certain ranges will call for better techniques.
Re: Random Permutations (Part 4)
Thank you for these posts on random permutations. I have been enjoying them. A while ago I was looking at the expected transposition distance (normalized so that the max distance is 1. If I recall correctly, in the limit almost all had distance 1.) Also, it seems like random partitians should be both independently interesting and relevant here (since permutations fiber over the partitians).