# Find the determinant when all entries are $1$ except for zeroes on the main diagonal

Let $J_n$ be an $n\times n$ matrix all of whose entries are $1$, and $I_n$ be the identity matrix. Define $$K_n = J_n-I_n$$

For $n=1$ to $5$ my (usually unreliable!) hand calculations suggest that

$$\det K_n = (-1)^{n-1}(n-1)$$

Question

(a) are these values correct? (b) is the generalization to any positive integer $n$ valid? (c) if (b) is true, how can the result be demonstrated?

My only idea so far is to use the product of eigenvalues:

$$\det K_n = \prod_{j=1}^n \lambda_j$$

($-1$ is an eigenvalue for all $n$)

Any assistance much appreciated.

(note: a similar question concerning skew-symmetric matrices Determinant of a special skew-symmetric matrix may contribute some relevant ideas. or perhaps Determinant of a matrix with $t$ in all off-diagonal entries. has greater relevance)

This is the adjacency matrix of the complete graph $K_n$. The eigenvalues are $\lambda_1 = (n - 1)$ and $\lambda_2 = \dots = \lambda_n = -1$.

The eigenvector for $\lambda_1$ is the vector $\pmb{1}$ consisting of all $1$s.

An eigenbasis for $\lambda_2,\dots,\lambda_n$ is given by $e_1 - e_j$. Note that

$$(J_n - I_n)(e_1 - e_n) = \pmb{1}\pmb{1}^T(e_1 - e_j) - (e_1 - e_j) = - (e_1 - e_j).$$

This is because $J_n = \pmb{1}\pmb{1}^T$ and $\pmb{1}^Te_i = 1$ for all basis vectors $e_i$.

The fact that $n - 1$ is an eigenvalue reflects the fact that $K_n$ is an $(n - 1)$-regular graph. There may also be a combinatorial interpretation for the other eigenvalues but I don't know enough algebraic graph theory to say.

• thank you. very nice insight re the complete graph. – David Holden Jul 23 '17 at 3:34

$$\begin{array}{rl} \det ( 1_n 1_n^\top - \mathrm I_n ) &= \det ( -( \mathrm I_n - 1_n 1_n^\top ) )\\ &= (-1)^n \cdot \det(\mathrm I_n - 1_n 1_n^\top)\\ &= (-1)^n \cdot \det ( 1 - 1_n^\top 1_n )\\ &= (-1)^n \cdot (1-n)\\ &= (-1)^{n-1} \cdot (n-1)\end{array}$$

• really nice answer, thanks, and very educational for me. i hadn't encountered the determinant identity before, so this has clarified the meaning of the Schur complement - a concept which i encountered in reading recently without understanding its purport. have already accepted another answer, but yours is a very nice application of a powerful result to my rather simple question. thanks again! – David Holden Jul 23 '17 at 14:33

Finding the eigenvalues of a matrix $A$ that has $a$ along its main diagonal and $b$ everywhere else comes up fairly often on this site, but I’ll repeat the calculation here. Write the matrix as $A=b\mathbb1+(a-b)I$, where $\mathbb 1$ is the $n\times n$ matrix with every entry equal to $1$. Suppose $v$ is an eigenvector of $A$. We then have $b\mathbb1v=(\lambda-a+b)v$, so $v$ is also an eigenvector of $b\mathbb1$. Moreover, the eigenvalues of this matrix and those of $A$ differ by $a-b$. Now, for $b\ne0$, $b\mathbb1$ has rank 1, so its eigenvalues are $0$ with multiplicity $n-1$ and, using the fact that the trace of a matrix is equal to the sum of its eigenvalues, $nb$ with multiplicity 1. (You could also find the non-zero eigenvalue by noticing that all of the row sums are identical.) This means that the eigenvalues of $A$ are $a+(n-1)b$ and $a-b$, giving $$\det A=(a+(n-1)b)(a-b)^{n-1}.$$ For your matrices, $a=0$ and $b=1$, so $\det{K_n}=(-1)^{n-1}(n-1)$, just as you’ve calculated.

• thanks very much! another very enlightening answer, and very nicely explained. each of the three answers given here has helped me to expand my rather limited understanding of linear algebra. – David Holden Jul 25 '17 at 3:07