As you may remember from school, rational numbers have a terminating or eventually repeating (periodic) decimal expansion, whereas irrational numbers don’t. So, for example, 0.123123123123…, with 123 repeating forever, is rational (in fact, it is equal to 41/333), whereas something like 0.123456789101112131415…, which will never repeat, is irrational.
But do you know why this is true? (Despite what your teachers may have told you, the most important question in mathematics is not how, it is why!) Today I will show why every rational number has a terminating or eventually repeating decimal expansion, and in a future post I will show why every repeating or terminating decimal expansion represents a rational number. From these two pieces of information, of course, we can also deduce that every decimal expansion which doesn’t terminate or repeat must represent an irrational number, and vice versa.
First, what is a decimal expansion? By convention, we use place notation to give each digit a value based on a negative power of ten. In particular,
(Here’s an explanation of sigma notation if you don’t know what the means.) For example, recalling that ,
Now, how can we convert a rational number, represented as a fraction , into a decimal representation? The answer, of course, is to use long division to divide p by q, extending p with zeros after the decimal point as necessary.
Consider performing the division . At each step in the division, we are left with a remainder. This remainder, of course, will always be a value between 0 and (q-1), inclusive (if the remainder were larger, it would mean that the quotient we wrote on top was too small). If the remainder is ever zero, then we are done: the decimal representation terminates. If we never get zero as a remainder, the fact that there are only a finite number of possible remainders means that at some point, we must get a remainder that we already got before. But this means that the quotient will now repeat: since we are only bringing down zeros from the dividend, the remainder exactly determines the next digit in the quotient, which determines the next remainder, and so on.
As an example, consider finding the decimal expansion of the rational number 3/7:
It should be clear from the example that after reaching a remainder of 3 for the second time that the quotient will start repeating: 3/7 = 0.428571428571428571…
Therefore, the decimal representation of any rational number will either terminate, or eventually become periodic. (As a bonus challenge, can you figure out how to tell the difference between rational numbers whose decimal expansion terminates, and those whose expansion repeats?) Note that we also know something else: since there are only (q-1) possible non-zero remainders when dividing by q, the repeating portion of the decimal expansion of a rational number with a denominator of q can be at most (q-1) digits long. It could be shorter, but it can’t be any longer. You can also look at this in reverse; for example, if you see a periodic decimal whose repeating portion is ten digits long, you know that the rational number it represents must have a denominator of at least 11.
One more thing to note is that a “terminating” decimal can also be thought of as being followed by an infinite sequence of zeros. So in this sense, even “terminating” decimals are actually periodic.
Next time, I’ll show why the converse is also true: any terminating or repeating decimal represents a rational number. Maybe you can try to figure this out for yourself in the meantime!