# How to determine Jordan normal form from the characteristic and minimal polynomials?

Suppose $A$ is a 4 by 4 matrix with the characteristic polynomial $P_A(\lambda) = (\lambda-2)^4$ with the minimal polynomial $m_A(\lambda) = (\lambda -2)^2$. This tells me that that the Jordan form with respect to the eigenvalue 2 (the only eigenvalue) is $4 \times 4$ size matrix and the largest elementary Jordan block is $2 \times 2$.

So we have $\begin{pmatrix} 2 & 1 & 0 & 0 \\ 0 & 2 & 0 & 0 \\ 0 & 0 & 2& 1 \\ 0 & 0 & 0 & 2\\\end{pmatrix}$, or $\begin{pmatrix} 2 & 1 & 0 & 0 \\ 0 & 2 & 0 & 0 \\ 0 & 0 & 2& 0 \\ 0 & 0 & 0 & 2\\\end{pmatrix}.$ I know that actually the first one of this correct. But I think the second one also fits the bill because it is $4 \times 4$ size Jordan matrix with eigenvalues $2$ on its diagonal while the largest Elementary Jordan block is of size $2 \times 2$. Why is that the second one not also the Jordan form for $A$?

The Jordan normal form of a matrix is unique up to permutation of the Jordan blocks. Hence $$\begin{pmatrix} 2 & 1 & 0 & 0 \\ 0 & 2 & 0 & 0 \\ 0 & 0 & 2& 1 \\ 0 & 0 & 0 & 2\\\end{pmatrix}\qquad\text{ and }\qquad\begin{pmatrix} 2 & 1 & 0 & 0 \\ 0 & 2 & 0 & 0 \\ 0 & 0 & 2& 0 \\ 0 & 0 & 0 & 2\\\end{pmatrix},$$ cannot both be Jordan normal forms of the same matrix $A$. Also note that both these matrices have the same characteristic polynomial $(\lambda-2)^4$ and minimal polynomial $(\lambda-2)^2$, which shows that the Jordan normal form of a matrix cannot be determined from these two polynomials alone.
In this case, one way to distinguish is to count the number of Jordan blocks, which is the same as the dimension of $\ker(A-2I)$. In general, it may be necessary to compute the dimension of $\ker(A-\lambda I)^k$ for all $k$ up to the geometric multipicity of $\lambda$, to count the number of Jordan blocks of every possible size.