I am looking for an explicit general formula of $ n!$ permutation matrices for the initial column vector $\pi = \begin{pmatrix} 1, 2 \cdots \ n \end{pmatrix}^{T}$.
The first permutation vector is $\pi^{I} = \pi$ and the first permutation matrix is the identity matrix:
$ \pi^{I}= P^{I}_{\pi} \pi $
$ P^{I}_{\pi} = \begin{pmatrix} 1 & 0 & \cdots & 0 \\ 0 & 1 & \cdots & 0 \\ 0 & 0 & \cdots & 0 \\ 0 & 0 & \cdots & 1 \end{pmatrix} $
The second permutation vector is $\pi^{II} = \begin{pmatrix} 2, 1 \ \cdots \ n \end{pmatrix}^{T}$ and the corresponding permutation matrix is $P^{II}_{\pi}$ as follows:
$ \pi^{II}= P^{II}_{\pi} \pi $
$ P^{II}_{\pi} = \begin{pmatrix} 0 & 1 & \cdots & 0 \\ 1 & 0 & \cdots & 0 \\ 0 & 0 & \cdots & 0 \\ 0 & 0 & \cdots & 1 \end{pmatrix} $
I would like to get the expression of the $K^{th}$ permutation matrix $P^{K}_{\pi}$ for the $K^{th}$ permutation, $1 \leq K \leq n!$
Any idea?
Thanks
Permutations can be represented by the corresponding permutations of the columns of the identity matrix. i.e. $$\begin{bmatrix} 1&0&0\\0&0&1\\0&1&0\end{bmatrix}$$ represents the permutation $(1,3,2)$, since we swapped columns one and two, then we get the permutation that maps $2\mapsto 3$ and $3\mapsto 2$.