I was dividing 100 by 27 and noticed that the resulting number was made up of a repeating sequence of numbers. Here is the result using a Big Number Calculator to 100 decimal places:
I’m not very mathematically-minded, but I can understand why dividing 100 by 3 produces an infinite number of 3s (33.33333333 etc). Is what’s going on with 100 divided by 27 the same?
If you divide any integer by any other integer, you will always get a decimal which either terminates, or which eventually goes into a section that repeats infinitely. And really, terminating is just a special case of repeating, where the repeating part happens to be 0.
Likewise, any time you have a decimal that eventually repeats, you can find a ratio of two integers that equals it. Any such number (that repeats as a decimal, and can be the ratio of two integers) is called a “rational number”.
Some numbers (the vast majority of them, in fact) cannot be the result of dividing one integer by another, and if you express them as a decimal, the digits never repeat. These are called “irrational numbers”, and the most well-known examples are pi and the square root of 2.
Yes, note, the expansion of a rational number eventually repeats, and conversely, but it is not necessarily the case that the entire thing repeats (for example, 1.000012345656565…)
You can start to see how this works by dividing integers by numbers of the form 99…9000…0, eg 123/999 = 0.123123…
(To the OP: ) If you know/remember how pencil-and-paper long division works, you can see why this is true. Whenever you divide one whole number by another, eventually either you will get a remainder of 0 (so, no more decimal digits), or you’ll get a remainder you’ve gotten before, at which point you’ll start endlessly looping through the same series of digits you’ve seen before.
This insight will come a lot easier if you learned to do long division in school. For any divisor n each step in the algorithm will give a remainder smaller than n. Now, there are only finitely many numbers smaller than n, so sooner or later you´ll hit upon one you’ve encountered before…!
Thanks. I just tried it out with a few numbers and can see the repeating patterns. I guess one would generally need to use a big number calculator for it to stand out. Here are some examples, with the repeated number sequences in bold:
It all has to do with remainders, just like in grade school math.
Since it’s too hard to replicate the lines and symbols, work with me.
27 goes into 100.0000000~ **three **times with a remainder of 19.
27 doesn’t go into 19, so drop a 0. 27 goes into 190 **seven **times with a remainder of 1.
27 doesn’t go into 1, so drop a zero. 27 doesn’t go into 10, either, so that’s **zero **times.
After dropping another zero. 27 goes into 100 **three **times with a remainder of 19.
But that’s right back where we started. The pattern is fixed. No new numbers can enter. Therefore we get an infinite pattern of 370370370370~.
You can see interesting patterns even on numbers with no repetition. My favorite is 1/98. Since each division has a remainder of 2, the progression starts 0.010204081632. The next step - 0.01020408163265 - seems to screw things up. But it actually doesn’t. The 1 in 128 (twice 64) that follows overlaps with the 64 and becomes 0.0102040816326530. 30? Yes, because the 2 of the following 256 is added to the 128. The numbers get more and more squished up and it’s harder to figure out but it becomes a nice exercise in powers of two and stacked addition.
Note that you can get any repeating decimal you want by taking the repeating part, as an integer, and dividing by 999…999, where there are the same number of 9’s as digits in the repeating part. For example, if you want 123456790 to repeat, just take 123456790/999999999. Of course this reduces to 10/81.
What you are seeing is the very definition of rational vs. irrational numbers. A rational number is a repeating pattern and can also be expressed as a fraction of two whole numbers, using markn+'s trick.
An irrational number (ie. Pi, e, sqrt(2) ) does not have a repeating decimal expression and also cannot be expressed as a “ratio” of two numbers.
Well, except for those ending in a repeated 9. If you try, you’ll come up with a number ending in zeroes instead. Actually, those are just different representations of the same number. I believe there might be a thread about this somewhere…
It’s also easy to see why the repeating sequence can have a maximum length of the divisor minus 1. There are D possible remainders: 0, 1… D-1. But as you say, we stop at a 0, so for the remaining set there are D-1 possibilities. The longest repetition represents some permutation of this set. 1/7 is a good example; the repeating set is 6 long: 0.(142857)(142857)(142857)…