TITLE: Order of the centralizer of a permutation
QUESTION [13 upvotes]: Given a permutation $\sigma\in S_{n}$, is there a way to know the order of the centraliser $C_{S_{n}}\left(\sigma\right)=\left\{ \pi\in S_{n},\,\pi\sigma=\sigma\pi\right\}$ , i.e what is $\left|C_{S_{n}}\left(\sigma\right)\right|$? 
I would appreciate a proof if the answer is yes.
Also, if the answer above is yes, is there also a way to calcualte the order of the centraliser of a given subset of $S_{n}$, or at least for a pair of permutations?

REPLY [15 votes]: Let $n_1,n_2,\ldots,n_k$ be the distinct lengths of the cycles of $\sigma$ (including 1 if there are fixed points) and suppose that there are $m_i$ cycles of length $n_i$. Then the centralizer of $\sigma$ can permute the cycles of the same length. Its order is $\prod_{i=1}^k n_i^{m_i}m_i!$.
Calculating the centralizer of a subgroup $H$ of $S_n$ is not difficult, but it is more complicated. The order of the centralizer of a single orbit is equal to the number of fixed points (in that orbit) of the stabilizer of a point in the orbit. But if $H$ has more than one orbit with equivalent actions then the equivalent orbits can be permuted by the centralizer, so the complete centralizer is a direct product of wreath products of centralizers of sets of equivalent orbits.