Solution (source code)

= Solution

The <characteristic polynomial> of the given <matrix> is $(t-1)(t-2)^2$. Solving the two <eigenvalue equations> gives
$$
E_1=\operatorname{span}\{(3,-1,3)^T\},\qquad E_2=\operatorname{span}\{(2,1,0)^T,(2,0,1)^T\}.
$$
For example, multiplying the <matrix> by these three <vectors> gives respectively $1$, $2$ and $2$ times the original <vector>. The <eigenvectors> form a <basis>: the <matrix> with these columns has nonzero <determinant> $-1$. Thus \b[an eigenbasis and its diagonal matrix] are
$$
\boxed{\mathcal B=((3,-1,3)^T,(2,1,0)^T,(2,0,1)^T),\qquad [\alpha]_{\mathcal B}=\operatorname{diag}(1,2,2).}
$$