What is the relation between density and average distance to nearest neighbour? Let's say I have the density of an object: say, $1 \space \mathrm{obj} \space m^{-2}$. This could, for example, be the number of balls on a football field. If we assume the objects are uniformly distributed, what is the average distance between an object and its nearest neighbour?
Intuitively it sounds like there should be a way to calculate this, but I can't figure out how:


*

*Clearly the higher the density, the smaller the distance between two neighbouring objects, so the average distance should be inversely proportional to the density.

*To get the units to work, we would take the square root. So for this density, the average distance is $\frac{1}{\sqrt{1 \space \mathrm{obj} \space m^{-2}}}$ Superficially this seems to work, except we now have an extra unit $\mathrm{obj}^{-1/2}$.

*More concerningly, I don't intuitively see why this should yield the correct result. Step 2 simply says "to get the units to work". Sure, taking the square root makes the units work, but why should this be the correct answer? It would also mean in 3D, we take the cube root, etc.


I get the feeling that this question must have been solved in the past, in which case I'd appreciate a reference.
 A: This answer assumes uniform distribution. Let us see what the formula for density tells us. Say we have a total volume $V$ and number of particles $N$. Then the density $\rho$ is given by:
$$\rho=\frac{N}{V}$$
Now consider the volume of each particle (inter particle volume) to be $v$, then the total volume will be given by:
$$V=Nv$$
Plugging this back in our density equation, we get:
$$\rho=\frac{1}{v}$$
This tells us that the inter particle volume is given by:
$$v=\frac{1}{\rho}$$
Now to get the inter particle distance $d$ from here, we need to know the exact geometry of the packing to get the $d$ dependence in $v$. But using the fact that n-dimensional volume goes as $d^n$, we get:
$$d\sim\frac{1}{\rho^{1/n}}$$
A: The answer is going to depend on whether the objects are attracted to each other (clumpy) or repulsed by each other. If the objects are on a regular lattice, then the problem is trivial - it's just the shortest spacing on the lattice (or some average, if not all points are identical).
If we assume the objects are completely uncorrelated, then the usual assumption is that the number of objects in any given area is given by the Poisson distribution:
$$
P(n) = \frac{(A\sigma)^n}{n!}e^{-A\sigma},
$$
with $A$ the area of the patch, $\sigma$ the areal density, and $n$ the number of objects in the patch.
To define the statistics for the nearest neighbor, we need to find the probability that a circle of radius $r$ is empty except for exactly one object at its center and one on its edge (the probability of two or more on its edge is negligible). Because everything is uncorrelated, it factors into a nice product of the probability the center has 1 object times the circle being empty times the edge having 1 object:
$$
P(n_0,n_N) = \left(\pi \mathrm{d}r_0^2 \sigma e^{-\pi \mathrm{d}r_0^2\sigma}\right) \times \left(e^{-\pi r^2 \sigma}\right) \times \left( 2\pi r \mathrm{d}r \sigma e^{-2\pi r \mathrm{d}r\,\sigma}\right).
$$
Dropping non-leading order differentials, the joint density becomes
$$
f\left(\vec{r_0},r\right) = \sigma^2 2\pi r e^{-\sigma \pi r^2}
$$
that is, the probability density of objects to be at position $\vec{r_0}$ and have a nearest neighbor at a distance $r$. To get the mean distance to the nearest neighbor, mulptiply by $r$ and integrate to get:
\begin{align}
  \langle r \rangle &= \frac{\int_0^\infty r f\left(\vec{r_0},r\right) \,\mathrm{d}r }{\int_0^\infty f\left(\vec{r_0},r\right) \,\mathrm{d}r} \\
  & = \frac{1}{2\sqrt{\sigma}}.
\end{align}
As you can see, your intuition was pretty solid - only off by a factor of $1/2$. For other probability distributions, the computation can get rather more involved.
