Ternary Expansion Ambiguity 


I am following along and reading this notes: https://www.maths.tcd.ie/~levene/221/pdf/cantor.pdf
I am having trouble understanding why we necessarily have $e_n=d_n+1$, 
$d_{n+1}= d_{n+2} =···= 2$
and $e_{n+1} = e_{n+2} = ··· = 0$
when $d_n > e_n$. It would much appreciated if someone can guide me through this.  
 A: All numbers have at least one ternary expansion. For example,
\begin{eqnarray}
\frac{1}{2} &=& 0.11111111... \\
\frac{2}{9} &=& 0.02000000... \\
\frac{\pi}{8} &=& 0.21001211... \\
\gamma &=& 0.12012021...
\end{eqnarray}
However, some numbers have two ternary expansions
\begin{eqnarray}
\frac{2}{9} &=& 0.02000000... = 0.01222222...\\
\frac{19}{27} &=& 0.20100000... = 0.20022222...\\
\frac{100}{243} &=& 0.10201000... = 0.10200222...
\end{eqnarray}
Note that whenever a number has two ternary expansions, it always has one that ends in $222222...$ and one that ends in $000000...$, with the preceding digit being one larger for the $000000...$ expansion. That's what the article is talking about.
You'll also notice that such numbers are always fractions with a power of 3 in the denominator. This is no coincidence, as they're exactly the numbers with terminating ternary expansions. As for why the other expansion has $222222...$, consider that $\sum_1^\infty (2/3)^n = 1$.
A: You'll have to play around with the inequalities a little bit to establish that. 
To make life easy, assume without loss of generality $d_1 \neq e_1$. Next, notice,
$$x = \sum_{n \geq 1} \frac{e_n}{3^n} = \frac{e_1}{3} + \sum_{n \geq 2} \frac{e_n}{3^n} \geq \frac{e_1}{3}$$
And also, 
$$x = \sum_{n \geq 1} \frac{d_n}{3^n} = \frac{d_1}{3} + \sum_{n \geq 2} \frac{d_n}{3^n} \leq \frac{d_1}{3} + \sum_{n \geq 2} \frac{2}{3^n} = \frac{d_1+1}{3}$$
So, we have, $d_1 < e_1 \leq d_1 + 1 \implies e_1 = d_1+1$
A: As in the case of  $\frac 13$ there are two ternary expressions.   In this example $n $ as they have defined it $=1$.  That is, the first place they don't agree is the first place after the decimal. ..
So, $0.e_1e_2\dots e_n=0.10\dots0$ and $0.d_1d_2\dots d_n=0.02\dots 2\dots $.  Looking at this you should be able to see the $e_n's $ and $d_n's $ are as described. ..
In particular,  $e_1=1=0+1=d_1+1$, and after that all the $e_n's $ are $0$,  and all the $d_n's $ are $2$...
It turns out this is always the situation when ambiguity occurs  (that is, there is more than one expression, in ternary,for a number in the cantor set )... 
