Given is the Matrix:
$A = \begin{bmatrix} 2&0&0&0 \\ 0&2&0&0\\ 0&0&2&1 \\ 1&0&0&2 \end{bmatrix}$
Minimal and characteristic polynomial are:
$p(\lambda) = (\lambda-2)^4 \\ m(\lambda)= (\lambda-2)^3 $
The Jordan "matrix" is:
$ J = \begin{bmatrix} 2&1&0&0 \\ 0&2&1&0\\ 0&0&2&0 \\ 0&0&0&2 \end{bmatrix}$
Now I have some problems finding $P$ such that $A = PJP^{-1}$.
Here are the kernels:
$null(A-2I) = span\{\begin{bmatrix}0\\1\\0\\0\end{bmatrix};\begin{bmatrix}0\\0\\1\\0\end{bmatrix}\}$
$null((A-2I)^2) = span\{\begin{bmatrix}0\\1\\0\\0\end{bmatrix};\begin{bmatrix}0\\0\\1\\0\end{bmatrix};\begin{bmatrix}0\\0\\0\\1\end{bmatrix}\}$
and of course:
$null((A-2I)^3) = span\{\begin{bmatrix}1\\0\\0\\0\end{bmatrix};\begin{bmatrix}0\\1\\0\\0\end{bmatrix};\begin{bmatrix}0\\0\\1\\0\end{bmatrix};\begin{bmatrix}0\\0\\0\\1\end{bmatrix}\}$
I know now that I should take this vector $\begin{bmatrix}1\\0\\0\\0\end{bmatrix}$ from $null((A-2I)^3)$ then I take $\begin{bmatrix}0\\0\\0\\1\end{bmatrix}$ from $null((A-2I)^2)$ and finally the whole $null(A-2I)$.
The question is, where do I place them inside of $P$? in what order?
In order to find a matrix $Q$ such that $QAQ^{-1}=J$, let$$q_1=\begin{bmatrix}0\\1\\0\\0\end{bmatrix}\text{ and }q_2=\begin{bmatrix}0\\0\\1\\0\end{bmatrix}.$$You already know that $\operatorname{span}\{q_1,q_2\}=\ker(A-2I)$. So $q_1$ and $q_2$ are eigenvectors of $A$ with eigenvalue $2$ and therefore one of them will be the first column of $Q$ and the other one will the fourth one.
Now, let$$q_3=\begin{bmatrix}0\\0\\0\\1\end{bmatrix}.$$You know that $\operatorname{span}\{q_1,q_2,q_3\}=\ker(A-2I)^2$. Besides, $A.q_3=q_2+2q_3$, There is no $q_1$ here. Finally, let$$q_4=\begin{bmatrix}1\\0\\0\\0\end{bmatrix}.$$You know that $\operatorname{span}\{q_1,q_2,q_3,q_4\}=\ker(A-2I)^3$. Besides, $A.q_4=2q_4+q_3$. Again, there is no $q_1$ here. So, $Q$ will be such that:
In other words$$Q=\begin{bmatrix}0&0&1&0\\0&0&0&1\\1&0&0&0\\0&1&0&0\end{bmatrix}.$$And therefore $P=Q^{-1}$, which happens to be equal to $Q$.