This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CS648 Randomized Algorithms Semester II, 200708 Assignment 1 Due on : 30 January Note : Give complete details of the analysis of your solution. Be very rigorous in providing any mathemat ical detail in support of your arguments. Also mention the Lemma/Theorem you use. 1. (points 8,2) Randomized Select. Let S be a set of n real numbers. Consider the randomized algo rithm RandSelect( k, S ) described below that finds the k th smallest element from the set S . Select a random element p from set S . Find its rank in the set S (by comparing p with every other element of set S ). Let r be the rank of p . If r = k , we report p as the output. Otherwise we proceed recursively as follows : If r > k , then RandSelect ( k, S <p ) Else RandSelect ( k r, S >p ) where S <p and S >p are the sets consisting of all those elements that are respectively smaller and greater than the element p . Observe that the running time of the above algorithm is dominated by the number of comparisons performed. Therefore, in order to get a bound on the expected running time of the algorithm, our aim is essentially to find out the expected number of comparisons performed in...
View
Full
Document
This note was uploaded on 11/24/2009 for the course CS CS648 taught by Professor Surenderbaswana during the Spring '08 term at University of Massachusetts Boston.
 Spring '08
 SurenderBaswana
 Algorithms

Click to edit the document details