TITLE: Ternary representation of Cantor set
QUESTION [10 upvotes]: Associate to each sequence $a=\{\alpha_n\},$ in which $\alpha_n$ is $0$ or $2$, the real number $$x(a)=\sum \limits_{n=1}^{\infty}\frac{\alpha_n}{3^n}.$$ Prove that the set of all $x(a)$ is precisely the Cantor set.
We know that $\frac{1}{3}\in C$ but also $\frac{1}{3}=\sum \limits_{n=2}^{\infty}\frac{2}{3^n}$ and $\frac{1}{3}=\frac{1}{3}+\sum \limits_{n=2}^{\infty}\frac{0}{3^n}$. And we have some ambiguity.
Can we also add condition that $\alpha_j=1$ for some $j$?
Can anyone explain this moment to me?

REPLY [9 votes]: Let $C_1= [0,\frac{1}{3}] \cup [\frac{2}{3}, 1]$, $C_2 = [0, \frac{1}{9}]\cup[\frac{2}{9},\frac{1}{3}]\cup[\frac{2}{3}, \frac{7}{9}]\cup[\frac{8}{9},1]$, $\ldots$ and continue, in this manner, defining the $C_k$ by "eliminating the middle third" of each interval in the previous $C_{k-1}$, then we have the Cantor tertiary set $$C=\bigcap_{k=1}^\infty C_k$$ 
and our task is to show that $C$ is precisely the set of all real numbers in $[0,1]$ that can be represented with only zeros and twos in its base-three decimal expansion. NOTE: finite decimal expansions, as always, are not formally well-defined; for instance, $\frac{1}{3} = 0.1 = 0.022222 \ldots$ so that $\frac{1}{3} \in C$ because it can be expressed with only zeros and twos in its base-three decimal expansion. Note, also, that $\frac{1}{3}$ is in every $C_k$ as defined above, so that it is in the intersection of all of them. 
This is going to be our general idea. If some $x \in C$, we show that $x$ has a base-three expansion consisting of only zeros and twos. But that doesn't let us off the hook yet - there perhaps could be numbers with base-three expansions consisting of only zeros and twos that are NOT in $C$, so we will, as our second component of the proof, show that given a number with a base-three expansion consisting of only zeros and twos, that number must be in $C$. 
We have that $x \in C$ if and only if $x \in C_k$ for all $k \in \mathbb{N}$. For $C_1$ note that $x$ can have a $0$ in the "one-thirds" place if $x$ is in $[0, \frac{1}{3}]$, or that $x$ can have a $2$ in the "one-thirds" place if $x$ is in $[\frac{2}{3}, 1]$. Likewise, for the second decimal place, consider which of the two intervals in $C_2$ where $x$ belongs (why do we only examine two, and not all four intervals used to construct $C_2$?) and note a zero or a two can be assigned accordingly for the second decimal place. Continue likewise, and formalize what I have written, to conclude that $x \in C$ if and only if $x$ has a base-three expansion consisting of only zeros and twos.