What is the relationship between mean seperation and number of dimensions for uniformly distributed points?

11 Views Asked by At

If I have uniformly distributed points in an N-dimensional space with a range of 0 to L in each dimension what is the relationship between the mean euclidean separation and N?

I found Average Distance Between Random Points on a Line Segment which is the 1D case and makes sense, but I am struggling to generalize to N dimensions.

I have plotted empirically results for L = 1.0 but it is not of a simple form to fit (at least not a form I tried). I do not have the reputation to post an image but this is the Python code to produce the chart.

import matplotlib.pyplot as plt
from numpy import float32
from numpy.random import uniform
from scipy.spatial.distance import cdist
from tqdm import trange

POPULATION = 100
MIN = 0.0
MAX = 1.0
DIMS = 2048

data = []
for d in trange(1, DIMS + 1, ascii=True):
    p = uniform(MIN, MAX, (POPULATION, d)).astype(float32)
    s = cdist(p, p, 'euclidean').sum() / (POPULATION * (POPULATION - 1))
    data.append(s)

fig = plt.figure(figsize=(12, 12))
ax = fig.add_subplot(1,1,1, title='Mean Euclidean Distance between Uniformly Distributed Points')
ax.plot(data)
ax.set_xlabel('Number of Dimensions')
ax.set_ylabel('Mean Distance')
plt.show()