How do I compute the average distance of point inside an hypercube to the center of the hypercube as a function of the dimensionality of the space?
Here I consider the hypercube defined as $C_n=\{x\in\mathbb{R}^n: -\frac{1}{2}\leq x_i\leq\frac{1}{2}, \forall_{i\leq n}\}$ with center $(0, ..., 0)\in\mathbb{R}^n $
Since for a random point in $C_n$ we have that each component $X_i$ is uniformly distributed between $-\frac{1}{2}$ and $\frac{1}{2}$. And since all such components are independent, does it follow that:
$$E\left[\sqrt{\sum_{i=1}^n X_i^2}\right] = \sqrt{E\left[\sum_{i=1}^n X_i^2\right]}=\sqrt{\sum_{i=1}^n E\left[X_i^2\right]}=\sqrt{\sum_{i=1}^n \frac{1}{12}}=\sqrt{\frac{n}{12}}$$ ?
Edit: Of course my calculation is wrong! the square root of the expected value is not the expected value of the square root!
But the question remains: What is the correct expression?
If we don't have closed form, could we even try to get the value recursively?
as
$\begin{align} A(n) &= \int_0^{\frac{1}{2}}...\int_0^{\frac{1}{2}}\sqrt{x_1^2 + ... + x_n^2}dx_1...dx_n\\ &= \int_0^{\frac{1}{2}}...\int_0^{\frac{1}{2}}x_n\sqrt{\frac{x_1^2 + ... + x_{n-1}^2}{x_n^2}+1}dx_1...dx_n \\ &= \int_0^{\frac{1}{2}}x_n\left(\int_0^{\frac{1}{2}}...\int_0^{\frac{1}{2}}\sqrt{\frac{x_1^2 + ... + x_{n-1}^2}{x_n^2}+1}dx_1...dx_{n-1}\right)dx_n \\ &=? \int_0^{\frac{1}{2}}x_ng(A(n-1), x_n)dx_n \end{align}$
The volume of $C_n'$ is $1/2^n$, and we must divide by this volume. The innermost integrand is the distance formula.
– Zubin Mukerjee Mar 14 '19 at 19:06