Cantor ternary set problem Let C be a cantor ternary set
If $x,y \in C,$ then obviously $x-y \in [-1,1]$
Conversely I want to prove that 
if $w \in [-1,1],$ then there exists $x,y \in C$ such that $x-y=w$
How to prove this problem?

Let $w$ in $[-1,1]$, then $w=-1+2u$ with $u$ in $[0,1]$. Like every number in $[0,1]$, $u$ can be written in base $3$, that is, as a series of negative powers of $3$, namely,
$$
u=\sum\limits_{k\geqslant1}\frac{u_k}{3^k},\qquad u_k\in\{0,1,2\}.
$$
Let $w_k=2u_k-2$, hence $w_k$ is in $\{-2,0,2\}$. Then 
$$
w=-1+\sum\limits_{k\geqslant1}\frac{w_k+2}{3^k}=\sum\limits_{k\geqslant1}\frac{w_k}{3^k}.
$$
For every $k\geqslant1$, define 


*

*$x_k=0$ and $y_k=2$ if $w_k=-2$, 

*$x_k=y_k=0$ if $w_k=0$, 

*and $x_k=2$ and $y_k=0$ if $w_k=2$. 


Then $w_k=x_k-y_k$ for every $k$ hence $w=x-y$ with 
$$
x=\sum\limits_{k\geqslant1}\frac{x_k}{3^k},\qquad
y=\sum\limits_{k\geqslant1}\frac{y_k}{3^k}.
$$
Since $x_k$ and $y_k$ are in $\{0,2\}$ for every $k$, both $x$ and $y$ are in $C$.
