Which fractions give terminating decimals
Dividing 13 by 16 stops at 0.8125, but dividing 9 by 28 never stops. Can you tell which will happen before doing any division at all?
Where you are 10 in Rational numbers
Why this exists
Turning a fraction into a decimal by dividing (Converting between fractions and decimals) ends in one of two ways. Either the division comes out even and the decimal stops, as \displaystyle \frac{13}{16} = 0.8125 does, or the remainders come round again and the digits repeat forever; What makes a number rational proves there is no third ending. It does not say which ending a given fraction has, and dividing to find out is slow: after twenty digits you still cannot be sure the next one is not the last.
Once the fraction is in lowest terms, the answer is decided by the denominator alone, and by one fact about it: which primes it is built from. With the denominator broken into primes (Prime factorization), you can say at a glance that \displaystyle \frac{1}{1024} stops after exactly ten digits and that \displaystyle \frac{9}{28} never stops, without one step of long division.
Definition
A decimal terminates if it stops: from some place on, every digit after the point is 0. Both 0.8125 and -2.5 terminate, and so does every integer (Terminating and repeating decimals names the other kind).
A fraction is in lowest terms when its numerator and denominator have no common factor bigger than 1 (Equivalent fractions). So \displaystyle \frac{1}{2} is in lowest terms and \displaystyle \frac{3}{6} is not, since 3 divides both 3 and 6.
Intuition
Decimal places are fractions with special denominators: tenths, hundredths, thousandths. A decimal that stops after k digits is a whole number of 10^kths (Powers of ten); for instance \displaystyle 0.8125 = \frac{8125}{10000}. So the question “does \displaystyle \frac{a}{b} terminate?” is really the question “is \displaystyle \frac{a}{b} equal to some fraction whose denominator is a power of ten?”
Powers of ten have very plain prime factorizations. Since 10 = 2 \times 5,
so 100 = 2^2 \times 5^2, 1000 = 2^3 \times 5^3, and so on: twos and fives in equal numbers, and nothing else.
A denominator made only of twos and fives can be topped up to a power of ten, by multiplying it by whichever factors it is short of. The denominator 16 = 2^4 has four twos and no fives, so it needs four fives, and 5^4 = 625:
Multiplying the top and bottom by the same number gives an equal fraction, so nothing has changed but the name.
A denominator with any other prime in it, such as 3 or 7, can never be topped up. Multiplying only adds primes to a factorization; it never takes the 7 out of 28, and no power of ten has a 7 in it. The figure shades the denominators from 2 to 41 that pass.
They thin out quickly. Ten of the forty pass, and of the numbers from 100 to 1000 only fifteen are built from twos and fives alone.
Results
Which fractions terminate. Let \displaystyle \frac{a}{b} be a fraction in lowest terms, with a and b integers and b positive. Its decimal terminates if and only if the prime factorization of b has no prime other than 2 and 5; that is, when
for some whole numbers m and n, either of which may be 0. Otherwise its decimal repeats.
How many places. When b = 2^m \times 5^n and k is the larger of m and n, the decimal has exactly k digits after the point, and the last of them is not 0. Topping up gives the decimal itself:
“If and only if” is a claim in both directions: only twos and fives means it stops, and any other prime means it does not. So 40 = 2^3 \times 5 and 250 = 2 \times 5^3 pass, and so does 1 = 2^0 \times 5^0, the denominator of a whole number. But 28 = 2^2 \times 7 fails because of its 7, and 15 = 3 \times 5 fails because of its 3, even though it also has a 5.
Why it is true
Only twos and fives: it stops. Let k be the larger of m and n. Then k - m and k - n are whole numbers, so multiplying the top and bottom by 2^{k-m} \times 5^{k-n} is allowed, and the bottom becomes 2^k \times 5^k = 10^k. A whole number N over 10^k is written by putting the decimal point k places in from the right of N (Dividing a decimal by ten, one hundred or one thousand), so the decimal stops within k places.
It uses all k of them, because N does not end in 0. If k = 0 then b = 1 and the fraction is the whole number a, with no places at all. If k = m \ge 1, then b is even, so a is odd (lowest terms), and N = a \times 5^{k-n} is odd, so it cannot end in 0. If instead k = n > m, then 5 divides b, so 5 does not divide a, and N = a \times 2^{k-m} has no factor 5, so it cannot end in 0 either.
Any other prime: it never stops. Now suppose b has a prime factor p other than 2 and 5, and suppose the decimal did stop after k places. A minus sign changes nothing, so take a positive. Then \displaystyle \frac{a}{b} = \frac{N}{10^k} for some whole number N, and multiplying both sides by b \times 10^k gives
The argument rests on one fact: every whole number bigger than 1 has only one prime factorization, whatever order the splitting is done in (Every number has exactly one prime factorization). Split the number a \times 10^k into primes in two ways. From the right side: b is p times a whole number, so splitting N and b into primes gives a factorization with p in it. From the left side: a factor tree for a beside one for 10^k gives a factorization made of the primes of a together with k twos and k fives. These must be the same factorization, so p is a 2, a 5 or a prime of a. It is not 2 or 5, by choice. It is not a prime of a either, for then p would divide both a and b, and the fraction would not be in lowest terms. So no such k exists: the decimal never stops, and since the decimal of a fraction either stops or repeats, it repeats.
In the language of long division: a remainder of 0 after k digits would mean b divides a \times 10^k, which has just been ruled out. The remainders never reach 0, so they must come round again.
Why lowest terms matters. The second argument used the fact that p is not a prime of a. Without it the test gives wrong answers: 6 = 2 \times 3 has a 3, yet \displaystyle \frac{3}{6} = \frac{1}{2} = 0.5 stops, because the 3 below is canceled by the 3 above. Reduce first, then look at the denominator.
Worked examples
Sorting four fractions without dividing
Which of \displaystyle \frac{13}{16}, \displaystyle \frac{9}{28}, \displaystyle \frac{11}{125} and \displaystyle \frac{5}{24} have terminating decimals? For those that do, how many decimal places are there?
SolutionThe test needs lowest terms, and each fraction is in lowest terms: no numerator shares a prime with its denominator (9 = 3^2 against 28 = 2^2 \times 7, for instance). So the test applies to each denominator as it stands.
- 16 = 2^4: only twos, so \displaystyle \frac{13}{16} terminates, with 4 places, the larger of 4 and 0. Indeed \displaystyle \frac{13}{16} = 0.8125.
- 28 = 2^2 \times 7: the 7 means \displaystyle \frac{9}{28} repeats. Dividing confirms it: \displaystyle \frac{9}{28} = 0.32\overline{142857}.
- 125 = 5^3: only fives, so \displaystyle \frac{11}{125} terminates, with 3 places. Topping up with 2^3 = 8 gives \displaystyle \frac{88}{1000} = 0.088.
- 24 = 2^3 \times 3: the 3 means \displaystyle \frac{5}{24} repeats; in fact \displaystyle \frac{5}{24} = 0.208\overline{3}.
The twos in 28 and 24 do not rescue them. One unwanted prime is enough.
Topping up to a power of ten
Write \displaystyle \frac{17}{40}, \displaystyle \frac{7}{250} and \displaystyle \frac{3}{1600} as decimals by turning each denominator into a power of ten.
SolutionEach is in lowest terms, since no numerator shares a prime with its denominator.
40 = 2^3 \times 5 has three twos and one five. The larger count is 3, so the target is 10^3 = 1000, and the denominator is two fives short. Multiply the top and bottom by 5^2 = 25: \displaystyle \frac{17}{40} = \frac{425}{1000} = 0.425.
250 = 2 \times 5^3 has one two and three fives, so the target is again 1000, two twos short. Multiply by 2^2 = 4: \displaystyle \frac{7}{250} = \frac{28}{1000} = 0.028. The 0 straight after the point counts as one of the three places.
1600 = 2^6 \times 5^2, so the target is 10^6 and four fives are missing. Multiply by 5^4 = 625: since 1600 \times 625 = 1000000 and 3 \times 625 = 1875, \displaystyle \frac{3}{1600} = \frac{1875}{1000000} = 0.001875, with 6 places as predicted.
Reduce first
Decide whether \displaystyle \frac{21}{60}, \displaystyle \frac{26}{65} and \displaystyle \frac{15}{42} terminate.
SolutionNone of these is in lowest terms, so each is reduced before the test.
60 = 2^2 \times 3 \times 5 has a 3, but so does 21 = 3 \times 7. Dividing the top and bottom by 3 gives \displaystyle \frac{7}{20}, and 20 = 2^2 \times 5 passes: two places, \displaystyle \frac{7}{20} = \frac{35}{100} = 0.35.
65 = 5 \times 13 and 26 = 2 \times 13. Canceling the 13 gives \displaystyle \frac{2}{5} = 0.4, one place.
42 = 2 \times 3 \times 7 and 15 = 3 \times 5. Canceling the 3 gives \displaystyle \frac{5}{14}, but 14 = 2 \times 7 still holds a 7, and 5 cannot cancel it. So \displaystyle \frac{15}{42} repeats: \displaystyle \frac{15}{42} = \frac{5}{14} = 0.3\overline{571428}.
Canceling can remove every unwanted prime, as in the first two, or only some of them, as in the third. Only the denominator in lowest terms decides.
A ruler marked in sixteenths
Tanvir’s ruler divides each inch into sixteenths, so the marks between 0 and 1 inch are \displaystyle \frac{k}{16} for each whole number k from 1 to 15. Which marks have decimals with exactly 4 places, and how do the rest behave?
SolutionEvery mark terminates: reducing \displaystyle \frac{k}{16} only divides the denominator by twos, so it stays a power of 2. The number of places, though, depends on the lowest-terms denominator.
When k is odd, nothing cancels, the denominator stays 16 = 2^4, and there are 4 places. That is eight marks, the odd values of k from 1 to 15; for instance \displaystyle \frac{7}{16} = \frac{4375}{10000} = 0.4375.
When k is twice an odd number (k = 2, 6, 10, 14), one 2 cancels, leaving eighths and 3 places; for instance \displaystyle \frac{10}{16} = \frac{5}{8} = 0.625. When k = 4 or 12, the mark is \displaystyle \frac{1}{4} or \displaystyle \frac{3}{4}, with 2 places. When k = 8, it is \displaystyle \frac{1}{2} = 0.5, with 1 place. The counts check: 8 + 4 + 2 + 1 = 15.
Splitting a bill
Yusra-May and her friends share a bill of 33 dollars equally. The number of people sharing it, counting her, could be anything from 2 to 9. For which numbers of people is each share a terminating decimal of dollars, and for which can it be paid exactly in cents?
SolutionWith n people each share is \displaystyle \frac{33}{n} dollars, and 33 = 3 \times 11. Reduce, then test.
- n = 2, 4, 5, 8 are built from twos and fives and share nothing with 33: the shares are 16.5, 8.25, 6.6 and 4.125 dollars.
- n = 3: the 3 cancels completely, \displaystyle \frac{33}{3} = 11.
- n = 6: \displaystyle \frac{33}{6} = \frac{11}{2} = 5.5, since the 3 in 6 cancels with the 3 in 33.
- n = 7: the 7 cannot cancel, so the share repeats, about 4.71 dollars.
- n = 9: \displaystyle \frac{33}{9} = \frac{11}{3}, and one 3 is left over, so the share repeats, about 3.67 dollars.
So the shares terminate for n = 2, 3, 4, 5, 6 and 8. A whole number of cents needs at most two places, and 8 = 2^3 gives three: 4.125 dollars is 412.5 cents. So the bill splits into exact cents for n = 2, 3, 4, 5, 6 only.
Boundaries
Lowest terms is part of the test. The “only twos and fives” half works for any fraction: such a denominator can always be topped up, reduced or not. The “any other prime” half needs lowest terms, as \displaystyle \frac{3}{6} = 0.5 shows. So does the count of places: 80 = 2^4 \times 5 suggests 4, but \displaystyle \frac{12}{80} = \frac{3}{20} = 0.15 has 2. From an unreduced denominator the count is only an upper limit.
Integers above and below, and not zero below. The test is about one integer divided by a nonzero integer. A minus sign plays no part: \displaystyle -\frac{7}{40} = -0.175 stops for the same reason \displaystyle \frac{7}{40} does.
The twos and fives come from ten. The rule belongs to writing numbers in tens, because 10 = 2 \times 5. In a system that counted in twelves, where 12 = 2^2 \times 3, the fraction \displaystyle \frac{1}{3} would stop and \displaystyle \frac{1}{5} would not.
It says whether, not how. The test decides whether the decimal repeats. It does not say where the repeating block starts or how long it is; for that you divide, as in Terminating and repeating decimals.
Where this goes next
Next comes the reverse trip, from a repeating decimal back to the fraction it came from: Turning a repeating decimal into a fraction. Together with this lesson it pins down the decimals of the Rational numbers: those that stop or repeat, and no others. A decimal that does neither, such as the decimal of the length of a square’s diagonal, belongs to a number that is not a fraction at all, and those are met in Irrational and real numbers.
Exercises
Stop or repeat
Decide, without dividing, whether each fraction has a terminating decimal. If it does, say how many decimal places it has and write the decimal.
- \displaystyle \frac{7}{32}
- \displaystyle \frac{11}{30}
- \displaystyle \frac{19}{80}
- \displaystyle \frac{10}{33}
- \displaystyle \frac{36}{75}
- \displaystyle \frac{27}{120}
Topping up the denominator
Write each fraction as a decimal by first rewriting it with a power of ten as its denominator.
- \displaystyle \frac{13}{20}
- \displaystyle \frac{31}{250}
- \displaystyle \frac{3}{64}
- \displaystyle -\frac{17}{200}
Counting places
- Without working out the decimal first, how many decimal places does \displaystyle \frac{1}{2^4 \times 5^7} have? Then write the decimal.
- How many decimal places does \displaystyle \frac{49}{1280} have? Write the decimal.
- The denominator of \displaystyle \frac{6}{400} is 400 = 2^4 \times 5^2, which suggests 4 places. How many does the decimal really have, and why the difference?
In context
- Ulrike-Ann’s recipe uses \displaystyle \frac{5}{8} cup of flour and \displaystyle \frac{2}{3} cup of milk. (a) Which amount can be written as a terminating decimal? (b) She triples the recipe. Which of the two new amounts terminate?
- Sabela cuts a ribbon 7 meters long into n equal pieces, where n is a whole number from 2 to 12. For which n is the length of each piece a terminating decimal of meters? Give those lengths.
- Find the smallest positive whole number n for which \displaystyle \frac{n}{42} has a terminating decimal.
- List every whole number d from 100 to 200 for which \displaystyle \frac{1}{d} has a terminating decimal.
Reasoning
- The denominator of \displaystyle \frac{3}{30} is 30 = 2 \times 3 \times 5, which has the prime factor 3. Does the decimal of \displaystyle \frac{3}{30} repeat? Explain.
- Show that for every whole number m \ge 1, the decimal of \displaystyle \frac{1}{2^m} has exactly m places and its last digit is 5.
- Explain why there are no whole numbers N and k with \displaystyle \frac{5}{21} = \frac{N}{10^k}, and what this says about the decimal of \displaystyle \frac{5}{21}.
Answers
- Terminates, 5 places: 0.21875. Here 32 = 2^5 and 7 is odd, so it is in lowest terms; multiplying by 5^5 = 3125 gives \displaystyle \frac{21875}{100000}.
- Repeats. 30 = 2 \times 3 \times 5 and 11 is a prime not dividing 30, so it is in lowest terms and the 3 stays. (It is 0.3\overline{6}.)
- Terminates, 4 places: 0.2375. 80 = 2^4 \times 5, 19 is prime, and multiplying by 5^3 = 125 gives \displaystyle \frac{2375}{10000}.
- Repeats. The numerator 10 = 2 \times 5 shares no prime with 33 = 3 \times 11, so the fraction is in lowest terms and the 3 and 11 stay. (It is 0.\overline{30}.)
- Terminates, 2 places: 0.48. Dividing by 3 gives \displaystyle \frac{36}{75} = \frac{12}{25}, and 25 = 5^2; multiplying by 4 gives \displaystyle \frac{48}{100}.
- Terminates, 3 places: 0.225. 120 = 2^3 \times 3 \times 5, and dividing by 3 gives \displaystyle \frac{27}{120} = \frac{9}{40}, with 40 = 2^3 \times 5; multiplying by 25 gives \displaystyle \frac{225}{1000}.
- 0.65. 20 = 2^2 \times 5 is one five short of 100: \displaystyle \frac{13}{20} = \frac{65}{100}.
- 0.124. 250 = 2 \times 5^3 is two twos short of 1000: \displaystyle \frac{31}{250} = \frac{124}{1000}.
- 0.046875. 64 = 2^6 needs 5^6 = 15625, and 3 \times 15625 = 46875, so \displaystyle \frac{3}{64} = \frac{46875}{1000000}.
- -0.085. 200 = 2^3 \times 5^2 is one five short of 1000: \displaystyle -\frac{17}{200} = -\frac{85}{1000}.
- 7 places, the larger of 4 and 7. Topping up with 2^3 = 8 gives \displaystyle \frac{8}{10^7} = 0.0000008.
- 8 places: 0.03828125. 1280 = 2^8 \times 5 and 49 = 7^2 shares no prime with it; multiplying by 5^7 = 78125 gives \displaystyle \frac{3828125}{10^8}.
- 3 places: 0.015. The fraction is not in lowest terms; dividing by 2 gives \displaystyle \frac{6}{400} = \frac{3}{200}, and 200 = 2^3 \times 5^2. One of the four twos was canceled by the 2 in 6.
- (a) The flour: \displaystyle \frac{5}{8} = 0.625, while \displaystyle \frac{2}{3} repeats (0.\overline{6}). (b) Both: \displaystyle 3 \times \frac{5}{8} = \frac{15}{8} = 1.875, and \displaystyle 3 \times \frac{2}{3} = 2, since the 3 cancels.
- n = 2, 4, 5, 7, 8 and 10, giving 3.5, 1.75, 1.4, 1, 0.875 and 0.7 meters. Since 7 is prime, \displaystyle \frac{7}{n} is in lowest terms unless n = 7, which gives 1; for the rest only n built from twos and fives pass. The other five, n = 3, 6, 9, 11 and 12, give repeating lengths.
- n = 21. 42 = 2 \times 3 \times 7, so both the 3 and the 7 must cancel, which needs n to be a multiple of 3 and of 7, so of 21. And \displaystyle \frac{21}{42} = \frac{1}{2} = 0.5.
- 100, 125, 128, 160 and 200. \displaystyle \frac{1}{d} is in lowest terms, so d must be a product of twos and fives. With no five the only one in range is 2^7 = 128; with one five, 5 \times 2^5 = 160; with two, 25 \times 4 = 100 and 25 \times 8 = 200; with three, 125; four fives make 625, too big.
- No. \displaystyle \frac{3}{30} is not in lowest terms: dividing by 3 gives \displaystyle \frac{1}{10} = 0.1, which terminates. The 3 below is canceled by the 3 above, and the test is only applied after reducing.
- Multiplying the top and bottom by 5^m gives \displaystyle \frac{1}{2^m} = \frac{5^m}{10^m}, so the decimal stops within m places. Every power of 5 ends in 5: 5 does, and 5 times a number ending in 5 ends in 5 again, since 5 \times 5 = 25. So 5^m does not end in 0, placing the point m digits in uses all m places, and the last digit is 5.
- If \displaystyle \frac{5}{21} = \frac{N}{10^k}, then 5 \times 10^k = 21 \times N. The right side is a multiple of 21 = 3 \times 7, so a multiple of 3. The left side’s prime factorization is one 5 together with k twos and k fives, and a number has only one factorization, so 3 is not in it. That is impossible, so no such N and k exist. So the decimal of \displaystyle \frac{5}{21} never stops, and it repeats: \displaystyle \frac{5}{21} = 0.\overline{238095}.