As you probably know, there are ( factorial) different ways to put the numbers from through (or any set of distinct objects) in a list. For example, here are the different lists containing the numbers through :
Each such list is called a permutation. Now, think about the above picture: the entire picture itself represents a list (read, say, top to bottom and then left to right) of all the permutations of . That is, it’s a permutation of permutations! And of course, there are (that is, about , i.e 620 sextillion, i.e six hundred thousand million million million, i.e. if you could count one trillion numbers every second, it would take you nineteen thousand years to count that high) different ways of putting the permutations in some order.
Look at the particular order given in the picture above. To go from the first permutation () to the second () requires only swapping two adjacent numbers—namely, and .
However, going from to the third permutation in the list () requires more than just a swap—the , , and all get reshuffled.
Consider also the transition from the sixth permutation () to the seventh (, at the top of the second column). It also requires just a swap of two numbers ( and )—but they are not adjacent.
Note by “adjacent” I mean adjacent in the list, not adjacent as numbers. For example, going from the penultimate () to the final permutation () also involves swapping and , but this time they are adjacent.
Here’s the question: can we put these permutations in some order so that the only kind of transition between successive permutations is a swap of two adjacent numbers?
Obviously, exhaustively searching through all 620 sextillion orders is out of the question, so we’ll have to be a bit more clever.
Rather than give away the answer, I think I’ll just stop and let you think about it. If you haven’t seen it before, this problem really makes for a great exploration, with all kinds of interesting structure and connections to discover. Can you figure out an ordering that works—or explain why it’s not possible? You might also want to try it for some simpler cases—say, permutations of and of . If you figure it out for , how about ?
In another post I’ll give the answer, and explain why people in 17th century England (!) cared about this problem (don’t give it away in the comments if you know!).