Tag Archives: swap

The Steinhaus-Johnson-Trotter algorithm

In a previous post I posed the question: is there a way to list the permutations of in such a way that any two adjacent permutations are related by just a single swap of adjacent numbers? (Just for fun, let’s … Continue reading

Posted in combinatorics, pattern, solutions | Tagged , , , , , | 9 Comments

Permuting permutations

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 … Continue reading

Posted in challenges, combinatorics | Tagged , | 11 Comments