<s>[INST] what is the characteristic polynomial and minimal polynomial of A and B? What is the characteristic polynomial  and minimal polynomial  of $A$  and $B$ ?
$A=\begin{pmatrix} a & 1 & 0 & 0 \\ 0 & a & 0 & 0  \\ 0 & 0 & a & 0 \\ 0 & 0 & 0 & a\end{pmatrix},B=\begin{pmatrix} a & 1 & 0 & 0 \\ 0 & a & 0 & 0  \\ 0 & 0 & a & 1 \\ 0 & 0 & 0 & a\end{pmatrix}$
My attempt :  for  $A$)  , $ch_A(x) = (x-a)^4$ , $m_A = (x-a)^2(x-a)$
for $B)$ $ch_B(x) = (x-a)^4$ , $m_B = (x-a)^2(x-a)^2$
where $ch$ and $m$ denote  the characteristic and minimal polynomial.
Is  my answer is correct or not  ???
Any hints/solution will be apprciated
thanks u
 [/INST] Set
$N_A = \begin{bmatrix} 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 \\  0 & 0 & 0 & 0 \\  0 & 0 & 0 & 0 \end{bmatrix}; \tag 1$
then
$N_A^2 = 0; \tag 2$
further note that
$A - aI = N_A; \tag 3$
thus
$(A - aI)^2 = 0, \tag 4$
which means that
$m_A = (x-a)^2, \tag 5$
since $A$ can satisfy no polynomial of degree 1; indeed,
$cA + dI = \begin{bmatrix} ca + d & c & 0 & 0 \\ 0 & ca + d & 0 & 0 \\  0 & 0 & ca + d & 0 \\  0 & 0 & 0 & ca + d \end{bmatrix} = 0 \Longleftrightarrow c = d = 0; \tag 6$
thus $m_A(x) = (x - a)^2$ is the polynomial of least degree satisfied by $A$; hence, minimal.
It it easy to see by direct and simple calculation that
$e_1 = (1, 0, 0, 0)^T, \; e_3 = (0, 0, 1, 0)^T, \; e_4 = (0, 0, 0, 1) \tag 7$
are eigenvectors of $A$, each with eigenvalue $a$, and that
$(A - aI) e_2 = e_1, \tag 8$
that is, $e_2 = (0, 1, 0, 0)^T$ is a generalized eigenvector of $A$ corresponding to eigenvalue $a$; therefore $a$ is an eigenvalue of algebraic multiplicity $4$ (tho' of geometric multiplicity $3$); thus the characteristic polynomial of $A$ is
$c_A(x) = (x - a)^4, \tag 9$
which of course may also be had as
$c_A(x) = \det(A - xI). \tag{10}$
As for $B$, we set 
$N_B = \begin{bmatrix} 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 \\  0 & 0 & 0 & 1 \\  0 & 0 & 0 & 0 \end{bmatrix}; \tag{11}$
then
$N_B^2 = 0; \tag{12}$
therefore
$(B - aI)^2 = N_B^2 = 0, \tag{13}$
so
$m_B(x) = (x -a)^2; \tag{14}$
we can see that
$\deg m_B(x) \ne 1 \tag{15}$
by more or less the same logic that was used above to show $\deg m_A(x) \ne 1$.  
Finally, we see that $e_1$ and $e_3$ are eigenvectors of $A$ corresponding to $a$, and that here $e_2$ and $e_4$ are generalized eigenvectors for $a$; it follows now that $a$ is of algebraic multiplicity $4$, and we conclude that
$c_B(x) = (x - a)^4. \tag{16}$
</s>