

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Discrete Structures, Randomized Algorithm, Exercises, Exam Paper
Typology: Exercises
1 / 2
This page cannot be seen from the preview
Don't miss anything!


(a) Suppose n = 2 (so p 2 = 1 − p 1 ). Give a scheme that uses O(1) bits in expectation to choose one of the two items. Hint: start with an easy scheme that uses a possibly infinite number of random bits to choose the item. Then make it lazy, generating/examining only enough bits to uniquely identify the item that would be selected by the infinite sequence. What is the probability looking at a new bit lets you stop? Analyze the expected number of bits you will actually examine. (b) Generalize this scheme to sample from n elements using O(log n) random bits in expectation per sample, regardless of the values of the pi. (c) Prove that for certain pi and n (for example, a uniform sample from { 1 , 2 , 3 }), if you only have unbiased random bits, it is impossible to generate an appropriately distributed sample using a finite number of bits in the worst case.
(a) Suppose S has n elements. Prove that the expected size of the set in the recursive call is bn for some constant b < 1. (b) Pick an appropriate c, and argue by induction that the expected runtime of Find on an n-element set is at most cn. (c) Explain why your induction in the previous step depended on the fact that you were proving a linear running time. (d) Optional: Can you determine the probability that the ith item is compared to the jth, and use that for an analysis similar to our quicksort analysis? This will be messier, since it depends on i, j, and k.
(a) Argue that with probability Ω(1/n^2 ), those pieces will be the two sides of a mini- mum cut. Hint: relate this algorithm to the contraction algorithm. (b) Conclude that there is a simple implementation of the basic contraction algorithm taking O(m log n) time. (c) (optional) Refine your implementation to take O(m) time.
(a) Show that there are graphs (not multi-graphs) in which the probability that this algorithm finds an s-t min-cut is exponentially small. (b) How large can the number of s-t min-cuts in an instance be?