how to find the binary expansion of any number in the unit interval [0,1] For each integer $n\geq 1$ and $x\in [0,1]$, define $f_n(x)=x_n$ where $x_n$ is the $n$th binary digit of x. If x is a number with two binary expansions, use the expansion that ends with infinitely many zeroes. Draw the graphs of the first three members of the sequence  $\{f_n-1/2\}$.
In fact I don't know how to represent the binary expansion of any number in the unit interval [0,1]. Thanks! 
 A: To represent $x \in [0,1]$ is the same as writing $x= \sum_{n=1}^\infty \frac{x_n}{2^n}$, where $x_n$ is $1$ or $0$. Note that 
$$x > \sum_{n=1}^K \frac{x_n}{2^n}$$ 
for any finite natural number $K$. To find out $x_n$'s, first set $x_1= 0$ if $x < 1/2$ and $x_1= 1$ if $x \geq 1/2$. Now consider $x- x_1/2$. Use this to set $x_2 = 0$ if $x- x_1/2 < 1/4$ and $x_2  = 1$ if $x- x_1 /2 \geq 1/4$. 
In general, if $x_1, \cdots, x_K$ has been found, consider 
$$(*)  \ \ \ X_K = x- \sum_{n=1}^K \frac{x_n}{2^n}$$
and set $x_{K+1} = 0$ if $X_K < 1/ 2^{K+1}$ and $x_{K+1} = 1$ if $X_K \geq 1/2^{K+1}$. By this way you found all the $x_n$'s. 
A: You can get the binary expansion using the floor function as part of an algorithm that uses theory surrounding the limit,
$\tag 1 \quad a = {\displaystyle \lim _{n \to +\infty} \frac{ \lfloor a 2^n \rfloor}{2^n}},\; \text{ for any } a \in \Bbb R$
EXAMPLE: Write $\frac{3}{14}$ as a binary expansion.
$\text{floor}: \lfloor \frac{3}{14} \rfloor =  0$
$2^{-1}\;\,: \lfloor 2 \times \frac{3}{14} \rfloor = \lfloor 0+\frac{3}{7} \rfloor = 0$
$2^{-2}\;\,: \lfloor 2 \times \frac{3}{7} \rfloor = \lfloor 0 + \frac{6}{7} \rfloor = 0$
$2^{-3}\;\,: \lfloor 2 \times  \frac{6}{7} \rfloor = \lfloor 1 + \frac{5}{7} \rfloor = 1$
$2^{-4}\;\,: \lfloor 2 \times  \frac{5}{7} \rfloor = \lfloor 1 + \frac{3}{7} \rfloor = 1$
Since the $2^{-5}$-calculation with input $\frac{3}{7}$ can be looped back to the $2^{-2}$-calculation, we can write
$\quad \frac{3}{14} = {0.0\overline{011}}_{\; base=2}$
