commutant of an endomorphism nilpotent Let $V$ be a vector space of finite dimension
Let $u$ be a nilpotent endomorphism of $V$ 
denote$C(u)$ the commutant of $u$ 
using the decomposition of Jordan to $u$ give the dimension of $C(u)$
 A: Assuming your vector space is over a field of characteristic $0 \ldots$.
Since the endomorphism is nilpotent, all its eigenvalues are $0$.
Therefore the Jordan blocks in the decomposition are in the form,
$$\begin{bmatrix}
0
\end{bmatrix}
,
\begin{bmatrix}
0 & 1 \\
0 & 0
\end{bmatrix},
\begin{bmatrix}
0 & 1 & 0 \\
0 & 0 & 1 \\
0 & 0 & 0
\end{bmatrix},
\cdots
$$
etc.
It's easy to compute the centralizers of these matrices.  The $k$-dimensional nilpotent Jordan block has dimension $k$.  
Now, suppose we have a Jordan decomposition like 
$$J = \begin{bmatrix}
J_0 & 0 \\
0 & J_1 
\end{bmatrix}
$$ and multiply by a suitably dimensioned block matrix 
$$\begin{bmatrix}
A & B \\
C & D 
\end{bmatrix}
$$
The equality
$$
\begin{bmatrix}
A & B \\
C & D 
\end{bmatrix}
\begin{bmatrix}
J_0 & 0 \\
0 & J_1 
\end{bmatrix}
=
\begin{bmatrix}
J_0 & 0 \\
0 & J_1 
\end{bmatrix}
\begin{bmatrix}
A & B \\
C & D 
\end{bmatrix}
$$
holds iff all of


*

*$A$ commutes with $J_0$, 

*$D$ commutes with $J_1$, 

*$CJ_0 = J_1C$, and 

*$BJ_1 = J_0B$.  


So, in computing the dimension of the centralizer of $J$, considerations of $A, B, C, D$ are independent.  $A$ and $D$ contribute a dimension of $1$ each, but what about $C$ and $D$? that depends on the dimensions of the Jordan blocks....
Suppose $J_0$ is $m \times m$ and $J_1$ is $n \times n$.
You can show that the space of $m \times n$ matrices $M$such that $J_0 M = M J_1$ has dimension $\min(m,n)$.  There's a nice geometric argument for this, since the Jordan block operates by left multiplication as upward shift and by right multiplication as rightward shift.  This immediately forces the triangle underneath the main diagonal to be all $0$s, and for the rest of $M$ to be individually constant on the remaining diagonals, of which there are $\min(m,n)$.
Note that this result generalizes the fact that the centralizer of a nilpotent Jordan block has dimension $1$.
In the $2$ Jordan block example, if the blocks have dimensions $d_0$ and $d_1$, the dimension of the centralizer is $d_0 + 2\min(d_1, d_0) + d_1$.    
The $2$ Jordan block case easily generalizes. Suppose that the endomorphism has Jordan blocks $J_i$, $i=1\ldots r$, and that $J_i$ has dimension $d_i$. The dimension of the centralizer is given by
$$\sum\limits_{1\leq i,j \leq r} \min(d_i, d_j) - \sum\limits_{1\leq i \leq r} d_i$$ 
where the second sum just compensates for overcounting on the diagonal.
