Generalized Cantor set (source code)

= Generalized Cantor set

Choose a strictly decreasing positive <sequence> $q_0=1,q_1,q_2,\ldots$. Begin with $C_0=[0,1]$ and at step $n+1$ keep two closed end intervals of length $q_{n+1}/2^{n+1}$ from every component interval of $C_n$. This constructs a <compact set> $C=\bigcap_n C_n$ with
$$
m(C_n)=q_n,\qquad m(C)=\lim_n q_n.
$$
The second equality is <continuity from above of a measure>. Every stage has positive gaps and maximum component length at most $2^{-n}$, so $C$ contains no nondegenerate <interval> and is a <nowhere dense set>. It has no <isolated points>: both endpoints of the stage-$n$ component containing a point remain in $C$, and at least one distinct endpoint is within $2^{-n}$. Thus its topological sparseness is compatible with positive <Lebesgue measure>.

Taking $q_n=(2/3)^n$ gives the usual <Cantor set> of measure zero. Taking $q_n=1/2+2^{-(n+1)}$ gives a generalized construction of measure $1/2$. This is one useful family of generalized constructions; the removed intervals need not have the same proportions at every stage.

\Image[/generalized-cantor-retained-measure.png]
{title=Generalized Cantor constructions with zero and positive limiting <Lebesgue measure>}
{description=Each row shows the retained <closed intervals> at one stage. The two constructions have the same binary splitting pattern but different limits of the total retained length.}