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.