Example (column pivoting in LU factorisation)

$$ \begin{align*} &\pmat{2&1&1 \\ \color{yellow}4&1&0 \\ -2&2&1} \\ ={}& \pmat{0&1&0 \\ 1&0&0 \\ 0&0&1}^T \pmat{\color{yellow} 4&1&0 \\ 2&1&1 \\ -2&2&1} \\ ={}& \pmat{0&1&0 \\ 1&0&0 \\ 0&0&1}^T \left[ \pmat{0&0&0 \\ 0&\frac{1}{2}&1 \\ 0&\color{yellow}\frac{5}{2}&1} + \pmat{2 \\ \frac{1}{2} & 0 \\ -\frac{1}{2} & 0 & 0} \pmat{4&1&0\\ &0&0\\ &&0} \right] \\ ={}& \pmat{0&1&0 \\ 1&0&0 \\ 0&0&1}^T \pmat{1&0&0 \\ 0&0&1 \\ 0&1&0}^T \left[ \pmat{0&0&0 \\ 0&\color{yellow}\frac{5}{2}&1 \\ 0&\frac{1}{2}&1} + \pmat{2 \\ -\frac{1}{2} & 0 \\ \frac{1}{2} & 0 & 0} \\ \pmat{4&1&0\\ &0&0\\ &&0} \right] \\ ={}& \pmat{0&1&0 \\ 1&0&0 \\ 0&0&1}^T \pmat{1&0&0 \\ 0&0&1 \\ 0&1&0}^T \left[ \pmat{0&0&0 \\ 0&0&0\\ 0&0&\frac{4}{5}} + \pmat{2 \\ -\frac{1}{2} & 1 \\ \frac{1}{2} & \frac{1}{5} & 0} \pmat{4&1&0\\ &\frac{5}{2}&1\\ &&0} \right] \\ ={}& \pmat{0&1&0 \\ 1&0&0 \\ 0&0&1}^T \pmat{1&0&0 \\ 0&0&1 \\ 0&1&0}^T \left[ \pmat{2 \\ -\frac{1}{2} & 1 \\ \frac{1}{2} & \frac{1}{5} & 1} \pmat{4&1&0\\ &\frac{5}{2}&1\\ &&\frac{4}{5}} \right] \\ ={}& \pmat{0&1&0 \\ 0&0&1 \\ 1&0&0}^T \pmat{2 \\ -\frac{1}{2} & 1 \\ \frac{1}{2} & \frac{1}{5} & 1} \pmat{4&1&0\\ &\frac{5}{2}&1\\ &&\frac{4}{5}} \end{align*} $$

Or we can represent as

2 1 1
4 1 0
-2 2 1

$\xrightarrow{\pmat{2\\1\\3}}$

4 1 0
2 1 1
-2 2 1

$\longrightarrow$

4 1 0
1/2 1/2 1
-1/2 5/2 1

$\xrightarrow{\pmat{2\\3\\1}}$

4 1 0
-1/2 5/2 1
1/2 1/2 1

$\longrightarrow$

4 1 0
-1/2 5/2 1
1/2 1/5 4/5

(The vectors above the arrows represent the overall permutation of rows: initially it is $\pmat{1\\2\\3}$. After swapping row 1 and 2 we have $\pmat{2\\1\\3}$, and finally after swapping row 2 and 3 we have $\pmat{2\\3\\1}$.)