# When representing a base-n number in decimal ($\frac{x}{n^l}$), will there be a different set of terminating representable numbers than base-10?

Forgive me if I have set this up wrong, I haven't done proofs in a long time. I was thinking at lunch today what it would be like if we could write binary behind a decimal point. Imagine

$$110.11 = 6.75$$

This made me think, are there numbers in base-10 decimal that cannot be represented rationally in base-2 decimal? Maybe, but since 2 evenly divises 10, maybe not. How about 3? $n$?

This is my conjecture:

$$\forall ( x_1,l_1,n \in Z | x_1 < 10^{l_1} ) \exists i_2,l_2 (\frac{x_1}{10^{l_1}} = \frac{x_2}{n^{l_2}} )$$

How would I go about proving it?

-
A number is rational if and only if it is a quotient of two integers; the representation base is irrelevant. Do you mean, will the numbers that have a non-repeating $n$-ary representations be exactly the irrationals? –  Arturo Magidin Jun 22 '12 at 20:06
Yes, this is what I mean. –  Caleb Jares Jun 22 '12 at 20:15
Except that the title that you edited does not agree with what you say in your previous comment. In your title you are asking about terminating expansion, but above you agreed that you were talking about non-repeating expansions. Which is it? –  Arturo Magidin Jun 22 '12 at 21:02
Both mean the same thing. If there's a different set of terminating numbers there will also be a set of non-terminating numbers. Correct? –  Caleb Jares Jun 22 '12 at 22:26
:, No, they don't mean the same thing. A terminating expansion is one that is eventually equal to ....0000000....; a repeating expansion is one that eventually repeats (like ...03820382038203820382...) Every terminating expansion is repeating. Not every repeating expansion terminates. And neither of them is a non-repeating expansion. The set of terminating numbers may be different, but the set of non repeating expansions is the same regardless of the base. –  Arturo Magidin Jun 22 '12 at 23:46

I think that you’re confusing rational with having a terminating decimal expansion. The two are not synonymous. Which numbers with terminating decimal expansions depends on the base; which numbers are rational does not.

Added: The rational numbers are those that can be represented as quotients of integers; the actual representation of the integers is irrelevant. In any base these numbers will have expansions that either terminate or eventually repeat. (Actually, termination can be viewed as eventually repeating the digit $0$.)

In order for the expansion of a fraction $m/n$ in lowest terms to terminate in base $b$, it’s necessary and sufficient that all of the prime factors of $n$ also divide $b$.

-

Let $b$ be a positive integer greater than $1$, so that we can talk about "$b$-ary expansion".

The $b$-ary expansion of a rational number $q$ terminates if and only if $q$ can be written as a (reduced) fraction $q=\frac{r}{s}$, where $r$ and $s$ are integers, and $s$ divides some power of $b$ (that is, every prime that divides $s$ also divides $b$).

Thus, in the usual decimal notation, the only rational numbers with terminating decimal expansion are those that can be written as $\frac{r}{s}$, with $s=1$, or $s$ a product of powers of $2$ and powers of $5$. (We would have better luck finding rationals with terminating expansion if our base was more "divisible"...)

But a terminating decimal expansion is not equivalent to being rational: $\frac{1}{3}$ is rational, but has no terminating decimal expansion. A number is rational if and only if it has an eventually periodic decimal expansion: it eventually repeats (e.g., $\frac{1}{2}$ eventually repeats, since $\frac{1}{2} = 0.5000000\ldots$).

This also holds in any other base. That is:

Theorem. Let $$q = \sum_{i=-n}^{\infty} \frac{a_i}{b^i}$$ with $0\leq a_i\lt b$, and $n\geq 0$. Then $q$ is a rational number if and only if the sequence $(a_i)$ is eventually periodic; that is, there exist positive integers $k,\ell$ such that $a_{i}=a_{i+\ell}$ for all $i\geq k$.

Proof. If $a_i = a_{i+\ell}$ for all $i\geq k$, then \begin{align*} \sum_{i=-n}^{\infty}\frac{a_i}{b^i} &= \left(\sum_{i=-n}^{k-1}\frac{a_i}{b^i}\right) + \sum_{j=0}^{\infty}\left(\frac{a_{k+j\ell}}{b^{k+j\ell}} + \frac{a_{k+j\ell+1}}{b^{k+j\ell+1}} + \cdots + \frac{a_{k+j\ell+(\ell-1)}}{b^{k+j\ell+(\ell-1)}}\right)\\ &= \sum_{i=-n}^{k-1}\frac{a_i}{b^i} + \sum_{j=1}^{\infty}\left(\frac{1}{b^{\ell}}\right)^j\left(\frac{a_k}{b^k} + \frac{a_{k+1}}{b^{k+1}} + \cdots + \frac{a_{k+\ell-1}}{b_{k+\ell-1}}\right). \end{align*} Now, the first summand is a rational number. The second summand is of the form $$\sum_{n=1}^{\infty} kr^n$$ where $k$ and $r$ are rational numbers, $r\lt 1$. It is well-known that this sum is equal to $$\sum_{n=1}^{\infty}kr^n = k\left(\frac{r}{1-r}\right),$$ which, when $r$ and $k$ are both rationals, will also be a rational. Thus, the number represented by an eventually repeating $b$-ary expansion will be a sum of rational numbers, and hence rational.

