04.09.2013 Views

Algorithm Design

Algorithm Design

Algorithm Design

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

772<br />

Chapter 13 Randomized <strong>Algorithm</strong>s<br />

Pr [£ rn 5:1 _ Pr [£],<br />

Pr<br />

and hence Pr [E N 9:] = Pr (El. Pr [5:], from which the other equality holds as<br />

well.<br />

It turns out to be a little cleaner to adopt this equivalent formulation as<br />

our working definition of independence. Formally, we’ll say that events £ and<br />

5: are independent if Pr[g r3 9:] = Pr [£]. Pr [9:].<br />

This product formulation leads to the following natural generalization. We<br />

say that a collection of events gx, E2 ..... £n is independent if, for every set of<br />

indices I _ {1, 2 ..... n}, we have<br />

It’s important to notice the following: To check if a large set of events<br />

is independent, it’s not enough to check whether every pair of them is<br />

independent. For example, suppose we flip three independent fair coins:, If £i.<br />

denotes the event that the i th coin comes up heads, then the events gx, gz, E3<br />

are independent and each has probability 1/2. Now let A denote the event that<br />

coins 1 and 2 have the same value; let B denote the event that coins 2 and 3 have<br />

the same value; and let C denote the event that coins 1 and 3 have different<br />

values. It’s easy to check that each of these events has probability 1/2, and the<br />

intersection of any two has probability 1/4. Thus every pair drawn from A, B, C<br />

is independent. But the set of all three events A, B, C is not independent, since<br />

Pr [A~BOC]=O.<br />

i~I<br />

The Union Bound<br />

Suopose we are given a set of events El, ~2 .....<br />

En, and we are interested<br />

in the probability that any of them happens; that is, we are interested in the<br />

probaNlity Pr [t-J~___lEi]. If the events are all pairwise disjoint from one another,<br />

then the probability mass of their union is comprised simply of the separate<br />

contributions from each event. In other words, we have the following fact.<br />

pai~.<br />

ti=l ._I i=1<br />

In general, a set of events E~, ~2 ..... ~n may overlap in complex ways. In<br />

this case, the equality in 03.49) no longer holds; due to the overlaps among<br />

E1<br />

E2 E 3<br />

13.12 Background: Some Basic Probability Definitions<br />

Figure 13.5 The Union Bound: The probability of a union is maximized when the events<br />

have no overlap.<br />

events, the probability mass of a point that is counted once on the left-hand<br />

side will be counted one or more times on the right-hand side. (See Figure 13.5.)<br />

This means that for a general set of events, the equality in (13.49) is relaxed to<br />

an inequality; and this is the content of the Union Bound. We have stated the<br />

Union Bound as (13.2), but we state it here again for comparison with (13.49).<br />

(13.50} (The Union Bound) Given events E~, ~2 ..... E n, we have<br />

Pr i < Pr<br />

i=1 i=!<br />

..... .......... .... ~ : ....... :~ ~<br />

Given its innocuous appearance, the Union Bound is a surprisingly powerful<br />

tool in the analysis of randomized algorithms. It draws its power mainly<br />

from the following ubiquitous style of analyzing randomized algorithms. Given<br />

a randomized algorithm designed to produce a correct result with high probability,<br />

we first tabulate a set of "bad events" ~1, ~2 ..... ~n with the following<br />

property: if none of these bad events occurs, then the algorithm will indeed<br />

produce the correct answer. In other words, if 5 ~ denotes the event that the<br />

algorithm fails, then we have<br />

Pr[Sq

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!