# Why does repeatedly drawing circles around a point create a "ring" pattern?

Define a point $$P_0$$ at the origin. Define an "iteration" by putting a circle of radius one around $$P_0$$ and choosing a uniformly random point on the circle. Let that new point become $$P_1$$. Then repeat that process with $$P_1$$, say 15 times. Then repeat the steps before a large number, say 250,000 times (view this here). Why does the image provided produce rings of color? (By rings I mean there's areas of color)

The color is defined from the number of iterations to get to that point, and the darker the color the more iterations it took. Points that occur multiple times have their color averaged, and black means no points hit that location. The white circle is the first iteration. (Also, points outside of the circle do NOT stop it iterating, they are just not drawn)

Also, just some curious questions:

1. Is there a way to calculate the average distance for $$n$$ iterations (without simulating it)?
2. Is there a function that can "smooth" out either image (doesn't have to be perfect)?
3. What if you could choose a random radius? (250,000 simulations here, 35px is one radii)
• This is an example of a random walk. Commented Nov 14, 2021 at 16:44
• Thanks, I added that tag. Commented Nov 14, 2021 at 16:46
• Isn't the second paragraph of your question a perfectly good answer to the question you ask in the first paragraph? Commented Nov 14, 2021 at 16:48
• Kind of, but I would have expected a gradient and not a ring. Commented Nov 14, 2021 at 16:50
• (I had generalized a bit too eagerly in my answer; now updated with a more careful analysis. It shows that we actually only get sharp edges at radius 1, 2, 3, 4 -- it's not just that the boundaries at larger radii are weaker, they are smoother too). Commented Nov 14, 2021 at 18:31

First consider only the second points in each random walk. Its direction from the center is (by symmetry) uniformly distributed, but the distance $$D$$ from the center is distributed as $$2|\sin(X/2)|$$, where $$X$$ is the random variable denoting the difference in angle between the two jumps. This probability distribution does not drop off smoothly -- in fact the probability density at distance $$D<2$$ should be something like $$\frac2\pi \frac{d}{dD}\arcsin\frac{D}{2} = \frac{2}{\pi\sqrt{4-D^2}}$$ which increases towards infinity when $$D$$ approches $$2$$, but then it suddenly drops to zero probability for $$D>2$$.

This creates the visible edge at distance $$2$$ in your plot.

The probability density per area must additionally take into account that there's more area at a distance of 1.8 to 1.9 than at a distance from 0.1 to 0.2, so it becomes $$\frac{1}{\pi^2D\sqrt{4-D^2}}$$. This goes to infinity both at $$D\to0$$ and $$D\to 2$$, and indeed we do see a spike in density right at the center.

For more than two jumps, things become less dramatic and also more complex to calculate. I'll consider only the asymptotic behavior for endpoints very close to the maximal distances.

For $$n+1$$ jumps, let random variables $$X_1, X_2, \ldots, X_n$$ be the angles between each of the non-first jumps and the first jump. These are then independent and each uniformly distributed in $$[-\pi, \pi]$$. Since we're only interested in cases where we end up very close to the maximal distance, we can approximate the total distance as $$D \approx 1 + \cos X_1 + \cdots + \cos X_n \approx n + 1 - \frac{X_1^2 + \cdots + X_n^2}2$$ Thus the probability of landing closer to the maximum than $$\varepsilon$$ is the volume of an $$n$$-ball of radius $$\sqrt{2\varepsilon}$$, divided by $$(2\pi)^n$$:

$$P(D>n+1-\varepsilon) \approx \frac{\varepsilon^{n/2}}{(2\pi)^{n/2}\Gamma(n/2 + 1)}$$

This probability is spread out over an annulus of area $$2\pi(n+1)\varepsilon$$, so we can estimate of the probability density per unit area right inside the maximum circle as:

$$\frac{\varepsilon^{n/2-1}}{(n+1)(2\pi)^{n/2+1}\Gamma(n/2 + 1)} \quad \text{as } \varepsilon\to 0$$

The exponent of $$\varepsilon$$ is $$n/2-1$$, so the behavior is qualitatively different between different $$n$$.

• For two jumps ($$n=1$$), as we've seen above, the point density goes to infinity near the edge.

• For three jumps ($$n=2$$), the density approaches a finite, positive limit close to the edge, and then suddenly jumps to $$0$$. We can see a slightly weaker boundary at radius $$3$$ in the plot.

• For four jumps ($$n=3$$), the density goes as $$\sqrt{\varepsilon}$$, so actually reaches $$0$$ continuously. But right at the edge it still varies fast enough that the boundary can just about be discerned in the plot.

• At more than four jump, the probability density falls off smoothly enough towards the boundary that it doesn't register visibly as an edge.