# Prove 2 diagonal matrices of size n are similar.

I have the following two matrices:

A = \begin{pmatrix}1&0&...&0&0\\ 0&2&...&0&0\\ 0&0&...&n-1&0 \\ 0&0&...&0&n\end{pmatrix} B = \begin{pmatrix}n&0&...&0&0\\ 0&n-1&...&0&0\\ 0&0&...&2&0 \\ 0&0&...&0&1\end{pmatrix}

I am asked if A is similar to B and if so then find a P such that $$B = P^{-1}AP .$$ If the two matrices are not similar than I should justify it.

So far I think the two matrices are similar as they have:

• the same eigenvalues (just reversed) $$A: \lambda1 = 1, \lambda2 = 2, \lambda3 = 3, ..., \lambda n = n$$ $$A: \lambda1 = n, \lambda2 = n-1, \lambda3 = n-2, ..., \lambda n = 1$$
• the same rank $$rank(A) = n = rank(B)$$
• the same determinant as both matrices are diagonal so the product of the diagonal is the determinant. Since A and B both have the same elements (in opposing order) than their product is the same $$det(A) = det(B) = 1 * 2 * 3 * ... * (n-1) * n$$
• the same characteristic polynomial (with the same argument as the determinant). $$A: (\lambda - 1)(\lambda -2) ... (\lambda - n - 1)(\lambda - n)$$ $$B: (\lambda - n)(\lambda - n - 1)...(\lambda - 2)(\lambda - 1)$$

Considering the above I have concluded that these two matrices are similar and thus I am trying to determine P.

For A using the characteristic polynomial: $$(\lambda - 1)(\lambda -2) ... (\lambda - n - 1)(\lambda - n)$$

I can go on to determine that P should be \begin{pmatrix}1&0&...&0&0\\ 0&2&...&0&0\\ 0&0&...&n-1&0 \\ 0&0&...&0&n\end{pmatrix}

Yet through B I get a P which is \begin{pmatrix}n&0&...&0&0\\ 0&n-1&...&0&0\\ 0&0&...&2&0 \\ 0&0&...&0&1\end{pmatrix}

These two $\mathbf{P}$s are not the same and I know are not right.

Where am I going wrong in trying to find a P such that $$B = P^{-1}AP \quad?$$

-
I'm sorry: why do you think $P$ has to be that? In general, the similarity matrix has nothing to do with the characteristic polynomial of the matrix in question. If $P$ is any invertible matrix and $M$ is any matrix, then $P^{-1}MP$ will be similar to $M$, and the characteristic polynomial of $M$ can be anything. HINT: If you think of the matrices as linear transformations, what is the matrix of $A$ relative to the ordered basis $[\mathbf{e}_n,\mathbf{e}_{n-1},\ldots,\mathbf{e}_1]$? The matrix $P$ is related to the change of basis. – Arturo Magidin Mar 4 '12 at 19:08

I think that if $M_{2\times2}=\bigl(\begin{smallmatrix}x &0 \\ 0 & y\end{smallmatrix}\bigr)$ matrix with element $x,y\in\mathbb{R}$, then such $P$ isn't exist.

We looking for $P_{2\times 2}=\left(\begin{matrix}a &b \\ c & d\end{matrix}\right)$ such that:

$$\left(\begin{matrix}y &0 \\ 0 & x\end{matrix}\right)=\frac{1}{\det (P)}\left(\begin{matrix}d &-b \\ -c & a \\ \end{matrix}\right)\left(\begin{matrix}x &0 \\ 0 & y\end{matrix}\right)\left(\begin{matrix}a &b \\ c & d\end{matrix}\right)$$ Or: $$\left(\begin{matrix}(ad-bc)y &0 \\ 0 & (ad-bc)x\end{matrix}\right)=\left(\begin{matrix}d &-b \\ -c & a \\ \end{matrix}\right)\left(\begin{matrix}x &0 \\ 0 & y\end{matrix}\right)\left(\begin{matrix}a &b \\ c & d\end{matrix}\right)$$

And after solving(for $a,b,c,d$) that I get:

$$da=db=ca=cb=bc=0$$

-
In this case, $P=\left(\begin{array}{cc}0&1\\1&0\end{array}\right)$ works. – Arturo Magidin Mar 4 '12 at 21:21
oops. :) Thank you! – Salech Alhasov Mar 4 '12 at 21:31
That makes complete sense. However my P is of size n by n so how am I able to come up with such a P-1 – Kyra Mar 5 '12 at 2:59
$P=P^{-1}=\begin{pmatrix}0&0&...&0&1\\ 0&0&...&1&0\\ 0&1&...&0&0 \\ 1&0&...&0&0\end{pmatrix}$ – Salech Alhasov Mar 5 '12 at 3:18
Thank you so much. :D – Kyra Mar 5 '12 at 6:24

try thinking of a $P^{-1}$ which puts the rows in "reverse order", and then show that right-multiplication by $P$ puts "the columns in reverse order".

-