# Relation: average (squared) distance to all points, and (squared) distance to centroid

Suppose a set of $n$ high-dimensional points is given. It is known that the sum of all pair-wise squared Euclidean distances is proportional to sum of squared distances of all points to the centroid.

However, given a specific point $a$, in what relation is the sum of squared Euclidean distances from $a$ to all other points, and the square Euclidean distance of $a$ from the centroid of all points (including $a$).

-

## 1 Answer

Since $(x-a)^2=(x-m+m-a)^2=(x-m)^2+(m-a)^2+2(x-m)(m-a)$ and the sum of the last term over all points $x$ vanishes by the definition of the centroid $m$, the sum over the squared distances from $a$ is the sum over the squared distances from the centroid plus $n$ times the square of the distance from $a$ to the centroid. This holds irrespective of whether $a$ is itself one of the points.

See also the parallel axis theorem.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 12, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9371837973594666, "perplexity_flag": "head"}