try ai
Popular Science
Edit
Share
Feedback
  • Ternary Expansion

Ternary Expansion

SciencePediaSciencePedia
Key Takeaways
  • The Cantor set consists of all numbers in the interval [0, 1] that can be written in base-3 using only the digits 0 and 2.
  • Despite having a total length of zero, the Cantor set is uncountably infinite, containing as many points as the entire [0, 1] interval.
  • In chaos theory, the ternary expansion of a point provides a complete itinerary for its orbit under the shift map f(x)=3x(mod1)f(x) = 3x \pmod 1f(x)=3x(mod1).
  • The sparse, "dust-like" Cantor set can be mapped to fill the entire solid interval [0, 1] via the Cantor function.
  • The Cantor set is a "perfect set" in topology, meaning it is closed and every point is a limit point, resulting in a self-similar fractal structure.

Introduction

Numbers are more than just tools for counting; they are intricate sets of instructions for navigating the mathematical landscape. While we are accustomed to the familiar base-10 system, exploring alternative number bases can unlock entirely new worlds of structure and paradox. This article addresses a fascinating question: what happens when we represent numbers in base-3 and impose a single, simple constraint? It reveals how this seemingly minor adjustment gives rise to one of mathematics' most bewildering and beautiful objects, the Cantor set, bridging abstract theory with tangible applications.

The reader will first journey through the "Principles and Mechanisms," learning the language of ternary expansion and witnessing how it is used to meticulously construct the Cantor set through an infinite process of removal. Following this, the "Applications and Interdisciplinary Connections" chapter will demonstrate how this "dust" of points has profound connections to chaos theory, fractal geometry, and even the fundamental limits of information. This exploration begins by understanding the novel language we will use to describe our numbers.

Principles and Mechanisms

Suppose we want to describe a point on a line. How do we do it? We give a number. But what is a number, really? It’s a set of instructions. Think about the number 0.7340.7340.734 in our familiar base-10 system. It's a recipe for finding a location. First, divide the interval from 0 to 1 into ten equal parts. The first digit, ‘7’, tells us to pick the seventh one (the interval from 0.70.70.7 to 0.80.80.8). Now, take that small interval and divide it into ten smaller parts. The next digit, ‘3’, tells us to pick the third one. We repeat this, homing in on our target with ever-increasing precision.

This is a wonderful system, but there’s nothing sacred about the number ten. We could just as easily use a different base. What if, for the sheer fun of it, we used base-3, or ​​ternary​​?

Writing Numbers a New Way: The Secret Code of Ternary

In the ternary system, we only have three digits: 0, 1, and 2. The process is the same, but at each step, we divide our interval into three equal parts. For a number xxx between 0 and 1, its ternary expansion, written as (0.d1d2d3… )3(0.d_1 d_2 d_3 \dots)_3(0.d1​d2​d3​…)3​, is a recipe where:

  • d1d_1d1​ tells you which of the three initial intervals—[0,1/3][0, 1/3][0,1/3], [1/3,2/3][1/3, 2/3][1/3,2/3], or [2/3,1][2/3, 1][2/3,1]—contains xxx.
  • d2d_2d2​ tells you which third of that interval contains xxx.
  • And so on, ad infinitum. Each new digit pinpoints the location with three times more precision.

For example, the number (0.2)3(0.2)_3(0.2)3​ is simply 23\frac{2}{3}32​. The number (0.12)3(0.12)_3(0.12)3​ is 13+232=13+29=59\frac{1}{3} + \frac{2}{3^2} = \frac{1}{3} + \frac{2}{9} = \frac{5}{9}31​+322​=31​+92​=95​. This new language for numbers is the key—the simple, elegant tool we need to unlock a truly bizarre and beautiful mathematical object.

The Great Removal: From an Interval to a Line of Dust

Let's play a game. We start with a solid line segment, the interval [0,1][0, 1][0,1]. Now, let's remove its open middle third, (13,23)(\frac{1}{3}, \frac{2}{3})(31​,32​). We are left with two smaller segments: [0,13][0, \frac{1}{3}][0,31​] and [23,1][\frac{2}{3}, 1][32​,1].

