Radial Distance Distribution in a Uniform Disk

Random Variables · Medium · Free problem

A point $(X, Y)$ is chosen uniformly at random inside the unit disk -- that is, the set $\{(x, y) : x^2 + y^2 \leq 1\}$.

Let $R = \sqrt{X^2 + Y^2}$ be the distance from the origin to the point.

  1. Find the CDF of $R$: what is $F_R(r) = P(R \leq r)$ for $0 \leq r \leq 1$?
  2. Differentiate to get the PDF $f_R(r)$.
  3. Compute the expected distance $E[R]$.
  4. A common mistake when sampling uniform points on a disk is to draw $R \sim \text{Uniform}(0, 1)$ and $\Theta \sim \text{Uniform}(0, 2\pi)$ independently. Why is this wrong, and how do you fix it?

Hints

  1. The CDF $P(R \leq r)$ is a geometric question -- what fraction of the disk's area is inside radius $r$?
  2. Once you have $F_R(r) = r^2$, the PDF follows by differentiation and $E[R]$ by a one-line integral.
  3. For part 4: the polar area element is $r \, dr \, d\theta$, not $dr \, d\theta$. That extra $r$ factor is exactly why uniform $(R, \Theta)$ does not give uniform $(X, Y)$.

Worked Solution

How to Think About It: This is a coordinate-change problem where the key tool is geometry, not integration. When you want $P(R \leq r)$, you are asking: what fraction of the disk's area lies within radius $r$? That is just a ratio of areas -- no calculus needed for the CDF step. The PDF then follows by differentiation, and the expected value by a one-line integral. The real punch line is part 4: the naive sampling scheme fails because it ignores the fact that area grows with radius, so points cluster near the center. This is a practical gotcha that comes up whenever you simulate uniform points on a disk.

Quick Estimate: Before computing, ask: is the average distance closer to $0$, $0.5$, or

$? Uniform on the disk means more area is at larger radii (the annulus at radius $r$ has circumference
\pi r$, so weight $\propto r$). That biases points away from the center. A rough guess: $E[R] \approx 2/3$, which is closer to the edge than the center. We will confirm this exactly.

Approach: Use the geometric CDF trick -- area ratio -- then differentiate and integrate.

Formal Solution:

Part 1 -- CDF.

For $0 \leq r \leq 1$, the event $\{R \leq r\}$ is the set of points inside a disk of radius $r$. Since $(X, Y)$ is uniform on the unit disk:

$F_R(r) = P(R \leq r) = \frac{\text{Area of disk of radius } r}{\text{Area of unit disk}} = \frac{\pi r^2}{\pi} = r^2$

So $F_R(r) = r^2$ for $r \in [0, 1]$, and $0$ or

$ outside.

Part 2 -- PDF.

Differentiate:

$f_R(r) = \frac{d}{dr} F_R(r) = 2r, \quad 0 \leq r \leq 1$

Verification: $\int_0^1 2r \, dr = [r^2]_0^1 = 1$. Checks out.

Part 3 -- Expected Distance.

$E[R] = \int_0^1 r \cdot 2r \, dr = \int_0^1 2r^2 \, dr = \left[ \frac{2r^3}{3} \right]_0^1 = \frac{2}{3}$

Matches the rough guess: the average point is about $67\%$ of the way to the edge.

Part 4 -- Why Naive Sampling Fails.

If you draw $R \sim \text{Uniform}(0,1)$ and $\Theta \sim \text{Uniform}(0, 2\pi)$, the resulting density in polar coordinates is uniform in $(r, \theta)$-space, but NOT in $(x, y)$-space. The Jacobian of the polar-to-Cartesian transformation is $r$, so the density in Cartesian coordinates becomes $\propto 1/r$, which is higher near the origin. Points cluster around the center.

The fix: you need $R^2 \sim \text{Uniform}(0, 1)$, i.e., draw $U \sim \text{Uniform}(0,1)$ and set $R = \sqrt{U}$. This ensures the CDF of $R$ equals $r^2$, which is exactly what we derived. In code: r = sqrt(random()), theta = 2 * pi * random().

Answer: - $F_R(r) = r^2$ for $r \in [0,1]$ - $f_R(r) = 2r$ for $r \in [0,1]$ - $E[R] = \frac{2}{3}$ - Correct sampling: $R = \sqrt{U}$, $U \sim \text{Uniform}(0,1)$

Intuition

The key structural fact here is that $f_R(r) = 2r$ is linearly increasing -- points are more likely to be far from the center than close to it. This is purely geometric: the amount of area in a thin ring at radius $r$ is

\pi r \, dr$, which grows with $r$. So even though the distribution on $(X, Y)$ is flat, the induced distribution on the radius is skewed toward larger values. The same logic applies in higher dimensions: in $d$ dimensions, the radial density goes as $r^{d-1}$, which means in high-dimensional spaces, almost all the mass of a uniform ball is concentrated near its surface. This is the seed of the "curse of dimensionality" intuition.

The sampling mistake in part 4 is a classic trap. It comes up in Monte Carlo simulations, option pricing by simulation, and any time you need uniform points on a sphere or disk. The fix -- $R = \sqrt{U}$ -- is an application of inverse CDF (probability integral transform) sampling. More generally, whenever you change coordinates, the Jacobian is the tax you pay: area does not scale the same way as radius, and forgetting that biases your simulation in a way that is invisible until you plot the results.

Open the full interactive solver →