# Thoughts on 1/7 and other rational numbers (Part 7)

In a previous post concerning roundoff error, I mentioned that the number $1/10$ equals $\displaystyle \frac{1}{2^4} + \frac{1}{2^5} +\frac{1}{2^8} + \frac{1}{2^9} + \frac{1}{2^{12}} + \frac{1}{2^{13}} + \dots$

In other words, the binary expansion of $1/10$ is $0.0001100110011001100110011001100....$

That’s the expansion of the fraction in base $2$, as opposed to base $10$.

In the previous post, I verified that the above infinite series actually converges to $1/10$: $S = \displaystyle \left(\frac{1}{2^4} + \frac{1}{2^5}\right) +\left(\frac{1}{2^8} + \frac{1}{2^9}\right) + \left(\frac{1}{2^{12}} + \frac{1}{2^{13}}\right) + \dots$ $S = \displaystyle \frac{3}{2^5} + \frac{3}{2^9} + \frac{3}{2^{13}} + \dots$ $S = \displaystyle \frac\frac{3}{2^5}}{\quad \displaystyle 1 - \frac{1}{2^4} \quad$ $S = \displaystyle \frac\frac{3}{32}}{\quad \displaystyle \frac{15}{16} \quad$ $S = \displaystyle \frac{3}{32} \times \frac{16}{15}$ $S = \displaystyle \frac{1}{10}$

Still, a curious student may wonder how one earth one could directly convert $1/10$ into binary without knowing the above series ahead of time.

This can be addressed by using the principles that we’ve gleaned in this study of decimal representations, except translating this work into the language of base $2$. In the following, I will use the subscripts $\hbox{ten}$ and $\hbox{two}$ so that I’m clear about when I’m using decimal and binary, respectively.

To begin, we note that $10_{\hbox{\scriptsize ten}} = 1010_{\hbox{\scriptsize two}} = 10_{\hbox{\scriptsize two}} \times 101_{\hbox{\scriptsize two}}$. (In other words, ten is equal to two times five.) So, following Case 3 of the previous post, we will attempt to write the denominator in the form $10_{\hbox{\scriptsize two}}^d \left(10_{\hbox{\scriptsize two}}^k - 1 \right)$, or $2_{\hbox{\scriptsize ten}}^d \left(2_{\hbox{\scriptsize ten}}^k - 1 \right)$

• If $k = 1_{\hbox{\scriptsize ten}}$, then $2_{\hbox{\scriptsize ten}}^1 - 1 = 1_{\hbox{\scriptsize ten}}$, but $1_{\hbox{\scriptsize ten}} \div 5_{\hbox{\scriptsize ten}}$  is not an integer.
• If $k = 2_{\hbox{\scriptsize ten}}$, then $2_{\hbox{\scriptsize ten}}^2 - 1 = 3_{\hbox{\scriptsize ten}}$, but $3_{\hbox{\scriptsize ten}} \div 5_{\hbox{\scriptsize ten}}$  is not an integer.
• If $k = 3_{\hbox{\scriptsize ten}}$, then $2_{\hbox{\scriptsize ten}}^3 - 1 = 7_{\hbox{\scriptsize ten}}$, but $7_{\hbox{\scriptsize ten}} \div 5_{\hbox{\scriptsize ten}}$  is not an integer.
• If $k = 4_{\hbox{\scriptsize ten}}$, then $2_{\hbox{\scriptsize ten}}^4 - 1 = 15_{\hbox{\scriptsize ten}}$. This time, $15_{\hbox{\scriptsize ten}} \div 5_{\hbox{\scriptsize ten}} = 3_{\hbox{\scriptsize ten}}$. Written in binary, $101_{\hbox{\scriptsize two}} \times 11_{\hbox{\scriptsize two}} = 1111_{\hbox{\scriptsize two}}$

We now return to the binary representation of $1/10_{\hbox{\scriptsize ten}} = 1/1010_{\hbox{\scriptsize two}}$. $\displaystyle \frac{1}{1010_{\hbox{\scriptsize two}}} = \displaystyle \frac{1}{1010_{\hbox{\scriptsize two}}} \times \frac{11_{\hbox{\scriptsize two}}}{11_{\hbox{\scriptsize two}}}$ $\displaystyle \frac{1}{1010_{\hbox{\scriptsize two}}} = \frac{11_{\hbox{\scriptsize two}}}{11110_{\hbox{\scriptsize two}}}$

Therefore, the binary representation has a delay of one digit and a repeating block of four digits: $\displaystyle \frac{1}{1010_{\hbox{\scriptsize two}}} = 0.0\overline{0011}$

Naturally, this matches the binary representation given earlier.