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
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
and declare the infinite decimal expansion
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,
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:
Theorem 6.1.1.
Given a sequence \((a_n)\) with \(a_n \in \{0,1, \dots ,9\}\) for all \(n\text{,}\) the decimal expansion \(x= 0.a_1 a_2 \dots a_n \dots\) given by the limit of the sequence
defines a real number \(x\) satisfying \(0 \leq x \leq 1\text{.}\)
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.
Theorem 6.1.2.
Let \(x\in\RR\) satisfy \(0 \leq x \lt 1\text{.}\) Then there is a sequence of integers \((a_n)\text{,}\) with \(a_{n}\in \{0,1,\dots,9\}\) for all \(n\text{,}\) so that if we let
then \(x_n \to x\) as \(n \to \infty\text{.}\)
Proof.
We find the integers \(a_{n}\) inductively. To find \(a_1\text{,}\) we split the interval \([0,1)\) into 10 equal subintervals
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
To find \(a_2\text{,}\) we split the interval \(\left[\frac{a_1}{10}, \frac{a_1 +1}{10}\right)\) into 10 equal subintervals
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
Continuing in this way, we find for each \(n\) a unique integer \(a_{n}\in \{0,1,\dots,9\}\) so that
and so that
Then we have
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
to mean that the sequence \((x_n)\) defined by
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
since, by the formula for finite geometric series, \(0.499999 \dots 99\) (with \(n\) \(9\)'s)
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.
Theorem 6.1.3.
Let \(0 \leq x \lt 1\) and suppose that \(x=0.a_{1}a_2\ldots =0.b_{1}b_{2}\dots\text{.}\) Let \(\ell\) be the smallest integer for which \(a_{\ell}\neq b_{\ell}\) and suppose that \(a_{\ell}\lt b_{\ell}\text{.}\) Then \(b_{\ell}=a_{\ell}+1\text{,}\) and for all \(k> \ell\) we have \(b_{k}=0\) and \(a_{k}=9\text{.}\)
Proof.
We have
and since \(a_j = b_j\) for \(1 \leq j \leq \ell -1\) we have
But
(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
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:
Theorem 6.1.4. Pigeonhole Principle.
If \(S\) and \(T\) are two sets, then there is an injection \(S \to T\) only if \(|S| \leq |T|\text{.}\) In particular, if \(|S| \gt |T|\text{,}\) then for any map \(f \colon S \to T\text{,}\) there exist \(s_1,s_2 \in S\) such that \(f(s_1)=f(s_2)\text{.}\)Lemma 6.1.5.
If \(x\geq 0\) is rational, then it has a periodic decimal expansion, that is,
Here, this notation means that the digits \(b_{1}, \dots b_{\ell}\) repeat, so
Proof.
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.
Corollary 6.1.6. of the proof.
If \(p\) and \(q\) are positive integers, the rational number \(p/q\) has a decimal expansion with period at most \(q\text{.}\)
The converse to Lemma 6.1.5 is also true:
Lemma 6.1.7.
If \(x\geq 0\) has a periodic decimal expansion, then \(x\) is rational.
Proof.
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
Let \(z = 0.{b_{1}b_{2}\ldots b_{\ell}}000\ldots\text{,}\) which is certainly rational. Now \(y = \limn y_n\) where
so that
which is indeed rational.
We now summarise the results on rationality and periodicity:
Theorem 6.1.8.
A number \(x \geq 0\) is rational \(\iff\) it has a periodic decimal expansion.
Noting that all the \(x\) which have two distinct decimal expansions are necessarily rational, we obtain:
Corollary 6.1.9.
A number \(x \geq 0\) is irrational \(\iff\) it has an aperiodic decimal expansion.
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{.}\)
Example 6.1.10.
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.