<s>[INST] Finding determinant of a simple matrix Can someone please explain how to compute the determinant of $J_n - I_n$ where $j_n$ it a matrix of ones?
E.g. for $n=5$ we get the following matrix
$$\left(\begin{array}{ccccc}
0 & 1 & 1 &1 &1 \\
1 & 0 & 1 &1 &1 \\
1 & 1 & 0 &1 &1 \\
1 & 1 & 1 &0 &1 \\
1 & 1 & 1 &1 &0 \end{array} \right)$$
By computing it for the first few $n$'s it seems to be $(-1)^{n+1}(n-1)$ but I couldn't prove it.
 [/INST] Let us put
$$
D =\left|\begin{array}{ccccc}
0 & 1 & 1 &1 &1 \\
1 & 0 & 1 &1 &1 \\
1 & 1 & 0 &1 &1 \\
1 & 1 & 1 &0 &1 \\
1 & 1 & 1 &1 &0 
\end{array} \right|
$$
Performing the operation $L_1 \gets \sum_{k=1} L_k$ and putting $m=n-1$, we obtain
$$
D =\left|\begin{array}{ccccc}
m & m & m &m &m \\
1 & 0 & 1 &1 &1 \\
1 & 1 & 0 &1 &1 \\
1 & 1 & 1 &0 &1 \\
1 & 1 & 1 &1 &0 
\end{array} \right|=
m\left|\begin{array}{ccccc}
1 & 1 & 1 &1 &1 \\
1 & 0 & 1 &1 &1 \\
1 & 1 & 0 &1 &1 \\
1 & 1 & 1 &0 &1 \\
1 & 1 & 1 &1 &0 
\end{array} \right|
$$
Performing $L_j \gets L_j-L_1$ for all $j\gt 1$, we obtain
$$
D =
m\left|\begin{array}{ccccc}
1 & 1 & 1 &1 &1 \\
0 & -1 & 0 &0 &0 \\
0 & 0 & -1 &0 &0 \\
0 & 0 & 0 &-1 &0 \\
0 & 0 & 0 &0 &-1 \\
\end{array} \right|
=m(-1)^m
$$
as you expected.
</s>