How can you find natural numbers #a, b, c, d# in the range #20#-#100# to match a given decimal approximation in the form #a/b * c/d# ? For example: #0.71428571 ~~ 24/32 * 64/56#. Is there a general method to match #8# decimal places, e.g. #0.23687546# ?

1 Answer
Feb 24, 2018

Here's one way you can try...

Explanation:

Note that in the example you give #24/32 = 3/4# and #64/56 = 8/7#, resulting in #3/4*8/7 = 6/7#

So given a decimal to #8# decimal places, the first step may be to try to find a fraction that rounds to that representation.

We can do that by using continued fractions: Find a more-or-less terminating continued fraction for the given decimal, then resolve it to a fraction.

We can find the coefficients of the continued fraction using the steps:

  • Write down the whole number part of the given number and subtract it.

  • If the remainder is #0# (or near enough) then stop.

  • Otherwise take the reciprocal and repeat.

Attempting to do this with #0.23687546# we find:

  • #color(red)(0).23687546 rarr 4.22162769#

  • #color(red)(4).22162769 rarr 4.51207157#

  • #color(red)(4).51207157 rarr 1.95285202#

  • #color(red)(1).95285202 rarr 1.04948090#

  • #color(red)(1).04948090 rarr 20.20981833#

  • #color(red)(20).20981833 rarr 4.76602783#

  • #color(red)(4).76602783 rarr 1.30543560#

  • #color(red)(1).30543560 rarr 3.27401259#

  • #color(red)(3).27401259 rarr 3.64946735#

  • #color(red)(3).64946735 rarr 1.53972328#

Hmmm: By this stage we are running into rounding errors and have not encountered a very clear stopping point.

Let us just work with what we have got here:

#0.23687546 ~~ [0;4,4,1,1,20,4,1,3,3]#

#color(white)(0.23687546) = 0+1/(4+1/(4+1/(1+1/(1+1/(20+1/(4+1/(1+1/(3+1/3))))))))#

#color(white)(0.23687546) = 11587/48916#

Note that #48916 > 100^2#, so this fraction is no good for our objective.

To simplify, we can use fewer terms.

#0.23687546 ~~ 0+1/(4+1/(4+1/(1+1/(1+1/(20+1/(4+1/1)))))) = 934/3943#

This fraction does not match all #8# decimal places and still does not help much, since #934 = 2 * 467# and #3943# is prime.

So it seems that we cannot achieve the desired objective with an arbitrary #8# place decimal representation.

About the best we can do with #0.23687546# seems to be:

#0.23687546 ~~ 0+1/(4+1/(4+1/(1+1/(1+1/20)))) = 185/781 = (5 * 37)/(11 * 71) = 20/44 * 37/71#

#~~ 0.23687580#