The Cantor Sequence with Bits

Requires a Wolfram Notebook System
Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.
The Cantor sequence is similar to the Cantor set but deals with integers. To construct it, start with the natural numbers , writing them in ternary notation as
. Construct a binary sequence
: if
in ternary has only 0s or 2s, let
; otherwise let
. This gives
.
Contributed by: Michael Schreiber (September 2007)
Open content licensed under CC BY-NC-SA
Snapshots
Details
The Cantor set is constructed iteratively; starting with the closed unit interval , the open middle third
is taken out, leaving the two closed intervals
and
. Then the middle thirds of those two intervals are taken out, leaving four intervals of length
, and so on. The Cantor set is the limit (or intersection) of all such sets.
Here is a way to look at the Cantor set in terms of the base 3 (ternary) representation of numbers. In the unit interval numbers in base 3 have the form
, where the
are all possible combinations of the digits 0, 1 or 2. The numbers in the middle third of
start with 0.1; the numbers in the middle thirds of
and
start with 0.01 and 0.21. In general, numbers in a middle third have the digit 1 somewhere in their ternary expansion. In other words, the Cantor set consists of numbers that only have 0 or 2 as ternary digits. Replacing the 2s with 1s in those expansions gives a representation of the Cantor set using binary numbers.
Permanent Citation