Consider a cycle $(6\; 1\; 4\; 3\; 5\; 2 )$ of a symmetric group $S_n$ of degree $n$. This implies $6$ maps to $1$, $1$ maps to $4$, $4$ maps to $3$, $3$ maps to $5$, $5$ maps to $2$ and $2$ maps to $6$. Therefore there is a $2 \times 6 $ associated matrix $$\left(\begin{array}{ll}
1\;2\;3\;4\;5\;6 \\ 4\;6\;5\;3\;2\;1
\end{array}
\right).$$ By using Mathematica, I want to write the same cycle in associated matrix form $$\left(\begin{array}{ll}
1\;2\;3\;4\;5\;6 \\ 4\;6\;5\;3\;2\;1
\end{array}
\right).$$
I have to do the same for each cycle $(a\;\; b\;\; c\;\; d\;\; e\;\; f )$ of length $6$ in $S_6.$
Please suggest Mathematica commands or provide a Mathematica code.
2026-03-27 12:09:44.1774613384
How to sort a permutation cycle in the mapping form?
188 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
After a nice discussion with Rohit Kumar, which can be found in the chat linked in the comments, we came up with a solution which I have extended in order to generate all desired permutations in a loop.
We use Permutations to generate all permutations of the set $\{1,\cdots,n\}$ and use ToCycles in order to convert each permutation to cycle notation. If the length is equal to $n$, we have found a match Here is the code:
Edit: You might need to use
at the very beginning.
Example: Let us use $n=4$ for an easier example. We simply call the above function: $f[4]$ which yields to
Converting each entry via MatrixForm to a visiualized matrix representation yields to:
$$ \begin{pmatrix} 1 &2 &3 &4 \\ 2 & 3 & 4 & 1 \end{pmatrix} \begin{pmatrix} 1 &2 &3 &4 \\ 2 & 4 & 1 & 3 \end{pmatrix} \begin{pmatrix} 1 &2 &3 &4 \\ 3 & 1 & 4 & 2 \end{pmatrix} $$
$$ \begin{pmatrix} 1 &2 &3 &4 \\ 3 & 4 & 2 & 1 \end{pmatrix} \begin{pmatrix} 1 &2 &3 &4 \\ 4 & 1 & 2 & 3 \end{pmatrix} \begin{pmatrix} 1 &2 &3 &4 \\ 4 & 3 & 1 & 2 \end{pmatrix} $$
With corresponding cyclic notations:
$$(2\ 3\ 4\ 1), \ (2\ 4\ 3\ 1), (3\ 4\ 2\ 1), (3\ 2\ 4\ 1), (4\ 3\ 2\ 1), (4\ 2\ 3\ 1)$$
Notice that there are exactly $(n-1)!$ solutions.
For $n=6$, $f[6]$ yields to the following (truncated) output:
Using Length on $f[6]$ yields to $120=(n-1)!=(6-1)!=5!$.