# Eigenvalues for all 1's matrix doubt.

Let $$J_{n \times n}$$ be the all $$1$$'s matrix. Then find the eigenvalues of $$J$$.

I searched around the net, was able to find the following proof:

Proof. Clearly, $$J$$ has rank $$1$$. Hence there is one non-zero eigenvalue of $$J$$ equalto $$n$$. And other eigenvalue is $$0$$ with multiplicity $$n-1$$.

Question: How to find the the number of non-zero eigenvalues using the rank of a matrix, and how is it concluded to be $$n$$?

The rank is $$1$$, as the columns of the matrix are spanned by a single non-zero vector, specifically $$\operatorname{colspace}(J_{n \times n}) = \operatorname{span}\left\{\begin{bmatrix} 1 \\ 1 \\ \vdots \\ 1 \end{bmatrix}\right\}.$$ This implies the columnspace is $$1$$-dimensional, and this dimension is the rank (by definition.

The Rank-Nullity theorem implies that the nullspace of $$J_{n \times n}$$ is of $$n - 1$$ dimensions. The nullspace is the subspace of vectors $$x$$ such that $$Jx = 0 = 0x$$, which is to say, the eigenspace corresponding to $$\lambda = 0$$. This means, we may find $$n - 1$$ linearly independent eigenvectors for $$J$$.

So, now we are left with two possibilities. Either, we have another non-zero eigenvalue, or we have only $$0$$ as our eigenvalue, with multiplicity $$n$$. The latter possibility would mean that $$J$$ is not diagonalisable, but it could be a possibility considering only the previous calculations (this can be very quickly rejected, since $$J$$ is symmetric!).

At this point, we just need a good guess as to the eigenvalue, or indeed, an eigenvector. It's not hard to see that

$$\begin{bmatrix} 1 & 1 & \cdots & 1 \\ 1 & 1 & \cdots & 1 \\ \vdots & \vdots & \ddots & \vdots \\ 1 & 1 & \cdots & 1 \end{bmatrix}\begin{bmatrix} 1 \\ 1 \\ \vdots \\ 1 \end{bmatrix} = n\begin{bmatrix} 1 \\ 1 \\ \vdots \\ 1 \end{bmatrix}.$$

This confirms, by definition, that there is another eigenvalue: $$n$$. We now have the complete picture: there are two eigenvalues; $$0$$ with multiplicity $$n - 1$$ and $$n$$ with multiplicity $$1$$.

If the matrix is diagonalizable, then the rank of a matrix must equal the number of nonzero eigenvalues. The rank defines the dimension of the Image space (how many nonzero basis vectors span the space $$J\vec{v}$$ for any $$\vec{v}$$), so you run out of linearly independent vectors that aren't mapped to zero.

In this case, you can just guess the eigenvector (due to symmetry, it will be 1,1,1,1,1....), multiply it by $$J$$, and see that it gets multiplied by $$n$$.

The other way of calculating this would be to use the fact that the trace of the matrix equals the sum of all eigenvalues. The trace is $$n$$, then so must be the only nonzero eigenvalue.