# What distance is considered 'close' for the 9th nearest neighbor of a galaxy?

I am currently working on determining the nth nearest neighbors of a large survey of galaxies. I am not an astronomer by trade, so I am unsure of interpreting some of my results. I have discovered for the sample of galaxies their 9th nearest neighbor distances. It turns out the mode of this distribution by far is between 2mpc and 3mpc. Since I am unsure of the scale of these implications I would prefer if a well versed astrophysicist can tell me if the distance to the 9th nearest neighbor galaxy of 2-3mpc would be considered densely clustered. These galaxies are at intermediate redshift.

• Thats a really cool study. Please publish graphs of your statistics. What galaxy databases have you found? There must be databases with 1000ds of them. You need to specify in you mean spirals only or mini local galaxies. – com.prehensible Aug 4 '18 at 19:31

If galaxies were randomly distributed (a spatial Poisson process), then the probability of having $N$ galaxies inside a radius $r$ sphere is $\Pr[N]=\lambda^N e^{-\lambda} / N!$ where $\lambda = (4\pi /3)\rho r^3$. So the cumulative distribution function of the distance to the $N$th neighbour is $$\Pr[R_N<r]=1-e^{-\alpha r^3}\sum_{n=0}^{N-1} \frac{\alpha^n r^{3n}}{n!}$$ ($\alpha=4\pi\rho/3$ for brevity). Taking the derivative to get the PDF gives $$f(r) = e^{-\alpha r^3}\left [(3\alpha r^2) + 3\sum_{n=1}^{N-2} \frac{\alpha^n r^{3n-1}}{(n-1)!}\right ].$$ While one can try taking the derivative of this to get the mode (or setting the CDF to 1/2 to find the median) this becomes algebraically messy so a numerical solution is likely best. I get that the mode for the 9th neighbour is 2.44 times the mode of the first neighbour.