300 likes | 483 Views
Randomized Algorithms CS648. Lecture 25 Derandomization using conditional expectation A probability gem. Derandomization using conditional expectation. Problem 1 : Large cut in a graph. Problem: Let be an undirected graph on vertices and edges. Compute a cut of size at least .
E N D
Randomized AlgorithmsCS648 Lecture 25 Derandomization using conditional expectation A probability gem
Problem 1: Large cut in a graph Problem: Let be an undirected graph on vertices and edges. Compute a cut of size at least . A randomized algorithm: ∅; ∅; For each vertex Add to or randomly with probability independent of other vertices return the cut defined by . : size of cut () returned by the randomized algorithm. E[] = Question: How to deterministically compute a cut of size in () time? A simple application of conditional expectation
Problem 2: Approximate Distance Oracles Problem: Let be an undirected graph on vertices and edges. Compute a 3-approximate distance oracle of size . A randomized algorithm: ∅; Add each vertex from to randomly independently with probability . for each , compute Ball(,) for each ,compute distance to all vertices. : returned by the randomized algorithm. E[] = Question: How to deterministically compute a 3-approximate distance oracle of size O()? A non-trivial application of conditional expectation (published in ICALP 2005)
Problem 3: Min-Cut Problem: Let be an undirected graph on vertices and edges. Compute minimum cut of . Randomized algorithmMin-cut(): { Repeat times { Let ; Contract(). } return the edges of multi-graph ; } Theorem: The algorithm computes a min-cut with probability at least . Question: How to deterministically compute a min-cut in time ? No idea whether we can use conditional expectation ?
Large cut in a graph A randomized algorithm: ∅; ∅; For each vertex Add to or randomly with probability independent of other vertices returnthe cut defined by .
Notations: For a given graph , and , : set of all edges from that have as one of the endpoint. : set of all edges from that have at least one end point in . : set of all edges from with one endpoint in and another in. : set of all edges from with one endpoint and another endpoint in .
Notations: : random variable denoting the number of edges in a cut output by the algorithm. : random variable taking value 1 if and 0 otherwise : {,,…, } : {, , …, } where for . means.
Make sure you understand “Conditional expectation” before using it. So try to focus on the following slide. conditional expectation
|| + | … …
Role of conditional expectation Either or In general, Either or
The Binary tree associated with the Randomized algorithm … A cut of value
Using Conditional expectation We wish to make choices for ’s such that IDEA: Given that , choose such that …
= ||+ | … …
= || + | = ?? = ?? Question: Should we assign to or to ? Assign to if || || || + || +| || + || +|
Deterministic algorithm for Large cut Input: = () ∅; ∅; For each vertex { if ||> || Add to ; else Add to ; } returnthe cut defined by . Time Complexity: O(). Theorem: There is a deterministic O() time algorithm to compute a cut of size at least in any given undirected graph. • This was a simple example of using conditional expectation to derandomize a randomized algorithm. But it conveys the crux of this powerful method. In order to use it to derandomize any other algorithm, all you might need is creative and analytical skills. • Also remember, we can not hope to derandomized every randomized algorithm. But if it is possible to derandomizeand algorithm, conditional expectation may prove to be a useful tool.
Selecting a random number Question: How many random bits are needed to select a number randomly uniformly from [1,32] ? Answer: 5 Question: How many random bits are needed to select a number randomly uniformly from [1,34] ? Answer: < 6⨯2 • Select a random number from [1,64] • If return ; else repeat;
Selecting a random interval Question: There are rational numbers . intervals {(), (),…,()} How to select an interval randomly with probability proportional to their length? Example: , , , Answer: • Select a random number from [] • If { if , returnI; if , returnII; if , returnIII; else return IV; } else repeat;
Selecting a random interval There are rational numbers , with common denominator . intervals {(), (),…,()} Example : , . Question: How many random bits are needed for selecting an interval randomly with probability proportional to their length? Answer: Surprise: In fact we just need bits only.
1 0 0 1 0 1 0 0 1 1 0 0 1 1 0 0 0 1 ………. 0 1 0 1 1 0 1 2 3 4 5 6 7 8 9 10 … 30 31
1 0 0 1 0 1 0 0 1 1 0 0 1 1 0 0 0 1 ………. 0 1 0 1 1 0 1 2 3 4 5 6 7 8 9 10 … 30 31
1 0 0 1 1 0 Show that expected number of random bits needed to select an interval is 0 1 2 3 4 5 6 7 8 9 10 … 30 31
For any The expected number of random bits needed: Last gem of this course: There are intervals {(), (),…,()}, where ’s are rational. Show that we need expected random bits to select an interval randomly.
Last slide Question: Why did the instructor conclude the course with a probability gem ? Answer: It is the joy of pondering over a probabilistic or algorithmic puzzle that is the strongest driving force to teach this course. Perhaps the same is the driving force for you to study this course. You disagree! You will realize this fact after a few years down the line… Thanks for the attention you paid to this course