Conversely, if a number is rational, then we can write it as $\frac{r}{s}$ with $r$ and $s$ integers. We can then perform the usual division algorithm, writing everything in base $b$, to obtain the $b$-ary expansion. Since there are only finitely many possible remainders modulo $s$, this process will eventually result in a repeated remainder, which will per force produce a repeating $b$-ary expansion. $\Box$

-

A number is irrational if it cannot be written as the quotient of two integers; this is a notion independent of the base in consideration. A rational number have a finite or repeating expansion in any base, and an irrational number will have a non-repeating infinite expansion in any base.

For example, $\frac{1}{3}$ is rational, and we write it $0.333 \ldots_{10}$ in decimal expansion, but in base $3$, for example, we can write it as $0.1_3$, and in base $6$ as $.2_6$. The rational number $\frac{1}{3}$ will have a finite or repeating expansion in any base, but never a non-repeating infinite expansion. The number $\pi$ is irrational, and in base $10$ we write it as $3.141592\ldots_{10}$, but in base $2$ it is $11.001001000\ldots_2$; in both bases the expansion will be infinite and non-repeating.

To answer your question: no, the set of terminating or repeating numbers doesn't depend on the base considered.

We fix a base $b$ ($b \in \Bbb N_{\geq 2}$). If we have a number $x$ with a finite expansion in base $b$, then $x = a_ka_{k-1}\ldots a_0.b_1\ldots b_n$ in base $b$. Multiplying by $b^n$ we get $b^n\cdot x = a_ka_{k-1}\ldots a_0b_1\ldots b_n$, and so $\displaystyle x = \frac{a_ka_{k-1}\ldots a_0b_1\ldots b_n}{b^n}$, a ratio of two integers. This shows $$x \text{ has a finite expansion in base }b \Rightarrow x \text{ is rational}$$

Now consider $x$ having a repeating infinite expansion in base $b$:

\begin{align*}x &= a_ka_{k-1}\ldots a_0.b_1\ldots b_n c_1 c_2\ldots c_rc_1c_2 \ldots c_r\ldots \qquad \text{(the repeating part is } c_1\ldots c_r \text{)}\\ &\therefore b^n\cdot x = a_ka_{k-1}\ldots a_0b_1\ldots b_n.c_1 c_2\ldots c_rc_1c_2 \ldots c_rc_1c_2 \ldots c_r\ldots \\ &\therefore b^n\cdot x - a_ka_{k-1}\ldots a_0b_1\ldots b_n = 0.c_1 c_2\ldots c_rc_1c_2 \ldots c_rc_1c_2 \ldots c_r\ldots \\ &= \sum_{i=1}^\infty c_1 c_2\ldots c_r\cdot b^{-ri} = c_1 c_2\ldots c_r \sum_{i=1}^\infty b^{-ri}\end{align*}

You might recognize this sum as a geometric series:

$\displaystyle \sum_{i=1}^\infty b^{-ri} = \sum_{i=1}^\infty (b^{-r})^i = \sum_{i=0}^\infty (b^{-r})^i -1= \frac{1}{1-b^{-r}} - 1 = \frac{1 - 1 + b^{-r}}{1-b^{-r}} = \frac{1}{b^r-1}$

Then we have:

\begin{align}b^n \cdot x &- a_ka_{k-1}\ldots a_0b_1\ldots b_n = c_1 c_2\ldots c_r \cdot \frac{1}{b^r-1} \\ \therefore &x = \frac{c_1 c_2\ldots c_r \cdot \frac{1}{b^r-1} - a_ka_{k-1}\ldots a_0b_1\ldots b_n}{b^n}= \frac{c_1 c_2\ldots c_r - (b^r-1)\cdot a_ka_{k-1}\ldots a_0b_1\ldots b_n}{b^n(b^r-1)} \end{align}

which is ratio of two integers. This proves

$$x \text{ has a repeating expansion in base }b \Rightarrow x \text{ is rational}$$

Then, since $x$ can only be rational or irrational we have, for any $b \in \Bbb N_{\geq 2}$:

$$x \text{ has a finite or repeating expansion in base }b \Leftrightarrow x \text{ is rational}$$

-
You confirm my revised suspicion: the set of representable non-terminating numbers does depend on the base. Thanks! –  Caleb Jares Jun 22 '12 at 20:21
@cable729 You're welcome. Actually, you can think of any terminating number as a repeating number with period $0$: $$\frac{1}{2} = .5_{10} = .5000000\ldots_{10}$$ This helps see that the real difference isn't whether the expansion is finite or infinite, but whether it is repeating or non-repeating (which coincides with when the number is rational or irrational). –  talmid Jun 22 '12 at 20:49
@talmid: You mean "period 1". –  MJD Jun 22 '12 at 21:10
@MarkDominus No, I mean that the period is the one-digit string of numbers $0$. Maybe I'm not using appropriate terminology; I meant to refer to the "repeating part" of the decimal expansion. –  talmid Jun 22 '12 at 21:11
@talmid: $1/7 = 0.\overline{142857}$ has a period of 6. –  MJD Jun 22 '12 at 21:13