Converting fractions to repeating decimals

107 Views Asked by At

I understand how to convert a repeating decimal into a fraction. For instance, let us look at $0.555555...$.

We set $r = 0.5555...$, multiply it by ten then subtract $r$ from that to get $$9r = 5 \implies r = \frac{5}{9}.$$

How do I go the other way? That is, showing that $\frac{5}{9} = 0.5555...$?

2

There are 2 best solutions below

4
On

Here's a cool trick:

The repeated decimal $0.abcdefg...$ is equal to $\frac{abcdefg}{9999999}$.

So for example, we have that $0.5... = \frac59$ and $0.123123123...=\frac{123}{999}$ and so on.

You can prove this by noting that $\frac{abcdefg}{9999999} = \frac{abcdefg}{10000000} + \frac{abcdefg}{99999990000000}=\frac{abcdefg}{10000000} + \frac{abcdefg}{100000000000000}+\frac{abcdefg}{999999900000000000000}=\dots$ and then using induction.

0
On

Long division is of course your friend. As soon as the remainders start to repeat, and you are always bringing "down" zeros, the digits of the result will repeat.

I would, however, also want you to potentially try this (I guess instructive but impractical) method. Let your fraction be $\frac{p}{q}$. If $q$ has factors of $2$ or $5$, multiply by $10$ enough times and cancel those factors until you get no factors $2$ or $5$. Say, you want to check periodicity of $\frac{9}{14}$. As $\frac{9}{14}=\frac{1}{10}\frac{90}{14}=\frac{1}{10}\frac{45}{7}$. So if the resulting fraction $\frac{45}{7}$ is periodic, the original fraction $\frac{9}{14}$ is also periodic, albeit after a few odd digits at the start.

Next, if your fraction is improper, turn it into a mixed fraction, say $\frac{45}{7}=6\frac{3}{7}$. Obviously, if the "proper" part is periodic, the whole thing will be periodic (after the decimal point).

So all we are left with is a fraction $\frac{p}{q}$ where $p<q$ and $q$ is not divisible by $2$ or $5$, i.e. $10$ is coprime to it. Thus, Euler's theorem guarantees that $10^{\varphi(q)}\equiv 1\pmod q$, which basically means that $\underbrace{999\ldots 9}_{\varphi(q)\text{ nines}}$ is divisible by $q$. This then in turn means that you can extend the fraction $\frac{p}{q}$ to have $\underbrace{999\ldots 9}_{\varphi(q)\text{ nines}}$ in the denominator, and so you have landed with the case $\frac{p}{\underbrace{999\ldots 9}_{\varphi(q)\text{ nines}}}$ where $p<\underbrace{999\ldots 9}_{\varphi(q)\text{ nines}}$.

Thus:

The digits of $p$ (the $\varphi(q)$ of them, add leading zeros if necessary!) will be the repeating digits.

Continuing our previous example, you have $\frac{3}{7}$. As $\varphi(7)=6$, this means that $999999$ (six nines) is divisible by $7$. Indeed: $999999/7=142857$. So now you can extend the fraction $\frac{3}{7}$ by $142857$ to get $\frac{428571}{999999}$ and so the repeating digits are $428571$.

Rewinding our previous example, as $\frac{3}{7}=0.428571428571\ldots$, then $\frac{45}{7}=6.428571428571\ldots$ and $\frac{9}{14}=0.6428571428571\ldots$.

The problem with this approach might be to calculate the value of $\varphi(q)$ for a given $q$: hope this Wikipedia article can help. It may also produce quite big numbers. Finally, you won't escape long division: to divide $\underbrace{999\ldots 9}_{\varphi(q)\text{ nines}}$ by $q$ in order to see which number to extend with, you will use ... long division.