how to find the binary expansion of any number in the unit interval [0,1]

12.2k Views Asked by At

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!

1

There are 1 best solutions below

2
On BEST ANSWER

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.