Solution (source code)

= Solution

Two square matrices are <similar matrices>[similar] when $B=P^{-1}AP$ for some invertible matrix $P$. A <Jordan normal form> is a block-diagonal matrix whose blocks have one eigenvalue on the diagonal, ones on the superdiagonal, and zeros elsewhere; over an algebraically closed field every matrix is similar to such a form, unique up to reordering its <Jordan blocks>.

Both displayed matrices have <characteristic polynomial>
$$
\chi_A(t)=\chi_B(t)=(t-1)^3.
$$
However,
$$
\operatorname{rank}(A-I)=1,\qquad
\operatorname{rank}(B-I)=2,
$$
so their eigenspace dimensions are respectively two and one. Thus $A$ has Jordan form $J_2(1)\oplus J_1(1)$, whereas $B$ has Jordan form $J_3(1)$. By uniqueness of Jordan normal form,
$$
\boxed{A\text{ and }B\text{ are not similar}}.
$$