Posted on Mar 13, 2026
Build the Cantor set by repeatedly removing the middle third of every remaining interval.
Choose a random point in the Cantor set by independently picking left or right at every stage, each with probability 1/2.
Pick two such points independently. What is the expected distance between them?
At each step you flip a fair coin: heads means "keep the left third," tails means "keep the right third." If you do this forever, you land on a single point \(X\) in the Cantor set.
That description is enough to write a simple self-similarity rule:
\[ X=\begin{cases} \frac13 X_1 & (\text{left third})\\ \frac23+\frac13 X_1 & (\text{right third}) \end{cases} \]
where \(X_1\) is an independent copy of \(X\). It just says: once you pick left or right, the rest of the process looks like a scaled copy of the original.
Now pick two independent Cantor points \(X\) and \(Y\), and let \(D=|X-Y|\). We condition on the first coin flips.
Therefore
\[ \mathbb{E}[D]=\frac12\cdot\frac13\mathbb{E}[D]+\frac12\cdot\frac23. \]
Solving gives
\[ \mathbb{E}[|X-Y|]=\frac{2}{5}=0.4. \]
Instead of removing the middle third, keep two intervals of length \(a\): \( [0,a] \) and \( [1-a,1] \), with \(0 < a < 1/2\).
The same coin-flip construction gives
\[ X=\begin{cases} aX_1 & (\text{left})\\ (1-a)+aX_1 & (\text{right}) \end{cases} \]
and the expected distance between two independent points becomes
\[ \mathbb{E}[|X-Y|]=\frac{1-a}{2-a}. \]
Plugging in \(a=1/3\) recovers \(2/5\).
Now pick three independent Cantor points \(X,Y,Z\). What is the probability they can be the side lengths of a triangle?
Because ties happen with probability 0, we can write
\[ \mathbb{P}(\text{triangle})=1-3\,\mathbb{P}(X\ge Y+Z). \]
Let \(p=\mathbb{P}(X\ge Y+Z)\). We again condition on the first coin flips. Write
\[ X=\frac23 B+\frac13 X_1,\quad Y=\frac23 C+\frac13 Y_1,\quad Z=\frac23 D+\frac13 Z_1, \]
where \(B,C,D\in\{0,1\}\) are the first left/right choices and \(X_1,Y_1,Z_1\) are independent copies of \(X\). Multiply by 3 to get
\[ 2B+X_1\ge 2C+Y_1+2D+Z_1. \]
There are eight equally likely cases for \((B,C,D)\):
Thus
\[ p=\frac18\cdot 1+\frac38\cdot p, \]
so \(p=1/5\). Therefore
\[ \mathbb{P}(\text{triangle})=1-3\cdot\frac15=\frac25=0.4. \]
These distributions are easy to simulate by truncating the coin-flip process to a finite depth.
The first histogram shows distances \(|X-Y|\). The second shows the triangle slack \(S=(\text{sum of two smaller})-(\text{largest})\), so triangles correspond to \(S>0\).