Why is the determinant of the all one matrix minus the identity matrix n-1?

$1_n$ has eigenvalues $n$ with multiplicity $1$ and $0$ with multiplicity $n-1$, so $1_n - I_n$ has eigenvalues $n-1$ with multiplicity $1$ and $-1$ with multiplicity $n-1$. The determinant is the product of the eigenvalues, thus $(-1)^{n-1} (n-1)$.


\begin{align}\det (1_n-I_n)&=(-1)^{n}\det(I_n-1_n) \\ &=(-1)^n\det(I_n-ee^T)\\ &=(-1)^n(1-e^Te)\det(I_n)\\ &=(-1)^{n+1}(n-1)\end{align}

where I have used matrix determinant lemma in the third equality.


Here is a matrix (here with $n=10$) with columns that are eigenvectors of your (symmetric) matrix. Indeed, given any constants $\alpha, \beta,$ this shows a basis of eigenvectors for $\alpha I_n + \beta \, 1_n$

Note that $P$ is not orthogonal, although the columns are pairwise orthogonal. $$ P = \left( \begin{array}{rrrrrrrrrr} 1 & -1 & -1 & -1 & -1 & -1 & -1 & -1 & -1 & -1 \\ 1 & 1 & -1 & -1 & -1 & -1 & -1 & -1 & -1 & -1 \\ 1 & 0 & 2 & -1 & -1 & -1 & -1 & -1 & -1 & -1 \\ 1 & 0 & 0 & 3 & -1 & -1 & -1 & -1 & -1 & -1 \\ 1 & 0 & 0 & 0 & 4 & -1 & -1 & -1 & -1 & -1 \\ 1 & 0 & 0 & 0 & 0 & 5 & -1 & -1 & -1 & -1 \\ 1 & 0 & 0 & 0 & 0 & 0 & 6 & -1 & -1 & -1 \\ 1 & 0 & 0 & 0 & 0 & 0 & 0 & 7 & -1 & -1 \\ 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 8 & -1 \\ 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 9 \end{array} \right). $$ You get an evident basis of eigenvectors, so you can tell the eigenvalues.

The columns of $P$ are of varying lengths; dividing each by its length does give an orthogonal matrix.

For $n=4$

$$ P = \left( \begin{array}{rrrr} 1 & -1 & -1 & -1 \\ 1 & 1 & -1 & -1 \\ 1 & 0 & 2 & -1 \\ 1 & 0 & 0 & 3 \end{array} \right). $$