Let $X$ be a set of $N$ real numbers selected from a uniform distribution on the interval $[0,1]$. What is the expected number of elements of $X$ that lie within $x$ of one another? That is to say, what is the expected number of $X_i\in X$ such that $|X_i - X_j| < x$ where $i < j$?
I suspect the answer scales like $x N^2$, at least for $x\ll 1/N$, but I can't really figure out how to formalize this in a good way.
To see this, observe that the probability that a point lies in the interval $[a - x,a + x]$ is $$P_a = \min{1,a + x} -\max\{0,a - x\}\,.$$ Integrating over $a\in[0,1]$, we find that the average probability is $$P = \int_0^1{\rm d}a P_a = x(2 - x)\,.$$ Thus, summing over all points (without double counting) we have $$\langle N \rangle = x(2 - x)\frac{N(N - 1)}{2}\,.$$