Problem:
Yang has the sequence of integers . He makes 2016 swaps in order, where a swap changes the positions of two integers in the sequence. His goal is to end with . How many different sequences of swaps can Yang do to achieve his goal?
Problem:
Yang has the sequence of integers . He makes 2016 swaps in order, where a swap changes the positions of two integers in the sequence. His goal is to end with . How many different sequences of swaps can Yang do to achieve his goal?
Solution:
Let . The problem is asking to write a cycle permutation of integers as the product of transpositions. Say that the transpositions Yang uses are (i.e. swapping the -th integer in the sequence with the -th integer in the sequence). Draw the graph with edges . One can show that the result is a cycle if and only if the resulting graph is acyclic, so it must be a tree. There are trees by Cayley's formula, and for each tree, it can be made in ways (any ordering of the edges). So the total number of ways to end with a cycle is . By symmetry, each cycle can be made in the same number of ways, so in particular the cycle can be made in ways.