

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) Show that for any deterministic algorithm, there is an instance (a set of boolean values for the leaves) that forces it to read all n = 3h^ leaves. (b) Show that there is a nondeterministic algorithm can determine the value of the tree by reading at most nlog^3 2 leaves. In other words, prove that one can present a set of this many leaves from which the tree value can be determined. (c) Consider the recursive randomized algorithm that evaluates two sub- trees of the root chosen at random. If the values returned disagree, it proceeds to evaluate the third sub-tree. Show the expected number of leaves read by the algorithm on any instance is at most n^0.^9.
(a) Show that you are unlikely to see a sequence of length c + log 2 n for c > 1 (give a decreasing bound as a function of c). (b) Show that with high probability you will see a sequence of length log 2 n − O(log 2 log 2 n). Note: this observation can be used to detect cheating. When told to fake a random sequence of coin tosses, most humans will avoid creating runs of this length under the mistaken assumption that they don’t look random.
Use specifics of the problem, not the general deviation bounds.
[CLR] Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Introduction to Algorithms.