lec22-handout.pdf

# lec22-handout.pdf - Announcements CMPSCI 311 Introduction...

• 4

This preview shows 1 out of 3 pages.

CMPSCI 311: Introduction to Algorithms Lecture 22: Randomized and Approximation Algorithms Akshay Krishnamurthy University of Massachusetts Last Compiled: May 2, 2018 Announcements HW6 due tomorrow! Extra Credit tomorrow as well Final on Friday 3:30-5:30 (Marcus Hall 131) We are trying our best on grades. . . Please fill out SRTI course evaluations and UCA evaluations. Remarks on the final One problem you have already seen before Either homework or previous exam Covers everything fairly equally Big-Oh, Graphs, Greedy, Divide and Conquer, Dynamic Programming, Network Flows, NP-Completeness, Randomized Algs. Today Randomized Median Finding Approximate Load Balancing Randomized Algorithm Algorithms that make random choices. Can flip coins, roll dice, etc. Two types of randomized algorithms: Fail with some small probability. Always succeed but running time is random. How powerful are randomized algorithms? Median Find Problem. Given a set of numbers S = { a 1 , . . . , a n } the median is the number in the middle if the numbers were sorted. If n is odd then k th smallest element where k = ( n + 1) / 2 . If n is even then k th smallest element where k = n/ 2 . Deterministic algorithm? Sort numbers, take k th smallest. O ( n log n ) .

Subscribe to view the full document.

More generally Problem. Given a set of numbers S = { a 1 , . . . , a n } and number k , return k th smallest number. (Assume no duplicates) Special cases: k = 1 : minimum element O ( n ) k = n : maximum element O ( n ) .
You've reached the end of this preview.
• Fall '09
• Analysis of algorithms, TI

{[ snackBarMessage ]}

### What students are saying

• 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.

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

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern