The Cantor set , sometimes also called
the Cantor comb or no middle third set (Cullen 1968, pp. 78-81), is given by
taking the interval
(set
), removing the open middle
third (
), removing the open middle third of each of the two
remaining pieces (
), and continuing this procedure
ad infinitum. It is therefore the set of points in the interval
that admit a ternary
expansion containing no digit 1, illustrated above. Both endpoints
remain at every stage. In particular, the endpoint
has the ternary
expansion
.
The th iteration
of the Cantor set is implemented in the Wolfram
Language as CantorMesh[n].
Iterating the string rewriting system 1 -> 101, 0 -> 000 starting with 1 gives the
sequence 1, 101, 101000101, 101000101000000000101000101,
.... The sequence of binary bits thus produced is therefore 1, 0, 1, 0, 0, 0, 1,
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, ... (OEIS A088917)
whose th term, indexed from
,
is given by
, where
is a central Delannoy
number and
is a Legendre polynomial (E. W. Weisstein,
Apr. 9, 2006). The recurrence plot for this
sequence is illustrated above.
The Cantor set consists of the real numbers that can be written as
|
(1)
|
where may equal 0 or 2 for each
.
This is an infinite perfect
set. For a nonnegative integer
,
the total length of the line segments in the
th iteration
is
|
(2)
|
and the number of line segments is ,
so the length of each element is
|
(3)
|
and the capacity dimension is
|
(4)
| |||
|
(5)
| |||
|
(6)
| |||
|
(7)
|
(OEIS A102525). The Cantor set is nowhere dense, and has Lebesgue measure 0.
More generally, a nonempty perfect set in the real line that is nowhere dense is uncountable and may have 0 or positive Lebesgue measure. The Cantor set is, up to a homeomorphism, the unique nonempty totally disconnected, compact metric space that is a perfect set (Willard 1970; Calegari 2025, pp. 8-9).