HiveBrain v1.2.0
Get Started
← Back to all entries
patternModerate

Are there any algorithms or data structures that need to find the median value of a set?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
theneedareanyvaluealgorithmsmedianthatfindthere

Problem

I have been reading this book for my class, Randomized Algorithms. In this particular book, there is a whole section dedicated to finding the median of an array using random selection, that leads to a more efficient algorithm. Now, I wanted to know if there are any practical applications of this algorithm, in the domain of computer science, besides a theoretical improvement. Are there any algorithms or data structures that need to find the median of an array?

Solution

if there are any practical applications of this algorithm in the domain of computer science besides being a theoretical improvement

The application of this algorithm is trivial - you use it whenever you want to compute a median of a set of data (array in other words). This data may come from different domains: astronomical observations, social science, biological data, etc.

However, it is worth mentioning when to prefer median to mean (or mode). Basically, in descriptive statistics, when our data is perfectly normal distributed then mean, mode, and median are equal, i.e. they coincide. On the other hand, when our data is skewed, i.e. the frequency distribution for our data is (left/right) skewed, the mean fails to provide the best central location because the skewness is dragging it away from the typical value to left or right, while the median is not as strongly influenced by the skewed data, and thus best retains this position pointing to a typical value. Thus computing a median might be preferable when you deal with skewed data.

Also, machine learning is where statistical methods are heavily used, for example $k$-medians clustering.

Context

StackExchange Computer Science Q#81942, answer score: 17

Revisions (0)

No revisions yet.