assign1 - CS648 Randomized Algorithms Semester II 2007-08...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS648 Randomized Algorithms Semester II, 2007-08 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 Rand-Select( 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 Rand-Select ( k, S <p ) Else Rand-Select ( 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.

Page1 / 2

assign1 - CS648 Randomized Algorithms Semester II 2007-08...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online