Take the matrix $$ \begin{matrix} 1 & 1 & 1 & 1 \\ 1 & 1 & 1 & 1 \\ 1 & 1 & 1 & 1 \\ 1 & 1 & 1 & 1 \\ \end{matrix} $$
I tried to calculalte the eigenvalues of this matrix and got to a point where I found that the eigenvalues are: 1,0,2. but wolfarm says it has only 4 ad 0. I have no idea why.. wolfarm:
In addition, can this matrix be diagonalized?
Thanks!
my calculations:
I calculated its characteristic polynomial which is the determinant of the matrix A. \begin{matrix} 1-t & 1 & 1 & 1 \\ 1 & 1-t & 1 & 1 \\ 1 & 1 & 1-t & 1 \\ 1 & 1 & 1 & 1-t \\ \end{matrix} I got to det(t * Id - A) = t*(1-t)^2*(t-2) which means that the eigenvalues are 1,0,2 where did I go wrong?
This means that you made a mistake while computing the eigenvalues, so you should check your work and find what you did wrong.
Actually, you can solve this problem pretty easly. We're working on a four-dimensional vector space, and I guess that's $\mathbb{R}^4$ (or $\mathbb{C}^4$, not much difference in this case). If you consider the operator $f\in\mathcal{L}(\mathbb{R}^4)$ which matrix in the canonical basis $(e_1,e_2,e_3,e_4)$ of $\mathbb{R}^4$ is your matrix (call it $A$), we have $$4=\dim{\mathbb{R}^4}=\dim\ker{f}+\dim\text{Im}f$$
Notice that all the columns are the same: the image of each vector of the basis is $e_1+e_2+e_3+e_4$, which means that $\text{Im}f=\text{span}\{e_1+e_2+e_3+e_4\}$. Thus $\dim\text{Im}f=1$. Hence $\dim\ker{f}=3$. Thus $0$ is an eigenvalue and there exists three linearly independent vectors $v_1,v_2,v_3\in\mathbb{R}^4$ such that $Av_1=Av_2=Av_3=0$. $v_1$, $v_2$ and $v_3$ form a linearly independent list of eigenvectors corresponding to the eigenvalue $0$.
Finally, by inspection, you can see that $4$ is an eigenvalue. Indeed, notice that $f(e_i)=e_1+e_2+e_3+e_4$ for all $i\in\{1,2,3,4\}$. The image of each $e_i$ contributes by $1$ in the coordinates. So what happens if you take the sum? $f(e_1+e_2+e_3+e_4)=4(e_1+e_2+e_3+e_4)$. This shows that $4$ is an eigenvalue. Call $v_4=e_1+e_2+e_3+e_4$.
$(v_1,v_2,v_3,v_4)$ form a basis of $\mathbb{R}^4$ since there are $4$ vectors that are linearly independent ($v_4$ is linearly independent from the rest because it is an eigenvector with a different eigenvalue). This shows that $0,4$ are the only eigenvalues and that your matrix is diagonalizable.
Edit: As amd said in comments, we can solve the problem more easily: we found three linearly independent vectors that are eigenvalues of $A$ corresponding to the eigenvalue $0$, so there is at most one additional eigenvalue. The trace of $A$ is 4 but the sum of zeros is zeros. So $4$ must be an eigenvalue and thus $0$ and $4$ are the eigenvalues of $A$. Take any eigenvector $v_4$ corresponding to the eigenvalue $4$. $(v_1,v_2,v_3,v_4)$ is linearly independent, thus a basis of $\mathbb{R}^4$. Hence $A$ is diagonalizable.