Length of a circular permutation cycle

32 Views Asked by At

Question. Consider a transformation $T:\mathbb{R}^{m\times n} \mapsto \mathbb{R}^{m\times n} \,$ which collects the elements by columns and arranges them on rows.

After how many consecutive transformations do you obtain the initial matrix?

Example. For a $3\times 2$ matrix, we have $$ \begin{pmatrix} 1 & 4 \\ 2 & 5\\ 3 & 6 \end{pmatrix} \overset{T}{\rightarrow} \begin{pmatrix} 1 & 2 \\ 3 & 4\\ 5 & 6 \end{pmatrix} \overset{T}{\rightarrow} \begin{pmatrix} 1 & 3 \\ 5 & 2\\ 4 & 6 \end{pmatrix} \overset{T}{\rightarrow} \begin{pmatrix} 1 & 5 \\ 4 & 3\\ 2 & 6 \end{pmatrix} \overset{T}{\rightarrow} \begin{pmatrix} 1 & 4 \\ 2 & 5\\ 3 & 6 \end{pmatrix} \,\,. $$

Therefore the cycle length is $N(3,2)=4\,.$

Ideas and more questions. The transformation $T$ can be described more rigorously using the vec operator as $$ T(A_{m \times n }) = \left( \text{vec}^{-1}_{n,m} ( \text{vec}_{m,n} (A) ) \right)^\mathsf{T} $$ where $^\mathsf{T}$ denotes the transpose, $vec_{m,n}$ the vectorization of a $m \times n$ matrix and $\text{vec}^{-1}_{m,n}$ the inverse of the vec operator such that $$ \text{vec}^{-1}_{m,n} ( \text{vec}_{m,n} (X) ) = X \quad \in \mathbb{R}^{m\times n} \,,$$ $$ \text{vec}_{m,n} ( \text{vec}^{-1}_{m,n} (x) ) = x \quad \in \mathbb{R}^{mn\times 1} \,.$$

How can $N$ be found from $$ \underbrace{T(\ldots(T}_{N\text{ times}}(A))) = A \,\,?$$ Is there any fixed-point theorem that could be used?

Note that for a square matrix $A$ our transformation $T$ simplifies to the regular matrix transpose. That is, the cycle length $N(m,n) = 2$ for $m=n$. Another observation is that the cycle length is symmetrical w.r.t. the number of rows and columns, i.e. $N(m,n) = N(n,m)$.

By tracking the position of an element in a $m \times n $ matrix, one can obtain the map that gives the next position as following \begin{align} T_k & = m(y_k - 1) + x_k \\ x_{k+1} & = \text{ceil}\left(\frac{T_k}{n} \right) \\ y_{k+1} & = T_k - n(x_{k+1} - 1) \,,\\ \end{align} where $x_{k+1}$ and $y_{k+1}$ specify on which row and column the element currently at $x_k$ and $y_k$ will be after the next transformation. Is there any way to calculate analytically the period of this map? Is this related to Arnold's Cat Map?

Lastly, let me show you two plots of the orbit length vs. the number of rows and columns. The first one is on a linear scale, while the second one on a log scale. Only the upper triangular was plotted due to symmetry. How do these layers occur?

Cycle length vs. number of rows and columns Cycle length vs. number of rows and columns on a log scale

This question was born from a card trick I was playing with a couple of years ago. Any suggestions on how to study this problem are appreciated.