The formula for the standard deviation of n numbers is the same as the formula for the distance between two points in n dimensions. Could someone explain why this is and how these are related?
Any set in which you can define a ‘distance’ function which satisfies a few properties (distances are positive, symmetric, and additive). Is called a Metric space. Rk is a metric space with the distance function typically defined to be d(x,y)=|x−y|, the norm of the difference (although we can use whatever distance function we want as long as it satisfies the 3 properties, more on that later).
The norm is defined to be |x|=√∑ni=1x2i. That right there looks strangely familiar you might think. So if you have some observed values x=x1,…,xn and if we find the distance between your observed values and their mean, μ we have d(x,μ)=|x−μ|=√∑ni=1(xi−μ)2 which is almost like the standard deviation (missing a 1/n or 1/(n−1). However, we can easily redefine our distance function to be something like d(x,y)=+√1/n|x−y| and it will still have the three properties required to make Rk a metric space.
You might be more familiar with distances in a 2-dimensional space like R2. In this space we can use the same distance function as above, but since instead of k components we have only 2 the formula simplifies to d((x1,y1),(x2,y2))=√(x1−x2)2+(y1−y2)2