# Find an orthogonal matrix $P$ such that $PAP^{-1}=B$

Find an orthogonal matrix $$P$$ such that $$PAP^{-1}=B$$, where

$$A = \;\;\; \begin{pmatrix} 0 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 0 & 0 \\ \end{pmatrix}$$ and $$B = \;\;\; \begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \\ \end{pmatrix}$$

I know that:

• $$A$$ can be transformed to $$B$$ by first switching the first two rows, then the first two columns,

• permutation matrices are orthogonal.

But I am unable to proceed further in order to find matrix $$P$$. Please help me to solve this question. Thanks.

What permutation matrix $$P$$ has the effect of swapping the first two rows of a matrix $$A$$ in the product $$PA$$?
This, and what you have written, immediately leads to the answer: $$P=\begin{bmatrix}0&1&0\\1&0&0\\0&0&1\end{bmatrix}$$
• Why are you not taking $P^{-1}$ into account? Just $PA$ suffices? Apr 4, 2020 at 7:14
• And how did you directly get $P$? Trial and error? Apr 4, 2020 at 7:15
• @s1mple Since permutation matrices are orthogonal, $P^{-1}=P^T$. It turns out that $P$ is its own transpose, and hence $P$ is its own inverse, and hence $AP$ swaps the first two columns of $A$ as you wrote. Apr 4, 2020 at 7:15
• @s1mple I got $P$ from your description. Apr 4, 2020 at 7:16