# How to find the determinant of the following square matrix

It has been a while with linear algebra. Can someone give a hint to find the determinant of a $$n\times n$$ matrix where the non-diagonal elements are $$1$$:

$$M= \ \begin{bmatrix} -\lambda & 1 & .. & 1 \\ 1 & -\lambda & .. & 1 \\ .. & .. &.. & ..\\ 1 & 1 & 1 & -\lambda \end{bmatrix} \$$

There is a Leibniz formula for the det of $$n\times n$$ matrices which is:

$$\det(A) = \sum_{\sigma \in S_n} \left( \text{sgn}(\sigma) \prod_{i=1}^n a_{i,\sigma_i}\right)$$

Applying this, I can see that:

$$\det(M) = \text{sgn}(fp_0)n_{fp_0} +\text{sgn}(fp_1)n_{fp1} \times (-\lambda) +...+\text{sgn}(fp_{n-1}) n_{fp_{n-1}}\times (-\lambda)^{n-1}$$

where $$n_{fp_i}$$ is the number of permutations with $$i$$ fixed points and $$\text{sgn}(fp_i)$$ is the sign of all such permutations. Is this logic going to lead to the answer? Thanks.

Hint: the matrix $$\begin{bmatrix}1 & 1 & \cdots & 1 \\ 1 & 1 & \cdots & 1 \\ \vdots & \vdots & \ddots & \vdots\\ 1 & 1 & \cdots & 1\end{bmatrix}$$ is diagonalizable, with eigenvalue $$0$$ of multiplicity $$n-1$$, and eigenvalue $$n$$ of multiplicity $$1$$. So $$\det\begin{bmatrix}1-\lambda & 1 & \cdots & 1 \\ 1 & 1-\lambda & \cdots & 1 \\ \vdots & \vdots & \ddots & \vdots\\ 1 & 1 & \cdots & 1-\lambda\end{bmatrix} = (-\lambda)^{n-1}(n-\lambda).$$
• Thanks, may I know why it is clear that the matrix of $1$'s has those eigenvalues with those multiplicities because the usual way of diagonalizing a matrix is by finding the eigenvalues first and for that we ought to know that the second equation is true beforehand.
• Let $a:=\begin{bmatrix}1&\cdots&1\end{bmatrix}$. Then the all-one matrix is $a^T\cdot a$ making it a dyadic product. They all have only one rank, as every input is projected onto one basis vector (the all-one vector). Commented Oct 29, 2019 at 7:04
• The vector $a$ has $\|a\|_2 = \sqrt{n}$. To scale them to unit length, you pull this factor from both $a$ and $a^T$ giving you a scalar $n$ in the middle. This is your eigenvalue. Commented Oct 29, 2019 at 7:16
• You can finish by a change of variable $-\lambda' = 1-\lambda$. Commented Oct 29, 2019 at 10:05