Q:

Clustering Proof of Equation

Greetings! Could anyone enlighten me about the validity of this equation? I'm trying to prove it without success. $K$ is the number of clusters, $C_i$ is the $i$-th cluster, $m_i$ is the number of objects of $i$-th cluster and m is the total number of objects. Thanks in advance!

A:

Via a couple of algebraical tricks, you'll have your zero only if $\mu_i$ and $\mu$ are the means, not the counts:
$$\begin{align}S&=\sum_{i=1}^K\sum_{x\in C_i}(x-\mu_i)\cdot(\mu-\mu_i)\\&=\sum_{i=1}^K\overbrace{\left(\sum_{x\in C_i} (x-\mu_i)\right)}^0\cdot (\mu-\mu_i)\\&=0\end{align}$$
If it were the counts, letting $x_1=1\in C_1,x_2=-1\in C_2$ will cause invalidity of the equation shown. The equation is also shift-variant if $m$ are counts.

