S.O.S. Mathematics CyberBoard Forum Index S.O.S. Mathematics CyberBoard
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
mean nearest neighbor in 3d

 
Post new topic   Reply to topic    S.O.S. Mathematics CyberBoard Forum Index -> Geometry and Trigonometry
View previous topic :: View next topic  
Author Message
trekkiee
Math Cadet


Joined: 23 Nov 2009
Posts: 6

PostPosted: Mon, 23 Nov 2009 10:37:55 UTC    Post subject: mean nearest neighbor in 3d Reply with quote

Hi, 1st time poster here. Smile I'm trying to figure out the average distance between nearest neighbors in a three dimensional randomly distributed sample of particles. My best guess is d_nearest neighbor_mean=(volume/n)^1/3 where n particles are randomly distributed in a 3 dimensional volume.

I'm not a student and this isn't homework, btw. The question originated when I wondered what was the average distance between stars in the solar neighborhood. atlasoftheuniverse.com gives 35 stars (including the Sun) within 12.5 light-years, and the above formula yields 6.16 ly as the avg distance from any given star to its closest neighbor. This seems a little high to me, since the distance from the Sun to its nearest neighbor (Proxima Centauri) is 4.4 ly. But perhaps the Sun has a closer-than-avg nearest neighbor, since, after all, the distribution should be random.

I originally thought it would be easy to figure this out, but after trying unsuccessfully for an hour to work out a satisfactory formula, then another hour trying to google one, I gave up. Thanks in advance Smile
Back to top
View user's profile Send private message
Shadow
Moderator


Joined: 30 Mar 2005
Posts: 5464
Location: Urbana, IL

PostPosted: Mon, 23 Nov 2009 21:52:26 UTC    Post subject: Re: mean nearest neighbor in 3d Reply with quote

trekkiee wrote:
Hi, 1st time poster here. Smile I'm trying to figure out the average distance between nearest neighbors in a three dimensional randomly distributed sample of particles. My best guess is d_nearest neighbor_mean=(volume/n)^1/3 where n particles are randomly distributed in a 3 dimensional volume.

I'm not a student and this isn't homework, btw. The question originated when I wondered what was the average distance between stars in the solar neighborhood. atlasoftheuniverse.com gives 35 stars (including the Sun) within 12.5 light-years, and the above formula yields 6.16 ly as the avg distance from any given star to its closest neighbor. This seems a little high to me, since the distance from the Sun to its nearest neighbor (Proxima Centauri) is 4.4 ly. But perhaps the Sun has a closer-than-avg nearest neighbor, since, after all, the distribution should be random.

I originally thought it would be easy to figure this out, but after trying unsuccessfully for an hour to work out a satisfactory formula, then another hour trying to google one, I gave up. Thanks in advance Smile


Why do you think the distance should be random? With all the forces going on (gravity for one) it seems perfectly reasonable to me that indeed the distribution is very not-random.
_________________
(\ /)
(O.o)
(> <)
This is Bunny. Copy Bunny into your signature to help him on his way to world domination
Back to top
View user's profile Send private message
trekkiee
Math Cadet


Joined: 23 Nov 2009
Posts: 6

PostPosted: Fri, 27 Nov 2009 10:16:08 UTC    Post subject: Re: mean nearest neighbor in 3d Reply with quote

Modest at

http://hypography.com/forums/physics-mathematics/21509-mean-nearest-neighbor-distance-3d.html

was helpful in pointing me to this link:

http://books.google.com/books?id=hpxpyOak1psC&pg=PA171&lpg=PA171&dq=%22probability+law+for+nearest-neighbor+distance+in+a+random+distribution+of+particles%22&source=bl&ots=T9lWLj9rLx&sig=q3ldVEWmqUBu3FWcWJ75S85-Wc8&hl=en&ei=n3MNS82wC4ikMJDlrNAC&sa=X&oi=book_result&ct=result&resnum=1&ved=0CAgQ6AEwAA#v=onepage&q=%22probability%20law%20for%20nearest-neighbor%20distance%20in%20a%20random%20distribution%20of%20particles%22&f=false

