= Solution
<Sylvester's law of inertia> says that any real <quadratic form> has coordinates in which it is a sum of $p$ positive squares minus $m$ negative squares, with $z$ unused coordinates, and that the numbers $(p,m,z)$ are invariant under every invertible linear change of coordinates. Its <rank> is $p+m$; its <signature of a quadratic form> is commonly $p-m$, with $(p,m)$ also called its signature pair.
The <symmetric matrix> here is $J-I$, where $J=\boldsymbol1\boldsymbol1^T$ and $\boldsymbol1=(1,\ldots,1)^T$. On the line spanned by $\boldsymbol1$, $J-I$ has <eigenvalue> $n-1$. If $\sum_i x_i=0$, then $Jx=0$, so that the <orthogonal complement> has <eigenvalue> $-1$ with multiplicity $n-1$. Thus the <off-diagonal all-ones quadratic form> has
$$
\boxed{\operatorname{rank}q=n,\quad(p,m,z)=(1,n-1,0),\quad\sigma=2-n\qquad(n>1).}
$$
For $n=1$ the form vanishes, so \b[<rank> and scalar signature are both zero], with inertia $(0,0,1)$. Including this case is necessary because the distinguished <eigenvalue> then becomes zero.
Back to article page