2.3 Rational numbers
Definition 2.3 (Rational number).
A rational number is a real number that can be written as where and are integers, and .
Let’s explore this definition.
-
•
is a rational number: put and . (Or and , the definition does not say that and must be unique).
-
•
is a rational number; put and .:
-
•
is a rational number: put and .
-
•
Any integer is a rational number. [What are and ?]
We can write a rational number in simplest terms by cancelling any common factors in the numerator and denominator. We shall see later that this is actually a consequence of a result called the Fundamental Theorem of Arithmetic.
Later in this section, we shall prove that there are real numbers that are not rational. For now, observe that this is not obvious just from the definition; maybe such and exist for every real number.
Proposition 2.4.
The product of two rational numbers is rational.
Proof.
Suppose and are rational numbers. So and for some integers with and . Then
As are integers, then so are and . As and are positive, then so is . Thus is a rational number.
Exercise 2.5.
Prove that the sum of two rational numbers is rational.
Solution (please try for yourself before looking)
Suppose and are rational numbers. So and for some integers with and . Then
As are integers, then so are and . As and are positive, then so is . Thus is a rational number.
Since the sum and product of two rational numbers are also rational, we say the collection of rational numbers is closed under addition and multiplication. These are two properties that contribute to the rational numbers forming an object known as a field. You will explore the concept of field more in the course Introduction to Mathematical Analysis.
2.3.1 From fractions of integers to decimal notation
Consider a rational number , where and are integers with . Because is a real number, we know that it has a decimal representation
where each of and is a digit .
Example 2.6.
Let’s take a closer look at why has decimal representation .
To write in decimal notation means finding digits and such that
Expanding the sums on the right-hand side gives
Now think about what the digits and could be. Putting and all other digits equal to zero makes the equation hold because the right-hand side becomes
Therefore has decimal representation .
Note that we have not proved that is the only possible decimal representation of . In fact, we shall discover later that it is not!
In this example, it is not so difficult to spot what the digits could be. But writing something like in decimal notation would take more effort. Fortunately there is a process that can help – it is called the division algorithm.
There are many ways of writing down the division algorithm. You may have learned it as ‘short division’ (sometimes called the ‘bus stop method’) or ‘long division’.
Example 2.7.
Let’s find a decimal representation of using the division algorithm. Since is the result of dividing by , we can use short division.
And so a decimal representation of is .
There are other ways of writing down the division algorithm, so do not worry if this looks unfamiliar.
You could also type into a calculator. While that is fine when dividing specific integers, a calculator will not help us prove general statements about writing rational numbers in decimal notation.
The division algorithm gives us a process for writing any rational number in decimal notation.
Definition 2.8 (Terminating decimal).
We say a decimal representation ‘’ is terminating (or terminates) if only a finite number of the digits are nonzero.
For example,
-
•
(which remember is shorthand for ) is terminating;
-
•
is terminating;
-
•
(which is shorthand for ) is not terminating.
-
•
(which is shorthand for ) is not terminating.
Proposition 2.9.
Every rational number has a decimal representation that either:
-
(i)
terminates; or
-
(ii)
eventually repeats a block of digits indefinitely to the right. In this case we say the decimal is periodic, or eventually periodic.
Proof.
Let be a rational number. Then there exist integers and , with , so that . In addition, assume that and that has decimal representation ‘’. Using short division, we can calculate:
Each step of the division algorithm involves calculating a remainder strictly less than , and so each remainder must be one of the integers .
Once we reach the tail of s, one of two things must happen:
-
•
If the remainder at any step is then the process stops and so has a terminating decimal representation.
-
•
Each remainder is one of the integers . There are such integers, and so the th remainder in the tail of s is certainly one we have seen before in the tail. From then on, the remainders repeat and so the decimal representation repeats.
If then and so we can apply the same argument to write the positive number in decimal notation. Negating the decimal representation then gives a representation of .
This proof used the so-called pigeonhole principle. This states that if items are put into containers, with , then at least one container must contain more than one item. Can you see where this was used in the proof?
To summarise this section, we have proved that every rational number has a terminating or eventually repeating decimal representation. In the next section, we shall prove the converse: that every real number with a terminating or eventually repeating decimal representation is rational.
2.3.2 From decimal notation to fractions of integers
Suppose is a real number with terminating decimal representation. Expanding the definition of decimal notation gives us as a sum of rational terms.
Example 2.10.
If has decimal representation then
where the digits are shown in bold just to make them stand out. Evaluating this calculation gives
Proposition 2.11.
Every real number with a terminating decimal representation is a rational number.
Proof.
Let with terminating decimal representation ‘’. (Here we are not writing the tail of s that continues indefinitely to the right.)
If then and so we can apply the same argument to write the positive number as a fraction of integers, then negate it to obtain as a fraction of integers.
If a decimal representation ‘’ is not terminating then precisely one of two things must happen. Either:
-
(i)
the fractional part ‘’ eventually has a pattern (block of digits) that repeats indefinitely to the right; or
-
(ii)
it does not.
We would like to prove that eventually repeating decimals (the first case above) must represent rational numbers.
First consider the special case of real numbers with decimal representation ‘’. That is to say, the repeating pattern starts immediately to the right of the decimal point. This means we are considering decimal representations like:
-
•
; here and .
-
•
; here , and .
Proposition 2.12.
The real number with decimal representation ‘’ is rational and equals
This result looks complicated because of the notation. It may help to understand the claim by considering some examples:
-
•
is rational and ;
-
•
is rational and ;
-
•
is rational and .
Proof.
Let . Writing as a sum of terminating decimals, and then expanding the decimal notation gives
The whole right-hand side is a geometric series with first term and common ratio , which is strictly between and . Therefore the right-hand side converges to
It follows that is rational since the numerator and denominator are both integers.
Informally, in decimal notation, the numerator is ‘’ and the denominator is .
We have established that decimals of the form ‘’ represent rational numbers. We now extend this result to any decimal which eventually has a pattern that repeats indefinitely to the right.
Proposition 2.13.
Every real number with a decimal representation that eventually repeats a block of digits indefinitely to the right is rational.
Proof.
Let and suppose has an eventually repeating decimal representation ‘’.
Then can be written as ’ and so, applying Proposition 2.12 to the fractional part gives
Dividing both sides by shows that we can write as a sum of two rational numbers. Hence is rational.
If then, as usual, we can apply the same argument to and then negate the resulting rational number.
2.3.3 Some real numbers have more than one decimal representation
We have been careful in these notes not to state that every real number has a unique decimal representation. Indeed, this is not true and is worth exploring.
By Proposition 2.12, we know that represents the rational number . In other words, the real number has (at least) two decimal representations, namely
In fact, this is true of any nonzero integer: , , and so on.
Similarly, any nonzero terminating decimal representation has an equivalent repeating one. For example:
-
•
;
-
•
;
-
•
;
-
•
.
We record this as a proposition.
Proposition 2.14.
Every nonzero real number with a terminating decimal representation also has an eventually repeating one.
Proof.
Let with terminating decimal representation ‘’. We may assume [can you see why?]. Replace the digit with and add an infinitely long string of s to the right. Then this new decimal representation is
But is a geometric series with limit [check you agree], and so
If then we can apply the above argument to .
We have just established that it is possible to have two different decimal representations of the same real number. We shall now prove that this only happens under the conditions in Proposition 2.14.
Proposition 2.15.
Let ‘’ and ‘’ be different non-terminating decimal representations. Then these represent different real numbers.
Proof.
Let be represented by ‘’ and be represented by ‘’.
Since the decimal representations are different, there must be a first digit from the left where they are different.
Suppose this is the th digit after the decimal point and suppose assume (otherwise switch the roles of and ). Our strategy is to find so that and ; then we can conclude that [try plotting on the real line to convince yourself of this]. Hence .
Note, since it follows that .
Let be the real number with decimal representation below.
We have used the proof of Proposition 2.14, to represent also as an eventually repeating decimal. The digits are aligned to make it easier to compare , and .
Now:
-
•
, because is non-terminating and so does not have a tail of s; and
-
•
. Because , the greatest could be is . Therefore unless and , in which case .
Thus and so .
We now summarise this section on rational numbers in a single result.
Proposition 2.16.
A nonzero real number is rational if and only if it has an eventually repeating decimal representation.
Proof.
Let be a nonzero real number.
If is rational then, by Proposition 2.9, its decimal representation either terminates or repeats indefinitely to the right. If it terminates then, by Proposition 2.14, it has an equivalent representation with a tail of s.
If has an eventually repeating decimal representation then, by Proposition 2.13, it is rational.