And now I need to integrate:

integral of x^3 exp(-a x^3) dx, with a = constant,

but I couldn't. Hopefully, it's an easy integral and and someone will figure it out.

In a 3-dimensional random distribution, the basic idea for finding the average distance from any given particle to its nearest neighbor begins with:

P(r)dr = [1 - integral from 0 to r of P(r)dr][4 pi r^2 pho dr] (1)

where
pho = average number of particles/unit volume
P(r) dr = the probability of a particle's nearest neighbor occurring in the interval [r,r+dr]
integral from 0 to r of P(r) dr = probablity that an arbitrary particle's nearest neighbor lies within a distance r of the particle
1 - integral from 0 to r of P(r) dr = the probability that the nearest neighbor is no closer than r.

differentiating & separating eq. 1:

dP/P = [2/r - 4 pi rho r^2] dr

integrating:

P = [constant] r^2 exp(- [4/3] pi rho r^3)

normalizing:

1 = integral from 0 to infinity of P(r) dr
1 = [constant] integral from 0 to infinity of r^2 exp(-[4/3] pi rho r^3) dr
1 = [constant] [-[1/(4 pi rho)] exp(-[4/3] pi rho r^3)] evlauated from 0 to infinity

gives the constant = 4 pi rho and P(r) = 4 pi rho r^2 exp(-[4/3] pi rho r^3)

The average distance from any given particle to its nearest neighbor in 3 dimensions is then the expectation value of r:

<r> = integral from 0 to infinity of r P(r) dr
<r> = [4 pi rho] [integral from 0 to infinity of r^3 exp(-[4/3] pi rho r^3) dr]

I was unable to do the last integral, but I'm sure someone can Smile
Back to top
View user's profile Send private message
aswoods
Member of the 'S.O.S. Math' Hall of Fame


Joined: 23 Feb 2009
Posts: 524
Location: Adelaide, Australia

PostPosted: Fri, 27 Nov 2009 13:21:49 UTC    Post subject: Reply with quote



according to Gradshteyn and Ryzhik 3.381.10, and Wolfram Alpha seems to agree.
Back to top
View user's profile Send private message
trekkiee
Math Cadet


Joined: 23 Nov 2009
Posts: 6

PostPosted: Sat, 28 Nov 2009 21:25:01 UTC    Post subject: Reply with quote

aswoods wrote:


according to Gradshteyn and Ryzhik 3.381.10, and Wolfram Alpha seems to agree.


Thanks. I obviously didn't look hard enough.
Back to top
View user's profile Send private message
trekkiee
Math Cadet


Joined: 23 Nov 2009
Posts: 6

PostPosted: Sat, 28 Nov 2009 22:22:58 UTC    Post subject: Reply with quote

aswoods at

www.sosmath.com/CBB/viewtopic.php?p=197769#197769

helpfully pointed out that Gradshteyn and Ryzhik 3.381.10, and Wolfram Alpha agree that

the integral from 0 to infinity of x^3 e^(-ax^3)dx = 1/3 gamma(4/3) a^(-4/3)

so the mean nearest neighbor distance in 3d is:

<r> = [4 pi rho] integral from 0 to infinity r^3 e^(-[4/3] pi rho r^3) dr
<r> = 1/3 gamma(1/3) ([4/3] pi)^(-1/3) rho^(-1/3)
<r> = 0.55396 rho^(-1/3)
<r> = 3.93 light-years for the 23 star systems within 12.5 ly Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    S.O.S. Mathematics CyberBoard Forum Index -> Geometry and Trigonometry All times are UTC
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Contact Us | S.O.S. Mathematics Homepage
Privacy Statement | Search the "old" CyberBoard

users online during the last hour
Powered by phpBB © 2001, 2005-2010 phpBB Group.
Installation and all modifications: H. Knaust
Copyright © 1999-2010 MathMedics, LLC. All rights reserved.
Math Medics, LLC. - P.O. Box 12395 - El Paso TX 79913 - USA