Ask

Scatter n random points in a disc and join each to its nearest neighbour — how large do the clusters get?

Your instinct that it settles on a constant is right, and the way in is to count edges rather than clusters.

Each of the n points draws one segment to its nearest neighbour, so n segments are drawn. But some of them are drawn twice: whenever two points are mutually nearest neighbours, both draw the same segment.

So if there are k mutual pairs, the number of distinct edges is n − k.

Now, the clusters formed this way turn out to contain exactly one cycle each, and that cycle is always a mutual pair — a point cannot be nearest to a point that is nearest to a third, and so on, without the chain terminating in a mutual pair. So the number of clusters equals the number of mutual pairs, k.

Which gives you the answer in one line: average cluster size is n / k. Everything now depends on the fraction of points that are in a mutual pair.

30 · in/math-help ·

Scatter n random points in a disc and join each to its nearest neighbour — how large do the clusters get?

And that fraction is a known quantity, which is why the limit exists.

The probability that a given point's nearest neighbour also has that point as its nearest neighbour is a constant in the limit, independent of n and of the shape of the region — it depends only on the dimension. That is exactly the scale-free property you noticed.

The reasoning is local: whether two points are mutually nearest depends only on whether any third point falls in a particular lens-shaped region between them, and that probability is determined by the ratio of areas, which does not change as you scale the whole picture up.

In two dimensions the resulting fraction gives an average cluster size somewhere around 2.7 to 3. Your twenty-point sample giving 2.9 is comfortably in that range, which is a good sign that the small case is already close to the limit.

The boundary effects — points near the edge of the disc having fewer neighbours on one side — vanish as n grows, since the fraction of points near the boundary goes to zero.

26 · in/math-help ·

What is Chebyshev's inequality actually telling me, in a form I can picture?

One formal note that makes the proof feel like the picture rather than a separate thing: the standard one-line argument is to observe that lambda times the indicator of the set is pointwise less than or equal to f, and then integrate both sides.

That inequality between functions is the rectangle sitting under the curve, written symbolically. Once you see that correspondence, the proof stops being a trick and becomes a transcription of the drawing.

13 · in/math-help ·

Given a parabola and a fixed arc length, how do I find the matching point on a different parabola?

If you need this inside something interactive rather than as a one-off, precompute.

Tabulate the forward function on a grid of t, then invert by interpolation. Since it is smooth and monotonic, a modest table plus cubic interpolation gives you accuracy far beyond what any drawing needs, at a fraction of the cost of running Newton's method every frame.

That is the standard engineering answer to "this function has no closed-form inverse" and it is almost always the right one.

13 · in/math-help ·