<s>[INST] Find basis so matrix is in Jordan Canonical Form $M = \left(\begin{array}{ccc}0 & -3 & -2 \\1 & 3 & 1 \\1 & 2 & 3\end{array}\right)$
I want to find a basis $B$ such that matrix for $M$ w.r.t $B$ has the form:
$\left(\begin{array}{ccc}2 & 1 & 0 \\0 & 2 & 1 \\0 & 0 & 2\end{array}\right)$
The eigenvalues for $M = 2,2,2$.
$M-2I = \left(\begin{array}{ccc}-2 & -3 & -2 \\1 & 1 & 1 \\1 & 2 & 1\end{array}\right)$.
I tried to find eigenvectors. This is what I came up with.
$(M-2I)v_1 = 0$, then $v_1$ = $(-1,0,1)^t$
And so forth but I either get a wrong answer or it's not invertible.
How do I find the generalized eigenvectors so M is in Jordan Normal Form?
 [/INST] Since $(M-2I)^2=\begin{pmatrix}-1&-1&-1\\0&0&0\\1&1&1\end{pmatrix}$, we can choose any vector $v_3=\begin{pmatrix}a\\b\\c\end{pmatrix}$ 
which is not in the nullspace of $(M-2I)^2$, so $a+b+c\ne0$, and 
then let $v_2=(M-2I)v_3$ and $v_1=(M-2I)v_2$
to get a basis $B=\{ v_1, v_2, v_3\}$ with respect to which M will be in this form.
For example, $v_3=\begin{pmatrix}0\\0\\1\end{pmatrix}$ gives $v_2=\begin{pmatrix}-2\\1\\1\end{pmatrix}$ and $v_1=\begin{pmatrix}-1\\0\\1\end{pmatrix}$;  
$\;\;\;\;$similarly, $v_3=\begin{pmatrix}-2\\1\\0\end{pmatrix}$ gives $v_2=\begin{pmatrix}1\\-1\\0\end{pmatrix}$ and $v_1=\begin{pmatrix}1\\0\\-1\end{pmatrix}$.
</s>