What have we just done in the language of ternary? The interval we threw away, (13,23)(\frac{1}{3}, \frac{2}{3})(31​,32​), contains all the numbers whose ternary expansion must begin with the digit 1. (The endpoints, 13\frac{1}{3}31​ and 23\frac{2}{3}32​, are special, as we'll see.) So, our first step was to throw out all numbers that start with (0.1… )3(0.1\dots)_3(0.1…)3​.

Now let's repeat the process. We take the two remaining segments and remove the middle third from each. We remove (19,29)(\frac{1}{9}, \frac{2}{9})(91​,92​) and (79,89)(\frac{7}{9}, \frac{8}{9})(97​,98​). What are these numbers? They are the ones whose ternary expansions start with (0.01… )3(0.01\dots)_3(0.01…)3​ and (0.21… )3(0.21\dots)_3(0.21…)3​. So, in our second step, we've thrown out all numbers that have a 1 in their second ternary position.

You can probably see the pattern. We repeat this process, again and again, forever. At each stage nnn, we remove the middle thirds of all the tiny segments we have left, which corresponds to throwing away all numbers that have a '1' in the nnn-th position of their ternary expansion.

The set of points that survive this infinite process of removal is called the ​​Cantor set​​. And from our game, we have discovered its secret identity: ​​The Cantor set consists of all numbers in the interval [0,1][0, 1][0,1] that can be written in base-3 using only the digits 0 and 2.​​ This simple digit rule is the fundamental principle that governs everything about this strange set.

Who Lives in the Dust? A Census of the Cantor Set

After throwing away so much, is anything even left? The set of removed intervals has a total length of 13+29+427+…\frac{1}{3} + \frac{2}{9} + \frac{4}{27} + \dots31​+92​+274​+…, which is a geometric series that sums precisely to 1. We've removed a total length equal to our starting interval! It seems like what's left behind should have length zero. It's like a line of infinitesimal dust. But this dust is not empty; in fact, it's surprisingly crowded.

Let's try to find some residents. What about the number 14\frac{1}{4}41​? It’s not an obvious endpoint of any of our removed intervals. Is it in the Cantor set? To find out, we just need to find its ternary address. Using the standard algorithm to convert a fraction to a different base, we find something remarkable: 14=(0.020202… )3\frac{1}{4} = (0.020202\dots)_341​=(0.020202…)3​ Look at that! Its expansion is a repeating sequence of 0s and 2s. There are no 1s to be found. So, despite not being an endpoint, 14\frac{1}{4}41​ is a bona fide member of the Cantor set. The same is true for other non-obvious rationals, like 113\frac{1}{13}131​, which turns out to be (0.002002… )3(0.002002\dots)_3(0.002002…)3​.

But what about those endpoints, like 13\frac{1}{3}31​? Its most obvious ternary expansion is (0.1)3(0.1)_3(0.1)3​. That has a 1! Does that mean it gets thrown out? Here we stumble upon a fun quirk of number systems. Just as 0.999…0.999\dots0.999… is another way of writing 111 in base-10, some numbers in base-3 have two different representations. Any number with a terminating expansion, like (0.1)3(0.1)_3(0.1)3​, has an alternate infinite one. The rule is to decrease the last non-zero digit by one and follow it with an infinite trail of 2s. So: (0.1)3=(0.02222… )3(0.1)_3 = (0.02222\dots)_3(0.1)3​=(0.02222…)3​ Since we found a representation for 13\frac{1}{3}31​ that uses only 0s and 2s, it satisfies the rule. It's in the set! This dual representation is the reason all the endpoints of our removed intervals remain in the Cantor set.

Conversely, some numbers are definitively excluded. Take 12\frac{1}{2}21​. Its ternary expansion is uniquely (0.1111… )3(0.1111\dots)_3(0.1111…)3​. It’s all 1s, and since the expansion is not terminating, there's no alternative representation. It fails the test at every single digit, and so 12\frac{1}{2}21​ is not in the Cantor set; it was, in fact, the very center of the first interval we removed.

The Paradox of Size: Nothing and Everything

We now have a set that has zero total length, yet it is clearly not empty. This leads to one of the most stunning paradoxes in mathematics. How many points are in this set of dust? Is it a "small" infinity, like the set of integers or rational numbers (which we call ​​countable​​), or is it a "large" infinity, like the set of all real numbers (which we call ​​uncountable​​)?

Let's try a clever mapping. Take any number xxx in our Cantor set, written with its digits 0 and 2. x=(0.d1d2d3… )3where dk∈{0,2}x = (0.d_1 d_2 d_3 \dots)_3 \quad \text{where } d_k \in \{0, 2\}x=(0.d1​d2​d3​…)3​where dk​∈{0,2} Now, let's create a new number, yyy, by taking the digits of xxx and dividing them all by 2. y=(0.b1b2b3… )2where bk=dk/2∈{0,1}y = (0.b_1 b_2 b_3 \dots)_2 \quad \text{where } b_k = d_k / 2 \in \{0, 1\}y=(0.b1​b2​b3​…)2​where bk​=dk​/2∈{0,1} What have we done? We've turned a number written in base-3 with digits {0, 2} into a number written in base-2 (binary) with digits {0, 1}. This new number yyy can be any number in the interval [0,1][0, 1][0,1], described in binary! This creates a map from the Cantor set onto the entire interval [0,1][0, 1][0,1]. While it isn't a perfect one-to-one correspondence (some points, like the endpoints of removed intervals, map to the same value), this is enough to establish a breathtaking conclusion: ​​the Cantor set has exactly as many points as the entire interval [0,1][0, 1][0,1]​​. It is an ​​uncountably infinite​​ set.

Think about what this means. We have a set that is, in one sense (measure), infinitely small—its total length is zero. Yet in another sense (cardinality), it is infinitely large—containing as many points as the line segment we started with. It is simultaneously almost nothing and almost everything.

A "Perfect" Structure

This strange dual nature is reflected in the set's topological properties. If you zoom in on any part of the Cantor set, what do you see? You never find a solid piece, not even an infinitesimally small one. Any tiny interval you can imagine must contain numbers with a '1' in their ternary expansion somewhere, meaning it contains a "hole" where we removed a middle third. A set whose closure has an empty interior is called ​​nowhere dense​​. The Cantor set is the ultimate example of this; it's all dust and no substance.

Yet, the dust is not scattered randomly. Pick any point in the Cantor set. No matter how close you look, you will always find other points from the set nearby. There are no ​​isolated points​​. Why? Take any point x=(0.d1d2d3… )3x = (0.d_1 d_2 d_3 \dots)_3x=(0.d1​d2​d3​…)3​. We can create a new point, xnx_nxn​, that's also in the set by simply flipping its nnn-th digit (from 0 to 2 or 2 to 0). The difference between xxx and xnx_nxn​ is a mere 23n\frac{2}{3^n}3n2​. By choosing a large enough nnn, we can find another point in the set that is arbitrarily close to our original point.

This property, combined with the fact that the set contains all of its limit points (it is a ​​closed​​ set), makes the Cantor set a ​​perfect set​​. It is a perfectly formed, self-similar structure of dust, where every particle, upon magnification, reveals an entire copy of the same dusty structure.

From a simple rule—don't use the digit '1' in base-3—emerges an object of profound complexity and beauty. It teaches us that our intuitive notions of size, space, and infinity are far richer and stranger than we might ever have imagined. The Cantor set is a testament to the power of simple principles to generate infinite and fascinating worlds. The points within this set are not all the same, some are rational endpoints of removed intervals, whose ternary expansions are eventually constant, while most are not, having expansions with infinite 0s and 2s. This intricate structure, born from a simple numeral system, shows the deep and often surprising unity of mathematics.

Applications and Interdisciplinary Connections

In the previous chapter, we became acquainted with the mechanics of ternary expansion, a system for representing any number using just three digits: 000, 111, and 222. On the surface, this might seem like a mere change of clothes for our familiar numbers. But what happens if we start to play with the rules? What if we impose a simple, almost whimsical constraint: "No 111s allowed"? It turns out this single rule is not a limitation but a gateway, opening a door into a startlingly rich and beautiful universe of ideas that connect the most abstract mathematics to the tangible worlds of chaos, geometry, and information.

A Universe Made of Dust: The Cantor Set

Let's begin with that rule. Consider all the numbers in the interval [0,1][0,1][0,1] that can be written in base 3 using only the digits 000 and 222. This collection of numbers forms a famous object known as the Cantor set, which we'll call CCC. What does this set "look like"? If you think about its construction, you start with the interval [0,1][0,1][0,1] and remove the middle third—precisely the numbers whose first ternary digit must be a 111 (like 0.5=(0.111… )30.5 = (0.111\dots)_30.5=(0.111…)3​). Then you take the two remaining intervals, [0,1/3][0, 1/3][0,1/3] and [2/3,1][2/3, 1][2/3,1], and remove the middle third of each of those. You continue this process forever, at each stage removing the numbers that would require a 111 at that position in their ternary expansion.

What you're left with is a strange "dust" of points. If you were to add up the lengths of all the intervals you removed, you'd find they sum to exactly 111. This means the Cantor set that remains must have a total length, or "Lebesgue measure," of zero. It's full of holes. And yet, this set contains just as many points as the original, solid interval [0,1][0,1][0,1]—an uncountable infinity of them. It is nowhere dense, yet uncountably infinite. It contains rational points, like 14=(0.020202… )3\frac{1}{4} = (0.020202\dots)_341​=(0.020202…)3​ or the point represented by the repeating expansion (0.2220‾)3(0.\overline{2220})_3(0.2220)3​, as well as irrational numbers. The humble ternary expansion provides the key to defining and exploring this paradoxical creature.

The Devil's Staircase: Stretching Dust into a Line

The surprises don't stop there. Let's define a function, the Cantor function, which performs a magical transformation. It takes a number xxx from our Cantor set CCC and reads its ternary digits, which are all 000s and 222s. It then creates a new number by a simple substitution: it changes every 222 to a 111 and re-interprets the resulting sequence of 000s and 111s as a binary (base-2) number. For example, the point x=29x=\frac{2}{9}x=92​, which is (0.02)3(0.02)_3(0.02)3​ in ternary, is in the Cantor set. The function maps its digits (0,2)(0,2)(0,2) to (0,1)(0,1)(0,1), giving us the binary number (0.01)2(0.01)_2(0.01)2​, which is 14\frac{1}{4}41​.

Now for the punchline. What is the set of all possible outputs of this function when we feed it every single point from our zero-length Cantor "dust"? Astonishingly, the image is the entire, solid interval [0,1][0,1][0,1]. Think about that. A function has taken a set with measure zero, a sparse collection of points, and stretched it—continuously, without tearing it—to perfectly cover a set with measure one. This function, sometimes called the "devil's staircase," reveals a profound distinction between the "length" of a set and the "number" of points it contains. The ternary representation isn't just a label; it's a genetic code that allows for this incredible geometric alchemy.

If that weren't enough, consider what happens when you take two points from the Cantor set, s1s_1s1​ and s2s_2s2​, and add them together. You might expect the result, s1+s2s_1+s_2s1​+s2​, to be another point in some sparse, dusty collection. The reality is far more shocking: the set of all possible sums, the Minkowski sum C+CC+CC+C, forms the entire solid interval from 000 to 222. It’s as if you have two handfuls of fine sand, and by picking one grain from each hand and adding their positions, you can land anywhere on a two-meter ruler. The structure encoded in the ternary digits allows this "dust" to fill space through the simple act of addition.

Symbolic Dynamics: The Oracle of Digits

Let's shift our view from static sets to dynamic action, into the realm of chaos theory. Consider a very simple-looking rule for a point xxx hopping around on the interval [0,1][0,1][0,1]: at each step, we map xxx to 3x(mod1)3x \pmod 13x(mod1) (that is, multiply by 3 and take the fractional part). This is a classic example of a chaotic map. An initial point's trajectory can seem random and unpredictable. But ternary expansion reveals a stunningly simple order underneath the chaos.

When you write xxx in base 3, say x=(0.d1d2d3… )3x = (0.d_1 d_2 d_3 \dots)_3x=(0.d1​d2​d3​…)3​, applying the map f(x)=3x(mod1)f(x)=3x \pmod 1f(x)=3x(mod1) does something remarkable: it simply erases the first digit and shifts all the other digits one place to the left. The new number is (0.d2d3d4… )3(0.d_2 d_3 d_4 \dots)_3(0.d2​d3​d4​…)3​. The ternary expansion of the initial point x0x_0x0​ is therefore not just a numerical label; it is a complete, step-by-step itinerary of the orbit's entire future. The first digit tells you which third of the interval ([0,1/3)[0,1/3)[0,1/3), [1/3,2/3)[1/3,2/3)[1/3,2/3), or [2/3,1)[2/3,1)[2/3,1)) the point starts in. The second digit tells you where it will be after one step, the third digit after two steps, and so on, ad infinitum.

This connection, a cornerstone of a field called symbolic dynamics, is incredibly powerful. Do you want to find a starting point that generates a periodic orbit repeating a certain pattern? You simply write down a repeating ternary expansion corresponding to that pattern and convert it to a fraction. Do you want to find all the starting points whose orbits only enter the "forbidden" middle third after, say, four steps? You just need to find all the numbers whose ternary expansions have their first '1' in the fifth decimal place. Complex questions about long-term dynamical behavior are transformed into simple, elegant questions about sequences of digits.

The Code of Nature and Information

This digit-based way of thinking extends far beyond the number line. In fractal geometry, we can construct the "Cantor dust" in the plane by taking the Cartesian product of the Cantor set with itself, C×CC \times CC×C. This is a fractal made of all points (x,y)(x,y)(x,y) in the unit square where both xxx and yyy have ternary expansions with only 000s and 222s. Slicing through this fractal reveals its intricate structure. A vertical slice at a coordinate xxx will be non-empty if and only if xxx itself belongs to the Cantor set. For instance, a slice at x=1/4x=1/4x=1/4 is a perfect copy of the Cantor set, because 1/4=(0.0202… )31/4 = (0.0202\dots)_31/4=(0.0202…)3​ uses only digits 000 and 222. The number system provides the very blueprint for the geometric object.

We can even find a home for these ideas in information theory. Imagine you are designing a communication system, but for some physical reason, you can only transmit signals corresponding to the digits 000 and 222—your "code space" is the Cantor set. A standard ternary digit can encode log⁡2(3)≈1.58\log_2(3) \approx 1.58log2​(3)≈1.58 bits of information. However, your restricted digits, which can only be one of two possibilities, can each only carry log⁡2(2)=1\log_2(2) = 1log2​(2)=1 bit of information. The ternary expansion allows us to quantify the "cost" of this constraint. For any given source of information, forcing the encoding to live in the Cantor set introduces a precisely calculable amount of redundancy, or inefficiency. What began as a number-theoretic curiosity becomes a practical constraint on the flow of information. Furthermore, by viewing the digits of an expansion as random variables, we can use the tools of probability to analyze the average behavior of functions defined on these complex sets, bridging the gap between number theory and statistics.

From a simple rule about digits, we have journeyed through paradoxes of infinity, witnessed the birth of form from dust, decoded the motion of chaotic systems, and quantified the flow of information. The ternary expansion is far more than a way to write down a number. It is a language, a code, and a lens that reveals the profound and often surprising unity woven through the fabric of mathematics and science.