Let $B$ be an all-ones matrix of dimension $n \times n$, and $I$ be the identity matrix of dimension $n \times n$. Define $A = \frac{1}{n}B - I$. For $n=3$, $A$ would yield
\begin{equation*} \begin{bmatrix} -2/3 & 1/3 & 1/3 \\ 1/3 & -2/3 & 1/3 \\ 1/3 & 1/3 & -2/3 \end{bmatrix}. \end{equation*}
How would one compute rank$(A)$ for any $n$?
I have noted that any row $r_i$ of $A$ can be written as a linear combination of the other $n-1$ rows. Specifically, $r_i = - \sum_{j\neq i} r_j$. This implies rank$(A) < n$, but I don’t know how to compute the exact rank of $A$.
Any hint would be appreciated.