18.04.2013 Views

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Median and Selection<br />

Next: Generating Permutations Up: Combinatorial Problems Previous: Searching<br />

Median and Selection<br />

Input description: A set of n numbers or keys, and an integer k.<br />

Problem description: Find the key that is smaller than exactly k of the n keys.<br />

Discussion: Median finding is an essential problem in statistics, where it provides a more robust notion<br />

of average than the mean. <strong>The</strong> mean wealth of people who have published research papers on sorting<br />

is significantly affected by the presence of one William Gates [GP79], although his effect on the median<br />

wealth is merely to cancel out one starving graduate student.<br />

Median finding is a special case of the more general selection problem, which asks for the ith element in<br />

sorted order. Selection arises in several applications:<br />

● Filtering outlying elements - In dealing with noisy data samples, it is usually a good idea to throw<br />

out the largest and smallest 10% or so of them. Selection can be used to identify the items<br />

defining the tenth and ninetieth percentiles, and the outliers are then filtered out by comparing<br />

each item to the two selected elements.<br />

● Identifying the most promising candidates - In a computer chess program, we might quickly<br />

evaluate all possible next moves, and then decide to study the top 25% more carefully. Selection<br />

file:///E|/BOOK/BOOK4/NODE150.HTM (1 of 3) [19/1/2003 1:30:40]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!