Rank of matrix whose row sums are $0$ I have a matrix
$$\begin{bmatrix} 1-c_1&-c_2&-c_3 & \dots & -c_n\\-c_1&1-c_2&-c_3 & \dots & -c_n  \\ -c_1&-c_2&1-c_3 & \dots & -c_n \\ \vdots & \vdots & \vdots & \ddots & \vdots\\-c_1&-c_2&-c_3 & \dots & 1-c_n\end{bmatrix}$$
And $c_1 + \dots + c_n = 1$. Every $c_i \in (0,1)$. Then what is the rank of this matrix?

My attempt: I add column $2, 3, \dots, n$ to the first column. Then the first column changes to zero column. Thus the rank is at most $n-1$. I guess the rank is just $n-1$. But I don't know how to justify my guess.
 A: Let $M$ be the matrix. Write $\vec c = (c_1, \cdots, c_n)$. Then for all $v = (v_1, \cdots, v_n)^t$,
$$M v = v - (\vec c\cdot v) \vec 1,$$
where $\vec 1 = (1, \cdots, 1)^t$.
In particular, $Mv = v$ for all $v$ so that $\vec c \cdot v = 0$. Hence the rank is at least $n-1$. Together with your observation, the rank is exactly $n-1$.
A: $$ {\bf M} := \begin{bmatrix} 1-c_1&-c_2&-c_3 & \dots & -c_n\\-c_1&1-c_2&-c_3 & \dots & -c_n  \\ -c_1&-c_2&1-c_3 & \dots & -c_n \\ \vdots & \vdots & \vdots & \ddots & \vdots\\-c_1&-c_2&-c_3 & \dots & 1-c_n\end{bmatrix} = {\bf I}_n - {\bf 1}_n {\bf c}^\top $$
where ${\bf c}^\top {\bf 1}_n = 1$. Using the matrix determinant lemma, it is easy to compute the characteristic polynomial of $\bf M$.
$$ \det \left( s {\bf I}_n - {\bf M} \right) = \det \left( (s - 1) {\bf I}_n + {\bf 1}_n {\bf c}^\top \right) = \cdots = (s - 1)^n \left( 1 + \frac{{\bf c}^\top {\bf 1}_n}{s - 1} \right) = \cdots = \color{blue}{s (s - 1)^{n-1}} $$
Hence, the rank of matrix $\bf M$ is $n-1$.
