Say I have a deck of 5 cards that are labeled 1, 2, 3, 4, 5. 1 being at the top and 5 being at the bottom. The rules of this game are as follows. You can take only take two adjacent cards (1 2, 2 3, 3 4, or 4 5) and insert them anywhere else in the stack. For example I could take the 1 2 out and put it in between 4 and 5 to make the deck look like 3 4 1 2 5. I cannot change the order of the two adjacent cards I take out and reinsert. With the deck 3 4 1 2 5, I can take for example, the 2 5 and move it to the front to make 2 5 3 4 1.
The question is as follows:
I use the above rule starting with the deck 1 2 3 4 5. If I use this "shuffle" maneuver as many times as I would like, is it possible to get to the deck 2 1 3 4 5. I ran a computer program and it said this isn't possible. In fact I noticed that there were 60 decks possible starting with 1 2 3 4 5. I can't seem prove this without blindly listing all decks.
Is there a way to prove that 1 2 3 4 5 cant get to 2 1 3 4 5?
Let's observe that the initial permutation has 0 inevrsions, therefore it's even.
When moving $ a, b $, we can handle the folowing situations:
This creates the parity of the permutation even and an invariant property.
For the given permutation
2 1 3 4 5, the parity is odd, as we have only one inversion: $ (2, 1) $.