6 3 1 2 5 4

_ _ _ _ _ _

1 2 3 4 5 6

The first line of underscores indicates what key each person will have after the first switches and the second is the state we plan to reach where they all have their own keys after the second switch. So arbitrarily assume that the first person doesn’t switch the first time. We get:

6 3 1 2 5 4

6 _ _ _ _ _

1 2 3 4 5 6

But notice that trades have to be two-way, and we now know that 1 and 6 swapped in the second stage. So we can conclude that this must have been true:

6 3 1 2 5 4

6 _ _ _ _ 1

1 2 3 4 5 6

But notice to get there, The 4 key and the 1 key much have switched during the first round, so this implies:

6 3 1 2 5 4

6 _ 4 _ _ 1

1 2 3 4 5 6

Similarly, now, we know that 4 swaps with 3 in the second round.

6 3 1 2 5 4

6 _ 4 3 _ 1

1 2 3 4 5 6

and that 2 and 3 swapped in the first round:

6 3 1 2 5 4

6 2 4 3 _ 1

1 2 3 4 5 6

And we’re done. (5 initially held his own key and hangs on to it throughout.)

This method of reaching a solution actually resolves a cycle of any length as did Steve’s. In this case, we resolved two cycles, one of length 5 and one of length 1. With each new cycle of greater than length one, just bring a single person down (no trades in first round) and follow the same process.

]]>

The others line up so that their key is held by the person to their left. This will split the group into circles.

Each circle closes up so that it becomes two lines. Each guest swaps keys with the person in front of them. There may be some odd people at the ends of the lines who don’t swap keys.

Everyone in the middle of a line gets the key of the person to their left in the opposite line. This is symmetrical so now we have paired everyone off. This works for the people at the ends too, but you might want to draw it to see it.

So we can do it in two rounds of swapping.

]]>