regression towards the datascience

Converting repeating decimals into fractions


I came across an interesting maths tip, which I couldn't resist sharing.

Turning a fraction to a decimal is a childs' play, with a simple division. The trick is on restoring the fraction back from the decimal that has a repeating numbers.

Let us take a decimal "0.4545454545..."

Pick the number that repeats, in this case it is "45", and divide it by however many 9's as there are digits in the number. As size of 45 is 2, then take 2 9's, i.e. 99.

Now simplify 45/99, that would lead to 5/11.

and following is the reason why this works...

Consider, K = 0.4545454545...

100K = 100 x 0.4545454545 = 45.45454545...

100K - K = 45.45454545... - 0.4545454545...

99K = 45

K = 45/99 => 5/11

Thats' it.