Cantor set (source code)

= Cantor set
{c}
{title2=$C$}
{wiki}

The Cantor set is obtained from $[0,1]$ by repeatedly deleting the open middle third of every remaining interval. Its first stages retain $[0,1/3]\cup[2/3,1]$, then four intervals of length $1/9$, then eight of length $1/27$. After level $n$, there are $2^n$ retained intervals of length $3^{-n}$. The Cantor set is the <intersection> of all these stages, rather than the set of endpoints visible in any finite drawing.

\Image[/cantor-set-cover-scales.png]
{title=Finite stages of the Cantor construction supply covers at successively smaller scales}

Equivalently,
$$
C=\left\{\sum_{j=1}^{\infty}\frac{a_j}{3^j}:a_j\in\{0,2\}\right\}.
$$
Thus its points admit a base-three expansion using only zero and two. The word “admit” handles numbers with two expansions: $1/3=0.1_3=0.02222\ldots_3$ is retained as an endpoint. Every infinite binary choice determines a point of $C$, and differing choices give differing points, so $C$ is <uncountable>.

Its total retained interval <length> is $(2/3)^n\to0$, so $C$ has zero <Lebesgue measure>. It is nevertheless nonempty, <compact>, and <uncountable>, and has <Hausdorff dimension> $\log2/\log3$: the covers and mass bounds are worked out in <Hausdorff dimension of the Cantor set>. This separates counting, ordinary <length>, and fine-scale geometric size in one concrete example.

The <self-similarity> is exact:
$$
C=\tfrac13C\ \cup\ \left(\tfrac23+\tfrac13C\right).
$$
The <Cantor distribution> puts half the probability into each copy at every split. It has a continuous <cumulative distribution function>, the <Cantor function>, while all its mass lies on a <Lebesgue null set>. This makes the construction useful in <measure theory> as well as <fractal geometry>: it provides a concrete model in which several plausible meanings of “small” disagree.