Results 1 to 4 of 4

Math Help - Formula for 6th largest value in a set of 10

  1. #1
    Newbie
    Joined
    May 2010
    Posts
    2

    Formula for 6th largest value in a set of 10

    Hello,

    I have a math problem that I am trying to solve within the limitations of a piece of software that I use at work.

    I have ten places where I take measurements on a item. I need to find the 6th largest value of the ten. Normally I would sort the values descending and select the 6th one. But the software does not have a sort function.

    It has the ability to use IF/THEN logic and a lot of basic math functions and several trig functions.

    I would like some help in figuring out this 6th largest value mathematically.

    Thanks
    jollywg
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member Bacterius's Avatar
    Joined
    Nov 2009
    From
    Wellington
    Posts
    927
    Quote Originally Posted by jollywg View Post
    Hello,

    I have a math problem that I am trying to solve within the limitations of a piece of software that I use at work.

    I have ten places where I take measurements on a item. I need to find the 6th largest value of the ten. Normally I would sort the values descending and select the 6th one. But the software does not have a sort function.

    It has the ability to use IF/THEN logic and a lot of basic math functions and several trig functions.

    I would like some help in figuring out this 6th largest value mathematically.

    Thanks
    jollywg
    Hello, you know you got a brain, too ? (Don't get me wrong, but a 10-value set is easily inspected, not like a 20-million set) Anyway, there is no "mathematical" formula that takes a set as an input and outputs the greatest value of the set. You can only use an algorithm that is formally defined by a series of well-defined steps.

    Here is the na´ve algorithm :

    (1) Take the first two values : put the greatest in memory.
    (2) Take the next value and the value in memory. If the next value is greater than the one in memory, replace the memory value with the next value, otherwise proceed.
    (3) Repeat (2) until you reach the last value.
    (4) The last value is the greatest integer in the set.

    Takes a lot of time for big sets. The other algorithms run a lot faster and are not that complicated (take values by pairs, halving the number of values each step, take them by triplets, dividing the number of values by 3 at each step). Variations of this algorithm return the 2nd, 3rd, 4th greatest value in the same time.
    _________________

    If your piece of software does not support sequential execution of code, then it is not possible to write a single formula that gives the greatest value of a set. Why don't you download GCC and write a quick 5-line program using the algorithm described here (or the improved one) ? It's free, and can solve absolutely any problem because it is Turing-complete (unlike your maths software)
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    May 2010
    Posts
    2
    Thanks for the information.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Super Member Bacterius's Avatar
    Joined
    Nov 2009
    From
    Wellington
    Posts
    927
    You might also want to take a lot at this, it is quite interesting

    Selection algorithm - Wikipedia, the free encyclopedia
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Largest Value of m?
    Posted in the Calculus Forum
    Replies: 4
    Last Post: May 31st 2009, 10:51 PM
  2. largest value
    Posted in the Algebra Forum
    Replies: 1
    Last Post: December 31st 2008, 04:56 AM
  3. Largest Possible y Value
    Posted in the Algebra Forum
    Replies: 4
    Last Post: December 21st 2008, 07:09 PM
  4. Largest sum
    Posted in the Math Topics Forum
    Replies: 1
    Last Post: September 3rd 2008, 09:17 PM
  5. Largest possible value?
    Posted in the Algebra Forum
    Replies: 1
    Last Post: July 30th 2008, 05:26 AM

Search Tags


/mathhelpforum @mathhelpforum