§16 ★ Decimal Expansions of Real Numbers
We begin by recalling the brief discussion of decimals in Discussion 10.3. There we considered a decimal expansion , where is a nonnegative integer and each digit belongs to . This expansion represents the real number
which we can also write as , where .
So every decimal expansion represents a nonnegative real number. We prove the converse after formalizing long division. The development here is based on suggestions by Karl Stromberg.
Why this matters
Decimals are how most of us picture real numbers, so it is worth checking that the picture is accurate: every nonnegative real has a decimal expansion, almost every real has exactly one, and the rationals are exactly the ones whose digits eventually repeat. Each of these facts is a short argument built on limits and geometric series.
Consider with positive integers. The term causes no difficulty, so assume . Take , . Name the digits and the remainders ; the first steps give , and , . Next we divide into and get . The quotient is the third digit , and is the new remainder. Then we multiply by and repeat.
In general, set . At each stage
This construction yields
and, for ,
Since each , , so (5) gives : thus is a decimal expansion for .
Equation (4) follows from . For (5) we use induction. From (2), , so
Substituting this into (5) gives
which is (5) with replaced by .
Try it: long division, step by step
Section titled “Try it: long division, step by step”Each column shows the digit and remainder . The first remainder that repeats is highlighted: from there the whole computation cycles, which is the heart of Theorem 16.5.
Existence and uniqueness
Section titled “Existence and uniqueness”Every nonnegative real number has at least one decimal expansion.
My notes(saved)
Proof
It suffices to consider . We use the floor function: is the largest integer less than or equal to . Since , we can write
Note since . Therefore
Suppose for some we have chosen in and in so that
Since , we can write
Solving (4) for and substituting into (3) gives
completing the induction. Since ,
so is a decimal expansion for .
∎Intuitiondigits as zooming in
The first digit says which of the ten intervals contains . The second says which tenth of that interval contains it, and so on. The proof of Theorem 16.2 is this zooming-in procedure written out: each picks the next tenth. After digits, is pinned to an interval of length , which is why the truncations converge to .
As noted in Discussion 10.3, and are decimal expansions of the same real number: the series and both equal . Similarly and both represent (Exercise 16.1). The next theorem says this is essentially the only way a number can have two decimal expansions.
A real number has exactly one decimal expansion, or else has two decimal expansions, one ending in all ’s and the other ending in all ’s.
Used in Theorem 16.5, Exercise 16.2, Exercise 16.8
My notes(saved)
Proof
Assume . If has expansion with , then it has one other, . If has expansion with , then it has one other, . The reader can check these claims (Exercise 16.2).
Now suppose has two distinct expansions and .
Case . If any , then by Exercise 16.3
a contradiction. So and the expansions are and .
Case . Let ; we may assume . If for some , then by Exercise 16.3
a contradiction. Thus for . Likewise, if for some , then
a contradiction. So for , , and for .
∎Try it: two expansions, nested intervals
Section titled “Try it: two expansions, nested intervals”Pick a terminating decimal such as or and follow either expansion. Each digit selects one tenth of the previous interval, and the number stays inside every interval, so the expansion ending in ’s and the one ending in ’s both zoom in on the same point.
Common pitfall0.999… is not “just below” 1
is not an approximation to . It is the limit of , and that limit equals . The two expansions are two names for one number. By Theorem 16.3 this ambiguity happens only for numbers with a terminating expansion, that is, numbers of the form .
Repeating decimals
Section titled “Repeating decimals”An expression represents the decimal expansion in which the block repeats forever:
Such an expansion is a repeating decimal.
My notes(saved)
Every integer is a repeating decimal, e.g. . Another simple example:
is the repeating decimal . We evaluate it:
Any repeating decimal can be evaluated as a rational number this way, as the next theorem shows.
We find the decimal expansion of . Long division gives , i.e. . To check:
Many books leave the next theorem as an exercise, probably to avoid its notation. If the details seem too complicated, move on to Examples 4–7.
A real number is rational if and only if its decimal expansion is repeating. (Theorem 16.3 shows that if has two decimal expansions, both are repeating.)
My notes(saved)
Proof
First assume has a repeating expansion . Then
so it suffices to show is rational. Write . Then
which is rational. In fact, writing for the integer (not the product), ; see Example 3.
Next consider a positive rational with , and assume . As in 16.1, where and, for ,
Since are integers, each is an integer, so
This set has elements, so the first remainders cannot all be distinct: there are integers and with and .
Given , the integers and are uniquely determined. Thus implies and . From we get and , and a simple induction shows “ and ” for all . So the expansion of is periodic with period after the first digits:
∎Intuition
The proof is a counting argument. Long division has only possible remainders, so a remainder must eventually repeat, and from that moment on the computation repeats as well. If the remainder ever appears, the expansion terminates. Otherwise only the remainders are available, so the repeating block has at most digits. For it has exactly .
Given , the uniqueness of and follows from the so-called division algorithm, which is really a theorem showing that division never breaks down: if is a positive integer and , there are unique integers and with and . Here is the quotient and the remainder. With , naming and gives formula (2) in the proof.
Irrational numbers
Section titled “Irrational numbers”The expansion
represents an irrational number. It cannot be repeating, because we arranged arbitrarily long blocks of ’s.
We do not know the complete decimal expansions of , and many other familiar irrationals, but by the last theorem we know they cannot be repeating.
We have claimed and are irrational. These and many other facts are proved in a fascinating book by Ivan Niven.
- is irrational. Assume with . Then and are both integers, so the difference is a positive integer. But this number is less than a contradiction.
- is irrational, from which the irrationality of follows (Exercise 16.10). The proof is sketched below.
- It is even harder to prove and are not algebraic numbers (Definition 2.1); see Niven’s book, Theorems 2.12 and 9.11.
Proof that π² is irrational
The key is the sequence of integrals
Claim 1. There are polynomials with integer coefficients, of degree at most , such that for all .
First we find a recursion for . Integrating by parts (Theorem 34.2) twice,
Indeed,
since has a factor , which vanishes at and . Therefore
which is (1). For ,
so, using this for and the product rule,
Since , we conclude
Now is clear, and by (1) with , . From (1) and (2),
Claim 1 follows by induction with , , and for .
Claim 2. is irrational. Suppose . By Claim 1, each is an integer. Since is largest at ,
The right side tends to (Exercise 9.15), so for large the integer lies in , a contradiction.
This simplification of Niven’s famous short proof (1947) is due to Zhou and Markov, who use a similar technique to prove is irrational for nonzero rational , and is irrational if is a nonzero rational.
∎Intuitionwhy the proof that e is irrational works
The partial sums approximate too well for to be a fraction with denominator . Multiplying by turns those partial sums into integers, while the remaining error becomes a positive number less than . A fraction , multiplied by , would also be an integer, and two integers cannot differ by something strictly between and .
Euler introduced a famous number, arising in the study of the gamma function, called Euler’s constant:
Even though and , the limit defining exists and is finite (Exercise 16.9); . The amazing fact is that no one knows whether is rational. Most mathematicians believe it is irrational, because it is “easier” for a number to be irrational: repeating expansions are very regular. The remark in Exercise 16.8 hints at another reason.
Reading alongside Abbott
Abbott uses decimal expansions in Section 1.6 for Cantor’s diagonal argument that is uncountable. Here is the idea in brief. Given any list of numbers in , build a new number whose th digit differs from the th digit of , and never use the digits or . The new number cannot equal any . Theorem 16.3 is exactly what makes the last step safe: an expansion with no ’s or ’s is the only expansion of its number, so a different digit really does mean a different number. The uncountability of the Cantor set in §13 can be proved the same way, with base- digits and .
Try it: the diagonal argument
Section titled “Try it: the diagonal argument”Check your understanding
Section titled “Check your understanding”Take the quiz (3 questions)
Which number has two different decimal expansions?
By Theorem 16.3, a second expansion happens only for an expansion ending in ’s, which can be rewritten to end in ’s.
Which number is irrational?
By Theorem 16.5, rationals are exactly the numbers with repeating expansions. Growing runs of zeros never settle into a repeating block.
What fraction is ?
If then , so .
Exercises
Section titled “Exercises”- Show and are both decimal expansions for .
- Which of these expansions arises from the long division process in 16.1?
Solution
(b) : long division never produces an infinite tail of ’s, since forever would give , pushing out of .
My attempt(saved)
Verify the claims in the first paragraph of the proof of Theorem 16.3.
Solution
Recall and, more generally, (geometric series).
Case with . The expansion is a legitimate expansion (the digits are allowed and ) with value . It differs from , so has two expansions.
Case with . Then is a legitimate digit, and the expansion has value It differs from the original in the th digit, so these are two distinct expansions.
Used in Theorem 16.3
My attempt(saved)
Suppose and are convergent series of nonnegative numbers. Show that if for all and for at least one , then .
Hint
Apply Exercise 14.5 to , a series of nonnegative terms with at least one positive term.
Solution
Since , the series has nonnegative terms, and it converges with sum (Exercise 14.5). Pick with . The partial sums of are nondecreasing and are at least once , so the sum is . Hence , i.e. .
Used in Theorem 16.3
My attempt(saved)
Write the following repeating decimals as rationals, i.e. as fractions of integers.
Solution
(a) (b) (c) (d) (e) (f)
My attempt(saved)
Find the decimal expansions of the following rational numbers.
Solution
(a) (b) (c) (d) (e) (f) . Check them with the widget above.
My attempt(saved)
Find the decimal expansions of and . Note the interesting pattern.
Solution
They are , , , , , : all cyclic shifts of the same six digits. Try them in the widget and watch the remainders.
My attempt(saved)
Is rational?
Solution
No. The expansion contains arbitrarily long blocks of ’s (from ), so as in Example 4 it cannot be repeating.
My attempt(saved)
Let be a sequence of numbers in . Each has a decimal expansion . For each , let if and if . Show is the decimal expansion of some and for all .
Remark: this shows the elements of cannot be listed as a sequence: is uncountable. Since can be listed as a sequence, there are a lot of irrational numbers in !
Hint
has no ’s or ’s, so by Theorem 16.3 it has only one expansion, and it differs from that of in the th digit.
Solution
Each is or , so converges by comparison with ; call its sum . Then and , so and is a decimal expansion of .
The expansion of contains no ’s or ’s, so it does not end in all ’s or all ’s; by Theorem 16.3 it is the only decimal expansion of . If for some , then would be another expansion of , hence identical to , so . But by construction. So for every .
My attempt(saved)
Let .
- Show is a decreasing sequence.
- Show for all .
- Observe that exists and is finite.
Hint
For (a), look at . For (b), compare with the rectangles in Example 1 of §15.
Solution
- . On we have , so the integral is at least , and . So is decreasing.
- By Example 1 of §15, , so . For the upper bound, on we have , so . Hence and .
- A decreasing sequence that is bounded below converges (Theorem 10.2), so exists, and .
My attempt(saved)
In Example 6(b) we showed is irrational. Use this to show is irrational. What can you say about and ? ?
Solution
If were rational so would be . Likewise and are irrational (their squares or cubes are ). Nothing follows about from these facts alone.