# Find matrices $A$ and $B$ such that $rank(A) = rank(B)$ but $rank(A^2) \ne rank(B^2)$

Every time I think I found a solution, it turns out that the rank of my matrices reduces so that rank(A) no longer equals rank(B).

I'm just guessing and checking, perhaps there is a more formulaic approach?

$A=\left(\begin{array}{rr}% 1&0\\% 0&0\\% \end{array}\right)%$, $B:=\left(\begin{array}{rr}% 0&0\\% 1&0\\% \end{array}\right)%$

• Keep in memory these two matrices, they are common counter-examples in this kind of problem. – Traklon Nov 4 '14 at 8:41

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