[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 205 KB, 651x3000, 🤔 Thinking Face Emoji.png [View same] [iqdb] [saucenao] [google]
10760683 No.10760683 [Reply] [Original]

What is the average distance between two randomly chosen points in an n-dimensional unit hypercube?
Assume uniform distribution.

>> No.10761364

>>10760683

[math]
\int _0^1\ldots\int_0^1\sqrt{(x_1 - y_1)^2+\ldots (x_n - y_n)^2 }dx_1dy_1 \ldots dx_ndy_n
[/math]

there only exist closed form solutions for n = 1 to 5 as far as I know

>> No.10761434

>>10761364
I know how to write that as a bigass integral, but how to actually solve it

>> No.10761466
File: 48 KB, 365x444, 1513991476204.jpg [View same] [iqdb] [saucenao] [google]
10761466

>>10761364
>as far as I know
What sort of expertise are you claiming here? I don't mean to be aggressive, just looking for context.

>> No.10761560

>>10761466
PhD in physics and a bigass brain

>> No.10761569

>>10761434
you can solve the one for n=2 without having to resort to anything too fancy, but above that it gets tricky.

Sometimes (most of the time) integrals just don't have closed form solutions.

>> No.10761578

>>10761569
I'm looking for solutions for n<=10, it doesn't have to be closed form. A heuristic algorithm will do.

>> No.10761593

>>10761578
well here are the first 5

http://mathworld.wolfram.com/HypercubeLinePicking.html

oops, I guess 5 isn't closed form

what do you need this for? you could just integrate numerically

>> No.10761680

>>10761593
I'm estimating probabilities with gaussian kernel and I need some method for automatically scaling the bandwidth depending on dataset dimensionality. So far i'm just calculating average distances between samples and it seems to do the trick. I wanted to test with the average point distance to see if it's better. I can just use those constants you posted, but I was curious how to calculate that.