Find Median Value in Data: Algorithm & Question

  • Context:
  • Thread starter Thread starter FallArk
  • Start date Start date
  • Tags Tags
    Median
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
6 replies · 2K views
FallArk
Messages
127
Reaction score
0
Recently, I encountered a problem asking that
If you have a program that can identify the most- and/or least-frequent value in the data. Describe an algorithm that could make use of existing knowledge to identify the median value in the data.
I am very confused, since the mode and "anti-mode" (least frequent value) can be more than just one number, is it still possible to find the median of a list of integers?
I was thinking that median is the number which half of the list is bigger than it and the other half is smaller than it, so if I take the mode and add it with the average of all the "anti-modes" then take the average again, this would give a rough estimate of the median. Is this way of thinking correct?
 
Physics news on Phys.org
FallArk said:
Recently, I encountered a problem asking that
If you have a program that can identify the most- and/or least-frequent value in the data. Describe an algorithm that could make use of existing knowledge to identify the median value in the data.
I am very confused, since the mode and "anti-mode" (least frequent value) can be more than just one number, is it still possible to find the median of a list of integers?
I was thinking that median is the number which half of the list is bigger than it and the other half is smaller than it, so if I take the mode and add it with the average of all the "anti-modes" then take the average again, this would give a rough estimate of the median. Is this way of thinking correct?

Hey FallArk! ;)

Ultimately the mode can be anywhere, so it's not reliable to use.
And "anti-modes" can be scattered throughout the distribution. :eek:

Instead, I think we should look at the various algorithms to find a median, and see if we can improve their performance by supplying the mode. We could for instance use the mode as an initial estimate of the median.
Do you perchance already have such a list? (Wondering)
 
I like Serena said:
Hey FallArk! ;)

Ultimately the mode can be anywhere, so it's not reliable to use.
And "anti-modes" can be scattered throughout the distribution. :eek:

Instead, I think we should look at the various algorithms to find a median, and see if we can improve their performance by supplying the mode. We could for instance use the mode as an initial estimate of the median.
Do you perchance already have such a list? (Wondering)

I'm sorry but I don't quite follow.
 
FallArk said:
I'm sorry but I don't quite follow.

What is it that you're not following exactly?

Anyway, to find a median, the straight forward way is to sort all values and return the one in the middle.
That way we're not making use of the mode, or of an "anti-mode".
It's just that sorting is computation intensive, so I'm assuming you're supposed to come up with an algorithm that performs better.
Is that the case?
 
I like Serena said:
What is it that you're not following exactly?

Anyway, to find a median, the straight forward way is to sort all values and return the one in the middle.
That way we're not making use of the mode, or of an "anti-mode".
It's just that sorting is computation intensive, so I'm assuming you're supposed to come up with an algorithm that performs better.
Is that the case?

i understand how to find the median by sorting the data, what i don't get is that it seems the instructor wants me to find the median using modes
 
FallArk said:
i understand how to find the median by sorting the data, what i don't get is that it seems the instructor wants me to find the median using modes

I can't think of any use of the mode to find the median either.
 
FallArk said:
i understand how to find the median by sorting the data, what i don't get is that it seems the instructor wants me to find the median using modes
It looks to me like you want to remove the mode and anti-mode, then find the new mode and anti-mode of the remaining values.