answersLogoWhite

0


Best Answer

You are basically asking how to add two fractions together:

Assuming your rational numbers are in the form of a fraction with a numerator over a denominator (could be stored as an ordered pair, or an ordered triple [for mixed numbers]).

If the numbers are mixed numbers the first step is to convert them to improper fractions.

To add rational numbers the denominators must be the same.

If they are not the same then the fractions need to be converted into equivalent fractions with the same denominator.

Then the fractions are added by adding together the numerators

Finally the result is simplified by dividing the numerator and denominator by their Highest Common Factor (HCF).

If the numerator is greater than or equal to the denominator, then the fraction is converted to a mixed number.

To convert a mixed number to an improper fraction, the new numerator is the whole number multiplied by the denominator plus the original numerator; the new denominator is the original denominator.

To find the new denominator for equivalent fractions it is best done by finding the lowest common multiple (LCM) of the denominators.

To find the LCM, there are various methods, but I would suggest* using the fact that the product of the HCF and LCM of two number is the product of those two numbers; then the LCM is the product of the numbers divided by their HCF. The HCF of two numbers is easily found by using Euclid's method:

to find the HCF of two numbers a and b:

1) find the remainder (r) of the first number (a) divided by the second (b)

2) If the remainder is 0, the HCF is the second number; otherwise

3) replace the first number (a) by the second number (b)

4) replace the second number (b) bu the remainder (r)

5) repeat from step 1.

(If a < b the first time through the algorithm will swap a and b so that a > b.)

There is no need to check for denominators being the same as the LCM will work out to be the current denominator.

To convert a fraction with one denominator to an equivalent fraction with a new denominator, the new numerator is found by multiplying the old numerator by the new denominator and divide by the current denominator (which is the same as finding out how many times the current denominator divides into the new denominator and multiplying the numerator by this).

I

To do the addition, the numerators are added together and the denominator is kept.

To simplify the fraction find the HCF of the numerator and denominator and divide each by this HCF. (No real need to check for HCF = 1 → fraction already as simple as possible but dividing by 1 will leave the numerator and denominator as they are!)

To convert an improper fraction to a mixed number, divide the numerator by the denominator to get a whole number quotient and a remainder. The remainder is the numerator over the denominator for the fraction of the mixed number with the quotient as the whole number. If the whole number is zero, then the fraction is a proper fraction; if the remainder is zero, then the fraction is a whole number.

-----------------------

* This suggestion means the LCM function becomes:

LCM(a, b) = a * b / HCF(a, b)

And only the HCF function need be worked out in a full algorithm. For two numbers Euclid's method provides an easy function. For more than 2 numbers I would use the prime factorization method.

User Avatar

Wiki User

7y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What algorithms will produce the correct result for the sum a b where a and b each represent rational numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What can be a statement for rational numbers?

Rational numbers represent a tiny part of real numbers.


Does Q represent rational numbers?

The letter Q in blackboard bold is used to represent the set of rational numbers - Q standing for quotient.


What you represent with fraction?

The quotient of two rational numbers.


How can you represent how the sets of whole numbers integersand rational numbers are related to each other?

Integers are the same as whole numbers. Integers are a proper subset of rational numbers.


How can you represent how sets of a whole numbers integers and rational numbers are related to each other?

Whole numbers and integers are the same thing. They are a proper subset of rational numbers.


A number that can represent whole numbers and fractions is called an what?

Rational number.


How can you use rational numbers to represent real world problems?

You cannot. The diagonal of a unit square cannot be represented by a rational number. However, because rational numbers are infinitely dense, you can get as close to an irrational number as you like even if you cannot get to it. If this approximation is adequate than you are able to represent the real world using rational numbers.


What is the definition of fraction?

a fraction is the representation of a number as the quotient of two integers. all rational numbers can be written as a fraction, and all fractions represent rational numbers.


How can you represent how to sets of whole numbers integers and rational numbers are related to each other?

Concentric circles. The set of whole numbers is a subset of the set of integers and both of them are subsets of the set of rational numbers.


How can you represent how to set of whole numbers integers and rational numbers are related to each other?

Concentric circles. The set of whole numbers is a subset of the set of integers and both of them are subsets of the set of rational numbers.


How can you represent how the sets of whole numbersintegersand rational numbers are related to each other?

Whole numbers are integers.The ratio of two integers, p and q where q is not zero, is a rational number.


What can you say about the values of the ratios in the ratio table?

They represent rational numbers.