Skip to main content

Section 6.1 Decimals

Given a sequence \((a_n)\) with each \(a_n \in \{0, 1, \dots , 9\}\text{,}\) what exactly do we mean by the decimal

\begin{equation*} 0.a_1 a_2 \dots a_n \dots? \end{equation*}

We all know the convention that the number \(a_1\) gives the number of tenths, \(a_2\) gives the number of hundredths, \(a_3\) gives the number of thousandths etc. But what do we mean by the ellipses at the end of the expansion? A good way to make sense of this is to consider the finite decimal expansions

\begin{equation*} x_n := 0.a_1 a_2 \dots a_n = \frac{a_1}{10} + \frac{a_2}{100} + \dots + \frac{a_n}{10^n} \end{equation*}

and declare the infinite decimal expansion

\begin{equation*} 0.a_1 a_2 \dots a_n \dots \end{equation*}

to be the limit of the sequence \((x_n)\) as \(n \to \infty\text{.}\) But this naturally poses the question of whether the limit must even exist. Fortunately this is easy: the sequence \((x_n)\) consists of positive numbers, and they satisfy \(x_{n+1} \geq x_n\) so that \((x_n)\) is increasing. Finally, using the formula for a finite geometric progression,

\begin{equation*} x_n = \frac{a_1}{10} + \frac{a_2}{100} + \dots + \frac{a_n}{10^n} \leq \frac{9}{10} + \frac{9}{100} + \dots + \frac{9}{10^n} = \frac{9}{10}\frac{(1 - (\frac{1}{10})^{n+1})}{1 - \frac{1}{10}} \leq \frac{9}{10}\frac{1}{1 - \frac{1}{10}}=1\text{,} \end{equation*}

so that \((x_n)\) is bounded above by \(1\text{.}\) By the MCT, the sequence \((x_n)\) converges to some \(x \in \RR\) satisfying \(0 \leq x \leq 1\text{.}\) We have thus proved:

What about the converse — does every real number \(x\) with \(0 \leq x \lt 1\) have a decimal expansion? Our intuition and experience tells us that this is so, but now we prove it more formally.

We find the integers \(a_{n}\) inductively. To find \(a_1\text{,}\) we split the interval \([0,1)\) into 10 equal subintervals

\begin{equation*} \left[0,\frac{1}{10}\right), \; \left[\frac{1}{10}, \frac{2}{10}\right), \; \dots , \; \left[\frac{9}{10},\frac{10}{10}\right)\text{.} \end{equation*}

Then \(x\) must be in exactly one of these intervals, say \(\left[\frac{a_1}{10}, \frac{a_1 +1}{10}\right)\text{,}\) for a unique \(a_1 \in \{0, 1, \dots , 9\}\text{.}\) Notice that

\begin{equation*} 0 \leq x - \frac{a_1}{10} \lt \frac{1}{10}\text{.} \end{equation*}

To find \(a_2\text{,}\) we split the interval \(\left[\frac{a_1}{10}, \frac{a_1 +1}{10}\right)\) into 10 equal subintervals

\begin{equation*} \left[\frac{a_{1}}{10},\frac{a_{1}}{10}+\frac{1}{10^2}\right),\; \left[\frac{a_{1}}{10}+\frac{1}{10^2},\frac{a_{1}}{10}+\frac{2}{10^2}\right), \; \cdots \; ,\left[\frac{a_{1}}{10}+\frac{9}{10^2},\frac{a_{1}+1}{10}\right)\text{.} \end{equation*}

Then \(x\) must be in exactly one of these intervals as well, which can be written as \(\left[\frac{a_{1}}{10}+\frac{a_{2}}{10^2},\frac{a_{1}}{10}+\frac{a_2+1}{10^2}\right)\) for some unique \(a_{2}\in \{0,1, \dots ,9\}\text{.}\) Notice that

\begin{equation*} 0 \leq x - \left(\frac{a_1}{10} + \frac{a_2}{10^2}\right) \lt \frac{1}{100}\text{.} \end{equation*}

Continuing in this way, we find for each \(n\) a unique integer \(a_{n}\in \{0,1,\dots,9\}\) so that

\begin{equation} x\in \left[\frac{a_{1}}{10}+\cdots +\frac{a_{n}}{10^{n}}, \frac{a_{1}}{10}+\cdots +\frac{a_{n}+1}{10^{n}}\right)\label{e_xininterval}\tag{6.1.1} \end{equation}

and so that

\begin{equation*} 0 \leq x- \left( \frac{a_{1}}{10}+\cdots +\frac{a_{n}}{10^{n}} \right) \lt \frac{1}{10^n}\text{.} \end{equation*}

Then we have

\begin{equation*} 0 \leq x - x_n \lt \frac{1}{10^n}\text{,} \end{equation*}

and since \(1/10^{n} \to 0\) as \(n \to \infty\text{,}\) we have that \(x_n \to x\) by the squeeze theorem.

What about decimal expansions \(x = a_0.a_1 a_2 \dots\) for real numbers outside the interval \([0,1)\text{?}\) If \(a_0 \in \mathbb{Z}\) and \(a_n \in \{0,1,2, \dots , 9\}\) for \(n\geq 1\) we write

\begin{equation*} x = a_0.a_1 a_2 \dots \end{equation*}

to mean that the sequence \((x_n)\) defined by

