If $x$ is rational and in the interval ${[0,1)}$, is it always possible to find constants $a_1, a_2, ..., a_n\in\{-1, 0, 1\}$ such that for some integer $n\geq{1}$, $x = a_1\cdot2^{-1} + a_2\cdot{2^{-2}} + \cdots + a_n\cdot{2^{-n}}$?
This question is purely out of curiosity. When I see something like this, could I think about "base $1/2$" (not really sure to write it out like I would binary though) or does the $-1$ option for a constant pose an issue? I also thought about how you can make any positive integer via a sum of powers of $2$ (because binary), could I use that insight to the above problem?
Additionally, would changing the above condition to $a_1, a_2, ..., a_n\in\{0, 1\}$ change the answer?
I was not sure if this was more of a linear algebra question thinking about the span of an infinite basis I sort of have or if this is more of a real analysis question considering the density of the rationals. Thank you for your insight.