Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Adding 1 to the denominator of each fraction in a sequence of increasing fractions

  1. Oct 21, 2012 #1
    Hello friends,

    I am attempting to solve this problem for a sorting algorithm with a lot of elements in fraction form (I'm avoiding floating point operations). My question is:

    Given a sequence of increasing fractions, does adding 1 to the denominator affect the ordering of th sequence?

    Given the sequence for example:

    1/5, 3/4, 8/10 ... a/b, x/y where x/y > a/b

    If I add 1 to thye denominator:

    1/(5+1) , 3 / (4+1), 8 / (10+1) ... a /(b+1), x/(y+1)

    is the order of the sequence preserved?

    thanks!
     
  2. jcsd
  3. Oct 21, 2012 #2

    CWatters

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Re: Adding 1 to the denominator of each fraction in a sequence of increasing fraction

    You said the fractions are increasing so this might not be an issue but..

    How do you treat fractions that are equivalent eg 1/2 and 4/8. If you rank 4/8 before 1/2 then the order would change.
     
  4. Oct 21, 2012 #3

    CWatters

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Re: Adding 1 to the denominator of each fraction in a sequence of increasing fraction

    How about the sequence...

    9/19, 1/2 which is 0.474 , 0.5 so increasing as per your rule.

    becomes
    9/20, 1/3 which is 0.45 , 0.333 which is decreasing
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook