1. (K-means clustering) Show that
$$\sum_{k=1}^{K} \sum_{i \in C_k} d(X_i, \bar{X}_k) \geq \sum_{j=1}^{K} \sum_{i \in C'_j} d(X_i, \bar{X}'_j),$$
where $d$ is the squared Euclidean distance, $\bar{X}_k \in \mathbb{R}^p$ is the centroid of the cluster determined by $C_k$,
$C'_j = \{i : d(X_i, \bar{X}_j) = \min_{k=1,...,K} d(X_i, \bar{X}_k)\}$ and $\bar{X}'_j$ is the centroid of the cluster determined by $C'_j$. Note
that this inequality guarantees the convergence of the K-means algorithm. (Hint: writing $C_k = \bigcup_{j=1}^{K} (C_k \cap C'_j)$
is a good starting point).