What are the eigenvalues?

Let A be the complex square matrix of size $2018$ whose diagonal entries are all $−2018$ and off-diagonal entries are all $1$. What are the eigenvalues of A and their geometric multiplicities?

My solutions : First i construct the matrix $$A= \begin{pmatrix} -2018 & 1 & \cdots & 1 \\ 1 & -2018 & \cdots & 1 \\ \vdots & \vdots & \ddots & \vdots \\ 1 & 1 & \cdots & -2018 \end{pmatrix}_{2018 \times 2018}$$

After that i find $(\lambda I-A_{2018}) =(\lambda+2019)^{2017}(\lambda +4037)$

as eigenvalue are $\lambda = -2019$ with geometric multiplicity $2017$

And $\lambda = -4037$ with geometric multiplicity $1$

Is my solution is correct or not ? Pliz tell me

If my solution is not correct then any hints/solution will be appreciated

• If you add $1$ to the diagonal, and multiply the result by the vector $(1,1,...,1)^T$ you get $0$. Therefore $-1$ is an eigenvalue. I think you started subtracting $1$ several times to $-2019$, instead of adding. That is why you got that $-4037$ instead of $-1$. – user551819 May 1 '18 at 12:12
• The pattern I extract from Wolfram Alpha results is that the eigenvalues of the $n \times n$ version of this problem are $-(n+1)$ with multiplicity $n-1$ and $-1$ with multiplicity $1$. Since the matrix is symmetric, you should be able to prove this by computing the eigenvector with eigenvalue $-1$ (this is easy as @totoro pointed out already) and then working with the orthogonal complement of that eigenspace (on which the matrix should be a multiple of the identity). – Ian May 1 '18 at 12:16
• @Ian All eigenvectors are easy to compute. When one adds $2019$ to the diagonal one gets a matrix in which all entries are ones. Therefore, multiplying this by a vector one gets a vector in which all coordinates are the sum of the original vector. Therefore, the eigenspace is the kernel of the functional $(x_1,x_2,...,x_{2018})^T\mapsto \sum_{k=1}^{2018}x_k$, which has dimension $2018-1$ – user551819 May 1 '18 at 12:21
• That is what I meant: cut out the eigenspace for -1 and then restrict to its orthogonal complement (the set with sum 0). You can then work with this restriction by shifting everything so that the matrix looks like the all 1s matrix, which just acts as 0 on that subspace, then undo the shift to obtain the eigenvalue. – Ian May 1 '18 at 12:27
• Thanksa lots@totoro,, – jasmine May 1 '18 at 16:40

In general if $$B$$ is a matrix with all eigenvalues exist, then eigenvalues of $$B+\lambda I$$ is same as eigenvalues of $$B$$ + eigenvalues of $$\lambda I$$.
Actually your matrix can be written as $$\begin{pmatrix} 1 & 1 & \cdots&1\\1& 1 & \cdots &1 \\ \vdots & \cdots & \cdots & \vdots\\1 & 1& \cdots &1 \end{pmatrix}+(-2019)\begin{pmatrix} 1 & 0 & \cdots&0\\0& 1 & \cdots &0 \\ \vdots & \cdots & \cdots & \vdots\\0 & 0& \cdots &1 \end{pmatrix}=B+(-2019)C$$ Now $$B$$ is a rank $$1$$ matrix and so eigenvalues of $$B$$ are $$0(2017 \;\text{times})\; \text{and}\;2018(=\text{trace})$$
Eigenvalues of $$C$$ are $$-2019( 2018 \;\text{times})$$
So eigenvalues of $$B+(-2019)C$$ are $$0+(-2019),$$ $$0+(-2019),$$ $$\vdots$$ $$0+(-2019)$$ $$2018+(-2019)$$ so $$\sigma\Big( B+(-2019)C\Big)=\{-2019,-1\}$$