Tell me more ×
Computational Science Stack Exchange is a question and answer site for scientists using computers to solve scientific problems. It's 100% free, no registration required.

Given $d$-dimensional coordinates residing in a matrix $X\in\mathbb{R}^{n\times d}$, the Euclidean distance between items $i$ and $j$ is denoted as $g_{ij}$. Let $c\in\mathbb{R}^d$ denote the centroid of the configuration $X$. Is it possible to establish a relation between $$\sum_{i,\, j} g_{ij}^2,$$ and $$\sum_{i=1}^n g_{ic}^2,$$where $g^2$ is a squared Euclidean distance? My solution shows that the first is $2n$ times the second. Is this correct?

share|improve this question

1 Answer

up vote 1 down vote accepted

Yes. Assume wlog that the centroid is at zero. Then $\sum_i x_i=0$, whence $\sum_{i,j} g_{ij}^2 = \sum_{i,j}\|x_i-x_j\|^2=\sum_{i,j}\|x_i\|^2-2\sum_{i,j}x_i^Tx_j+\sum_{i,j}\|x_j\|^2$. This simplified to $n\sum_i|x_i\|^2-0+n\sum_j\|x_i\|^2=2n\sum_{i}\|x_i\|^2$.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.