Why is a square matrix with $n-1$ eigenvalues not diagonizable? I am told that there exists a square matrix $A$, of size $n \times  n$.
I am given the characteristic polynomial to be $(x-2)(x-2)(x+4)(x-4)$.
Since the highest degree is $4$, I assume that $A$ must be of size $4 \times 4$. Since the characteristic polynomial only has $3$ distinct roots (eigenvalues), I can see that it is not diagonizable. But why does not having n distinct roots make it not diagonizable?
 A: $$\begin{bmatrix} 2 & 0 & 0 & 0 \\ 0 & 2 & 0 & 0 \\ 0 & 0 & 4 & 0\\ 0 & 0 & 0 & -4\end{bmatrix}$$
is diagonalizable.
$$\begin{bmatrix} 2 & 1 & 0 & 0 \\ 0 & 2 & 0 & 0 \\ 0 & 0 & 4 & 0\\ 0 & 0 & 0 & -4\end{bmatrix}$$
is not.
For the matrix to be diagonalizable, check that for each eigenvalue, the geometric multiplicity is equal to tbe algebraic multiplicity.
Having distinct eigenvalues implies that a matrix is diagonalizable but the converse is not true.
A: You are right saying that the degree of the characteristic polynomial is equal to the dimension of the matrix. However, they are plenty of diagonalizable matrices with non-distinct eigenvalues, e.g. any homothety. Regarding your precise case, a diagonal matrix with entries $2,2,-4,4$ has the given characteristic polynomial and is diagonalizable.
If your point is that there exists a non-diagonalizable matrix with characteristic polynomial $$(x-2)^2(x-4)(x+4)$$
then this is certainly true taking:
$$\begin{pmatrix}2&1&0&0\\0&2&0&0\\0&0&4&0\\0&0&0&-4\end{pmatrix}.$$
A: It's false: the matrix
$$\begin{bmatrix}2&0&0&0\\0&2&0&0\\
0&0&4&0\\
0&0&0&-4\end{bmatrix}$$
has the same characteristic polynomial and is diagonal. So if your matrix is not diagonalisabl, there must be someting else.
What is true is that a matrix with simple eigenvalues is diagonalisable.. Hence, if it's not, it must have multiple eigenvalues.
A: A matrix can have 3 distinct and be diagonalizable, take as example the matrix that ha value $(2,2,4,-4)$ in the diagonal, and $0$ otherwise. 
What happens is that to a matrix be diagonalizable, it deppend not of the characterisct polynomial, but actually of it's minimal polynomial, a matrix will not be diagonalizable if and only if all roots of the minimal polynomial are distinct.
If you want to know more about that you should look for Jordan Canonical Form of a matrix.
