Randomized Algorithms, Exercises - Discrete Mathematics 2, Exercises of Discrete Structures and Graph Theory

Discrete Structures, Randomized Algorithm, Exercises, Exam Paper

Typology: Exercises

2010/2011

Uploaded on 10/12/2011

lovefool
lovefool 🇬🇧

4.5

(21)

292 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
6.856 Randomized Algorithms
David Karger
Handout #3, February 9, 2009 Homework 2, Due 2/16
1. MR 2.3. Consider a uniform rooted tree of height h(every leaf is at
distance hfrom the root). The root, as well as any internal node, has 3
children. Each leaf has a boolean value associated with it. Each internal
node returns the value returned by the majority of its children. The
evaluation problem consists of determining the value of the root; at each
step, an algorithm can choose one leaf whose value it wishes to read.
(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= 3hleaves.
(b) Show that there is a nondeterministic algorithm can determine the
value of the tree by reading at most nlog32leaves. 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 n0.9.
2. MR 2.6. Use Yao’s minimax principle to prove a lower bound on the ex-
pected running time of any Las Vegas algorithm for sorting nnumbers that
uses only comparisons. You might want to review deterministic sorting
lower bounds from, e.g., [CLR] chapter 9.
3. Consider a sequence of nunbiased coin flips. Consider the length of the
longest contiguous sequence of heads.
(a) Show that you are unlikely to see a sequence of length c+ log2nfor
c > 1 (give a decreasing bound as a function of c).
(b) Show that with high probability you will see a sequence of length
log2nO(log2log2n). 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.
1
pf2

Partial preview of the text

Download Randomized Algorithms, Exercises - Discrete Mathematics 2 and more Exercises Discrete Structures and Graph Theory in PDF only on Docsity!

6.856 — Randomized Algorithms

David Karger

Handout #3, February 9, 2009 — Homework 2, Due 2/

  1. MR 2.3. Consider a uniform rooted tree of height h (every leaf is at distance h from the root). The root, as well as any internal node, has 3 children. Each leaf has a boolean value associated with it. Each internal node returns the value returned by the majority of its children. The evaluation problem consists of determining the value of the root; at each step, an algorithm can choose one leaf whose value it wishes to read.

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

  1. MR 2.6. Use Yao’s minimax principle to prove a lower bound on the ex- pected running time of any Las Vegas algorithm for sorting n numbers that uses only comparisons. You might want to review deterministic sorting lower bounds from, e.g., [CLR] chapter 9.
  2. Consider a sequence of n unbiased coin flips. Consider the length of the longest contiguous sequence of heads.

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

  1. When we studied the median finding algorithm in class, I showed that the median is probably between the two chosen “boundaries.” But I merely asserted that not many items are found between these boundaries. Prove that it is unlikely (probability O(n^1 /^4 )) for the chosen boundaries to have many elements between them, for a suitable choice of “many.”
  2. (optional) MR 1.15. Prove that N P ⊆ BP P implies N P = RP.

References

[CLR] Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Introduction to Algorithms.