Professional Documents
Culture Documents
RANDOMIZED ALGORITHMS
In statistics, computing the order statistics of sample, which we may represent as a sequence,
has many important applications. We can precisely state the problem as follows.
Problem 11.3. [Order statistics] Given an a sequence and an integer k where 0 ≤ k < a,
and a comparison < dening a total ordering over the elements of the sequence, nd
the k th order statistics, i.e., k th smallest element, in the sequences.
We can solve this problem by sorting rst and selecting the k th element but this would
require O(n log n) work, assuming that comparisons require constant work. We wish to do
better; in particular we would like to achieve linear work and still achieve O(log2 n) span. For
the purposes of simplicity, let’s assume that sequences consist of unique elements and consider
the following simple algorithm. Based on the contraction design technique, the algorithm uses
randomization to contract the problem to a smaller instance.