Expected distance in R^n

Calculus Level 3

A point is picked uniformly at random from the surface of an n n -dimensional unit hypercube centered at the origin.

What is the minimum n n for which the expected distance from the point to the origin is greater than 1?


The answer is 11.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

4 solutions

David Vreken
Sep 8, 2018

Note: This is not a complete solution, but shows that n n has a lower limit of n 11 n \geq 11 . Thanks to @Brian Moehring for his comments and pointing me to Jensen's inequality.


In n n -dimensional space, the distance from the origin to a point ( p 1 , p 2 , , p n ) (p_1, p_2, \dots, p_n) is d = p 1 2 + p 2 2 + + p n 2 d = \sqrt{p_1^2 + p_2^2 + \dots + p_n^2} .

A point that is on an n n -dimensional unit hypercube centered at the origin will have one coordinate that is exactly ± 1 2 \pm \frac{1}{2} and all the other coordinates ranging between [ 1 2 , 1 2 ] [-\frac{1}{2}, \frac{1}{2}] .

By symmetry, we only need to consider p 1 = 1 2 p_1 = \frac{1}{2} , and the squares of the expected values of the other coordinates p 2 p^2 can be found by calculating the value of 1 2 1 2 p 2 d p 1 2 1 2 = 1 12 \frac{\int_{-\frac{1}{2}}^{\frac{1}{2}} p^2 dp}{\frac{1}{2} - -\frac{1}{2}} = \frac{1}{12} .

Therefore, by Jensen's inequality , the expected distance from a point on the surface of this n n -dimensional cube to the center is E d < ( 1 2 ) 2 + ( n 1 ) 1 12 \mathbb{E}d < \sqrt{(\frac{1}{2})^2 + (n - 1)\frac{1}{12}} which has a greater minimum value of 1 1 for n 11 n \geq \boxed{11} .

This is actually the way I initially thought about it, but it's not completely valid. It's a fair amount more difficult because d d isn't linear wrt the p i 2 p_i^2 (due to the square root). The closest we can get to evaluating it that way (without more complicated steps) is Jensen's inequality, which yields E d < 1 4 + ( n 1 ) 1 12 min E d > 1 n 11 \mathbb{E}d < \sqrt{\frac{1}{4} + (n-1)\frac{1}{12}} \implies \min_{\mathbb{E}d > 1} \, n \geq 11

Brian Moehring - 2 years, 9 months ago

Log in to reply

If random generator served me well, the approximate mean distance using Monte Carlo integration for n=10 is: <d>=0.9936±0.0005, which is different to the above solution of <d>=1.

Darko Simonovic - 2 years, 9 months ago

Log in to reply

That's perfectly in line with the estimate given by Jensen's ineq. Were you able to run it for n=11?

Brian Moehring - 2 years, 9 months ago

Log in to reply

@Brian Moehring Yes. The mean distance is <d>=1.0346 with std of 0.00004 (5 sigma should suffice).

Darko Simonovic - 2 years, 9 months ago

You're right! I edited my solution to use Jensen's inequality.

David Vreken - 2 years, 9 months ago

I might be wrong, but I believe you'll still have to prove that E ( d ) > 1 E(d)>1 for n=11.

Darko Simonovic - 2 years, 9 months ago

Log in to reply

Right, I noted that it is an incomplete solution because of that.

David Vreken - 2 years, 9 months ago
Darko Simonovic
Sep 10, 2018

I struggled with integration by hand, and then decided to do simple Monte Carlo integration. Included in the code are estimates for the error (as standard deviation). ± 5 σ \pm 5\sigma should be more than enough of an error bar. To be rigorous, one should form and test a hypothesis, but here the error bars are way to small for tests to have any practical significance.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
%% Monte Carlo integration. Problem: Mean distance to a face of a hypercube
N_samples=1000000;
Max_dim=20;
r=rand(N_samples,Max_dim)-0.5;
r(:,1)=0.5;
d=sqrt(cumsum(r.^2,2));
m=mean(d);
s=std(d)/sqrt(N_samples);
fprintf('Number of dim.  Mean distance  Standard deviation\n')
fprintf('%8d   %14.4f   %14.5f\n', [(1:Max_dim)', m', s']')

Vinod Kumar
Sep 12, 2018

Considering that the faces of n-hypercube are in dimension of (n-1) hypercube and knowing that the average distance from center of the n- hypercube to any other point inside the cube is √(n/12). the average distance from the center of the n-hypercube to any point on the surface of the n-hypercube is given by

√(1/4 +(n-1)/12) > 1, gives n >10.

Answer=11.

Can you elaborate on "average distance from centre...". It doesn't seem to hold for n=1.

Darko Simonovic - 2 years, 9 months ago

Log in to reply

I think it's asymptotic.

Vilim Lendvaj - 2 years, 9 months ago
K T
Sep 16, 2018

Align the cube with coordinate system. Fix one of the coordinates of out point to the value 1/2, so that it is at the surface. The distance squared to the origin is the summed square over the coordinates. Very conveniently, there is no interaction between the coordinates in this problem. So the fixed coordinate contributes ( 1 2 ) 2 = 1 4 (\frac{1}{2})^2=\frac{1}{4} to the squared distance. Any other coordinate may range between -1/2 and 1/2 and thus contributes on average 1 / 2 1 / 2 x 2 d x 1 2 1 2 = 1 12 \frac{\int_{-1/2}^{1/2}x^2dx}{\frac{1}{2}- \frac{-1}{2}} = \frac{1}{12} to the squared distance. We need 10 other coordinates to exceed a expected (squared) distance of 1.

This is a problem which has to be solved using Mathematica.

Srikanth Tupurani - 2 years, 8 months ago

Log in to reply

Mam l am only in10 class l i have^t understand

Sneha Yar - 2 years, 7 months ago

Sorry if it sounds as boasting, but the following is genuine. After reading the problem I had a shower and thought about it, using the bathroom tiles to help my imagination. First thing I did after the shower was filling in the answer 11 and it was right. Without pen, paper or mathematica.

K T - 2 years, 7 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...