# Are the matrices A and B similar?

$B=\begin{pmatrix}1&7&0\\ \:0&2&7\\ \:0&0&2\end{pmatrix}$

$A=\begin{pmatrix}1&1&5\\ 0&2&0\\ 0&0&2\end{pmatrix}$

They have the same trace,same rank, but A has three distinct eigenvalues and B has only 2 does that mean that they are different?

• I wonder how you found that $A$ has three distinct eigenvalues – user258700 Jul 1 '16 at 7:30
• Compare the dimensions of the eigenspaces corresponding to $\lambda=2$. For similar matrices those dimensions should be equal. Do you understand why? – Jyrki Lahtonen Jul 1 '16 at 7:30

The eigenvalues of both matrices are $1$ and $2$. The difference between $A$ and $B$, if any, lies in the eigenspaces $E_{A,2}$ and $E_{B,2}$ corresponding to the double eigenvalue $2$. Now $$A-2I=\begin{bmatrix}-1&1&5\\0&0&0\\0&0&0 \end{bmatrix}, \qquad B-2I=\begin{bmatrix}-1&5&0\\0&0&7\\0&0&0 \end{bmatrix},$$ so $A-2I$ has rank $1$ and $B-2I$ has rank $2$: the matrices can't be similar.