What are the possible values of the sum of the dimensions of the eigenspaces of an $n \times n$ matrix over $\mathbb{R}$? My question has two parts: First, given an $n$th degree polynomial $p$ over $\mathbb{R}$, is there necessarily an $n\times n$ matrix whose characteristic polynomial is $p$? If so, then would it be correct to conclude that the sum of the dimensions of the eigenspaces of an $n\times n$ matrix can be any number between $0$ and $n$ if $n$ is even, and any number between $1$ and $n$ if $n$ is odd? And if not, then is the above conclusion nevertheless true?
 A: Characteristic polynomials are always monic. Given a monic $n$-th degree polynomial $p(x)$ over $\mathbb{R}$, there is always a matrix with $p(x)$ as characteristic polynomial, and that matrix is not difficult to construct. If all the roots $(x_1,\ldots,x_n)$ of $p(x)$ are real, then trivially the diagonal matrix
$$\left(\begin{matrix} x_1 & 0   & \cdots & 0 \\
                       0   & x_2 & \cdots & 0 \\
                       \vdots & \ddots & \ddots & \vdots \\
                       0 & \cdots & 0 & x_n \end{matrix}\right)$$
has characteristic polynomial $p(x)$. If some of the roots of $p(x)$ are complex, then they come in complex conjugate pairs. For a pair $(z, z^*)$, the matrix
$$B_z=\left(\begin{matrix}\mathrm{Re}\ z & -\mathrm{Im}\ z \\ \mathrm{Im}\ z & \mathrm{Re}\ z\end{matrix}\right)$$
has characteristic polynomial
\begin{align*}
\det (xI-B_z) & = x^2-2\left(\mathrm{Re}\ z\right) x + |z|^2 \\
            & = (x-z)(x-z^*).
\end{align*}
The determinant of a block-diagonal matrix is the product of the determinants of the blocks. So for any polynomial $p(x)$, you can construct a real matrix $n$ with characteristic polynomial $p(x)$ using the following steps:

*

*Find the roots of $p(x)$

*For every complex-conjugate pair of roots $(z,z^*)$, construct the corresponding $2\times 2$ matrix $B_z$.

*Construct the desired $n\times n$ matrix as a block-diagonal matrix whose blocks are all the real roots of $p(x)$ and all the $B_z$:

$$\left(\begin{matrix}x_1 & & & & & 0 \\ & \ddots & & & & \\ & & x_m & & & \\ & & & B_{z_1} & & \\  & & & & \ddots & \\ 0 & & & & & B_{z_k} \end{matrix}\right).$$
The conclusion is correct: a real $n\times n$ matrix with odd $n$ always has at least one real eigenvalue, and therefore at least one eigenspace with dimension $1$.
A: - given an nth degree polynomial p over R, is there necessarily an n×n matrix whose characteristic polynomial is  p ?
Yes, you can take the companion matrix associated with that polynomial.
https://en.wikipedia.org/wiki/Companion_matrix
Other examples can be a block diagonal matrix using 1x1 block for real eigenvalues and 2x2 block for the complex eigenvalues.
- If so, then would it be correct to conclude that the sum of the dimensions of the eigenspaces of an n×n matrix can be any number between 0 and n if n is even, and any number between 1 and n if n is odd?
I would say it's true for a real matrix, however be careful when you want to proove it from characteristic polynomial because the multiplicity of the roots of the characteristic polynomial are not always equal to the dimension of the corresponding eigenspace. It is probably easier to give a matrix for each case...
A: Hint: Have you seen this matrix ?
$\begin{pmatrix}  0 & \cdots & 0& -a_{0} \\  1 & \cdots & 0 & -a_{1}\\ \vdots &\ddots & \vdots &\vdots \\ 0 &\cdots & 1 & -a_{n-1} \end{pmatrix}$
Eigen space $E_{\lambda} \subset \Bbb{R^n}$ and sum of the eigen space is direct sum.
Hence,  sum of the dimensions of the eigenspaces of  an $n×n $ matrix is always $\le n$.
