<s>[INST] Find Jordan basis of a given matrix $A=\begin{bmatrix}
-1 & 4 & -4 \\
0 & 1 & 0 \\
1 & -2 & 3
\end{bmatrix}$
The eigenvalues of the matrix are all $1$. The dimension of it's eigenspace is 2 so the Jordan normal form of the matrix is \begin{bmatrix}
1 & 1 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{bmatrix}
this is all confirmed by WolframAlpha.
Now, an eigenvector for $1$ is $(0,1,1)$ but when I try t solve $AP=PJ$ where
$P=\begin{bmatrix}
0 & a & d \\
1 & b & e \\
1 & c & f
\end{bmatrix}$
I get $1+b=b$ for the middle element. Why is $(0,1,1)$ a bad choice for the first column here, and how do I find the Jordan basis in this case?
 [/INST] The characteristic polynomial is given by
$$\begin{align} p (\lambda) &= (-1-\lambda)(1 - \lambda)(3 - \lambda) - (-4)(1- \lambda)(1) \\&= (1 - \lambda)[-(-1-\lambda)(3-\lambda) - 4]\\&= -(\lambda - 1)^3\end{align}$$
Which gives you eingenvalue  $\lambda = 1$ of multiplicity $3$.
To find the eigenvectors, solve
$$(A - I)\begin{pmatrix}u_1\\u_2\\u_3\end{pmatrix} = 0.$$
We get $u = \begin{pmatrix}2u_2 - 2u_3\\u_2\\u_3\end{pmatrix}$.
Take two linearly independent eigenvectors, e.g. $u = \begin{pmatrix}0\\1\\1\end{pmatrix}$ (your same idea) and $u' = \begin{pmatrix}2\\0\\-1\end{pmatrix}$. Now to find a generalized vector we  make
$$(A - I) v = u'$$
Then $v = \begin{pmatrix}-1 + 2v_2 - 2v_3\\v_2\\v_3\end{pmatrix}$, we may take $v = \begin{pmatrix}-1\\0\\0\end{pmatrix}$. A basis would then be
$$\Bigg\{\begin{pmatrix}0\\1\\1\end{pmatrix},\begin{pmatrix}2\\0\\-1\end{pmatrix},\begin{pmatrix}-1\\0\\0\end{pmatrix}\Bigg\}$$
As we have two linearly independent eigenvectors there is going to be two Jordan blocks, a $1 \times 1$ block corresponding to $u$ and $2\times 2$ block corresponding to $u'$ and $v$. That gives us
$$J =\begin{pmatrix}1&0&0\\0&1&1\\0&0&1\end{pmatrix}$$
</s>