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

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

View Full Document Right Arrow Icon
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
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern