Random Permutations (Part 3)
Posted by John Baez
I’m trying to understand what a random permutation of a large set is typically like. While I’ve been solving some puzzles that shed a bit of light on this question, I now realize there are some other puzzles that would help more!
When I started, I had a wrong mental image of a random permutation of a large finite set. I foolishly imagined it would be made of many small orbits. But that’s far from true!
It’s easy to see why if you think about it. Given a random permutation of a large -element set, it’s very unlikely for to be mapped to itself by , or even by for some small . So we should instead imagine our random permutation as consisting mainly of quite large orbits!
Here are the facts I’ve proved or at least stated so far:
- As , the probability that a random permutation of an -element set has fixed points approaches
So there’s about a 37% chance of having no fixed points, a 37% chance of having one, an 18% chance of having two, a 6% chance of having three, and it drops off rapidly from there. I showed this in Part 1.
- The expected number of fixed points of a random permutation of a nonempty finite set is exactly 1.
In the limit this follows from the previous remark. But in fact there’s an easy way to show it’s true for any . Do you see how?
- In the limit as , the probability that the shortest cycle in a random permutation of an -element set has length is
So, there’s a 37% chance that the shortest cycle has length , a 22% chance that it has length , a 16% chance that it has length , a 12% chance that it has length , and it drops off slowly from there. I proved this in Part 2.
This is potentially misleading to the unwary. It says a random permutation of a huge set is quite likely to have at least one short cycle. But you shouldn’t assume it has lots of short cycles. Indeed, remark 2) says that it has just one cycle of length 1, on average.
- In the limit as , the average length of the longest cycle in a random permutation is , where
I discussed in this in my post on the Golomb–Dickman constant, which is the name for this number . Dickman proved more: he computed the probability that the longest cycle in a random permutation of an -element set has length , in the limit. He showed it drops off very rapidly as decreases. For example, the probability that the longest permutation has length is less than , for large .
This is makes it very interesting to probe the nature of large cycles. But the details of these, and many other aspects of random permutations, remain mysterious to me!
So, let me resume my puzzle series. These are puzzles for myself, or anyone who wants to help:
Puzzle 5. What is the expected number of cycles in a random permutation of an -element set? What about the mode, or median?
Apparently the expected number of cycles is
As this is asymptotically . That’s very small compared to the size of our set! This goes along with the fact that typically there are some rather large cycles. A proof is here, but it’s not easy to follow unless you go back and figure out the notation. I should write up a nice one.
I don’t know the mode or median.
Puzzle 6. What is the expected length of a cycle in a random permutation of an -element set, asymptotically as ? What about the mode, or median?
I haven’t worked this out, but I want the expected value to be asymptotically .
Puzzle 7. What is the expected number of cycles of length in a random permutation of an -element set?
The answer is apparently when . A proof is here, but I should explain it. Note that when we’re back to my claim that the expected number of fixed points is .
Here are some more puzzles designed to shed light on the large cycles in a random permutation:
Puzzle 8. If we choose an element of an -element set, what is the probability that it lies in a cycle of length ?
The answer is very simple: , for . In other words, it’s equally likely to be on a cycle of any allowed size! A proof is here, and again I want to explain it.
Puzzle 9. If we choose one element of an -element set, what is the expected length of the cycle it lies on?
Thanks to Puzzle 8, the answer is : the average of the natural numbers from to .
Note that there can be at most one cycle of length . I’ll call such a cycle a giant cycle, because it reminds me of the giant connected component of a random graph.
Puzzle 10. How probable is the existence of a giant cycle?
When is even, the probability is
This is connected to the hundred prisoners problem. Something similar is true when is odd. As the probability approaches , or about 69.3%.
Okay, now I need to process all this information, write up proofs for some of these things, but most importantly synthesize all this information to get a better mental picture of a random permutation.
The way I see it now, when you have a random permutation of a large set, there’s a very good chance a substantial fraction of the elements lie on the largest cycle. If this happens, what about the rest? Is the permutation restricted to the rest of the set random in the same way—all elements of the permutation group equally likely? I think so.
If so, we can recursively ‘chip away’ at a random permutation, repeatedly removing the largest cycle, getting a kind of fractal structure where each time we do this, the random permutation of the remaining elements is governed by all the same rules I’ve listed here!
Re: Random Permutations (Part 3)
There’s also a “hard” way of finding the expected number of fixed points: decompose the natural linear representation of (as permutation matrices) and use that to compute the average of its character.