In 1883, the German mathematician Cantor presented a very strange set to people. Consider the interval 0, 1 consisting of all real numbers between 0 and 1. Divide it into three segments and remove the middle open interval (1/3, 2/3). Thus, the remaining set is the union of the two remaining intervals, namely 0, 1/3 ∪ 2/3, 1. Next, divide each interval into three segments and remove the middle open interval. This results in a set consisting of four smaller remaining intervals. Continuing to remove the middle one-third of each interval indefinitely, the set of numbers remaining at the end is called the Cantor set. It can be easily seen that after removing the middle segment of each interval, the total length of all remaining intervals will become 2/3 of the original. Since the initial total length of the interval is 1, after the nth operation, the total length of all remaining intervals will only be (2/3)^n. When n tends to infinity, (2/3)^n will tend to 0, indicating that the "total length" of the Cantor set is 0. However, this only shows that the Cantor set does not contain any intervals, not that it does not contain any numbers. During the process of generating the Cantor set, since each time we remove an open interval, the endpoints of all remaining intervals are not removed. Thus, numbers like 1/3, 2/3, 1/9, 2/9, 7/9, and 8/9 will eventually remain in the Cantor set. In fact, since all fractions of the form (1/3)^n will be preserved, there are infinitely many numbers in the Cantor set! More interestingly, the Cantor set also contains many numbers beyond the "endpoints". Although there are infinitely many numbers in the Cantor set, intuitively, it seems that there should be far fewer than the real numbers in the interval 0, 1. However, surprisingly, this is not the case. In fact, there are just as many numbers in the Cantor set as there are real numbers in the interval 0, 1! It is even more than the rational numbers that seem to densely cover the interval 0, 1! To illustrate this point, we represent all numbers between 0 and 1 as ternary fractions. If we divide these numbers into three equal segments, they will be exactly the numbers between 0 and 0.1; 0.1 and 0.2; and 0.2 and 1. The middle segment we remove will be exactly the numbers whose first decimal digit is 1, while the remaining numbers will all have a first decimal digit of 0 or 2. In the next step, we will remove the middle one-third of each interval, that is, all numbers whose second decimal digit is 1, and the remaining numbers will all have a second decimal digit of 0 or 2... Continuing this process, the numbers remaining in the Cantor set will precisely be those ternary fractions consisting only of 0 and 2! For example, the ternary fraction representation of 1/4 is 0.020202..., indicating that 1/4 indeed belongs to the Cantor set. Moreover, although the ternary fraction of 1/3 is 0.1 and that of 1/9 is 0.01, we can also rewrite them as infinite repeating fractions 0.02222... and 0.002222... (the same principle as 0.999... = 1), so they are also in the Cantor set. Next, we can easily map the numbers in the Cantor set to all real numbers in the interval 0, 1. For any number in the Cantor set, first convert it to a ternary fraction, convert all digits 2 in the expansion to 1, then treat the new ternary fraction as a binary fraction and convert it back to decimal, and it will be a real number between 0 and 1. Similarly, for every real number in the interval 0, 1, first write it as a binary fraction, then replace all 1s with 2s and treat it as a ternary fraction.A ternary decimal number becomes a number in the Cantor set. Therefore, there is a one-to-one correspondence between the numbers in the Cantor set and the real numbers in the entire 0, 1 interval, and there are just as many numbers in the two sets!
The "total length" of the Cantor set is 0, but the number of elements it contains is actually the same as that of the real number interval. These strange properties quickly attracted the attention of mathematicians. The Cantor set plays an important role in various branches of mathematics, such as set theory, topology, measure theory, real analysis, and fractal theory.