\begin{equation*} x_n = a_0 + \frac{a_{1}}{10}+\cdots +\frac{a_{n}}{10^{n}} \end{equation*}

converges to \(x\text{.}\)

What about uniqueness of decimal expansions? Can a real number \(x\) be represented by two distinct decimal expansions? Unfortunately, yes: for example

\begin{equation*} \frac{1}{2} = 0.5000000\ldots = 0.4999999\dots \end{equation*}

since, by the formula for finite geometric series, \(0.499999 \dots 99\) (with \(n\) \(9\)'s)

\begin{equation*} = \frac{4}{10} + \frac {\frac{9}{100}(1- (\frac{1}{10})^{n})} {1- \frac{1}{10}} \rightarrow \frac{4}{10} + \frac{1}{10} = \frac{1}{2} \end{equation*}

as \(n \to \infty\text{.}\) (Which of these two representations does the procedure of Theorem 6.1.2 spit out?) It turns out that situations like this are essentially the only ones when this happens (one expansion trailing \(0\)'s and the other trailing \(9\)'s), and there are never more than two decimal expansions that give the same number.

We have

\begin{equation*} 0.b_{1}b_{2}\dots b_{\ell -1}b_{\ell}000 \ldots \leq x \leq 0.a_1 a_2 \dots a_{\ell - 1} a_{\ell} 999 \dots\text{,} \end{equation*}

and since \(a_j = b_j\) for \(1 \leq j \leq \ell -1\) we have

\begin{equation*} 0.a_1 a_2 \dots a_{\ell-1} b_{\ell}000\ldots \leq x \leq 0.a_1 a_2 \dots a_{\ell - 1} a_{\ell} 999 \dots \end{equation*}

But

\begin{equation*} 0.a_1 a_2 \dots a_{\ell - 1} a_{\ell} 999 \ldots = 0.a_1 a_2 \dots a_{\ell - 1} (a_{\ell} +1)000 \dots \end{equation*}

(once again by the formula for finite geometric series). Therefore \(b_{\ell} \leq a_{\ell} +1\text{.}\) Since we are assuming \(a_{\ell} \lt b_{\ell}\text{,}\) this forces \(b_{\ell} = a_{\ell} +1\text{.}\)

Now we have

\begin{equation*} x = 0.a_1 a_2 \dots a_{\ell - 1} a_{\ell} a_{\ell + 1} \ldots = 0.a_1 a_2 \dots a_{\ell - 1} (a_{\ell} + 1) b_{\ell + 1} \ldots \end{equation*}

and if for some \(k > \ell\) we had either \(a_k \lt 9\) or \(b_k > 0\text{,}\) this would be violated. Hence we conclude that for all \(k > \ell\) we have \(a_k = 9\) and \(b_k = 0\text{.}\)

When we find a decimal expansion of a rational number, it begins to repeat. Why is this? Because when doing long division, eventually you obtain some remainder a second time, and then you know the division process will repeat what you did from the beginning. This holds for all rational numbers. To prove this, let's state a basic fact from set theory:

Write \(x=p/q\) where \(p\) and \(q\) are positive integers. Each step of the long division algorithm \(q\overline{)p.0000\ldots}\) returns remainders in \(\{1,\ldots, q\}\text{.}\) By the pigeonhole principle, one remainder, call it \(k\text{,}\) must occur twice. Because \(p.0000\ldots\) has trailing zeroes, the algorithm starts repeating at that point.

We define the period of a decimal expansion to be the smallest number of digits in a repeating sequence in the decimal expansion. For example, \(0.121212..\text{.}\) has period \(2\text{,}\) \(0.34\overline{345}\) has period 3. If there are no repeating sequences we say that the decimal expansion is aperiodic.

The converse to Lemma 6.1.5 is also true:

Suppose that \(x=a_{0}.a_{1}a_{2}\ldots a_{k} \overline{b_{1}b_{2}\ldots b_{\ell}}\text{.}\) Let \(y= 0.\overline{b_{1}b_{2}\ldots b_{\ell}}\text{.}\) If we show that \(y\) is rational, then so will \(x\) be, because

\begin{equation*} x = a_0 + \frac{a_1}{10} + \dots + \frac{a_k}{10^k} + \frac{y}{10^{k}}\text{.} \end{equation*}

Let \(z = 0.{b_{1}b_{2}\ldots b_{\ell}}000\ldots\text{,}\) which is certainly rational. Now \(y = \limn y_n\) where

\begin{equation*} y_n = z\left(1 + \frac{1}{10^{\ell}} + \frac{1}{10^{2\ell}} + \dots + \frac{1}{10^{n\ell}}\right) = \frac{z\left(1 - 10^{-(n+1)\ell}\right)}{1- 10^{-\ell}} \end{equation*}

so that

\begin{equation*} y = \frac{z}{1- 10^{-\ell}} \end{equation*}

which is indeed rational.

We now summarise the results on rationality and periodicity:

Noting that all the \(x\) which have two distinct decimal expansions are necessarily rational, we obtain:

Note that we proved this without ever working with irrational numbers! This gives us a way of constructing many irrational numbers, not just ones that arise as roots like \(\sqrt{2}\) or \(3^{\frac{1}{2}}\text{.}\)

The number \(0.10010001\cdots\) where the number of zeros between each \(1\) is strictly increasing is irrational, because there is no way the decimal expansion can repeat.