Irreducible fraction of a given rational

571 Views Asked by At

Given a rational $ r \in \mathbb Q $, how to find the irreducible fraction $ \frac a b = r $? Any direct formula based on the digits of $ r $, instead of successive approximations by increasing numerator and denominator alternatively?

2

There are 2 best solutions below

0
On BEST ANSWER

You have two cases.

If the number of decimals is finite, let's say $x=a.a_1 a_2 ... a_n$. Then obviously $$ x = \frac{a a_1 a_2...a_n}{10^n}$$ and then you simplify this fraction by looking for common divisors.

If the number of decimals is infinite, then it must have a period $p$, that is $$x=a. a_1 a_2 ... a_p a_1 a_2 ... a_p ...$$ You have $$10^p x-x = a a_1 ... a_p-a$$ and hence $$x = \frac{aa_1 ... a_p-a}{10^p-1}$$ which you can also simplify.

1
On

Use Euclid's Algorithm to compute $\gcd(a,b)$, then divide the numerator and denominator by it. Voila! Reduced fraction!

Here is a link: https://en.wikipedia.org/wiki/Euclidean_algorithm