This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Chapter 9 Randomized Algorithms By Sariel Har-Peled , September 20, 2007 Version: 0.26 9.1 Some Probability Definition 9.1.1 (Informal.) A random variable is a measurable function from a probability space to (usually) real numbers. It associates a value with each possible atomic event in the probability space. Definition 9.1.2 The conditional probability of X given Y is Pr X = x | Y = y = Pr ( X = x ) ∩ ( Y = y ) Pr Y = y . An equivalent and useful restatement of this is that Pr ( X = x ) ∩ ( Y = y ) = Pr X = x | Y = y * Pr Y = y . Definition 9.1.3 Two events X and Y are independent , if Pr X = x ∩ Y = y = Pr [ X = x ] · Pr Y = y . In particular, if X and Y are independent, then Pr X = x Y = y = Pr [ X = x ] . Lemma 9.1.4 (Linearity of expectation.) For any two random variables X and Y, we have E [ X + Y ] = E [ X ] + E [ Y ] . This work is licensed under the Creative Commons Attribution-Noncommercial 3.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. 1 Proof: For the simplicity of exposition, assume that X and Y receive only integer values. We have that E [ X + Y ] = X x X y ( x + y ) Pr ( X = x ) ∩ ( Y = y ) = X x X y x * Pr ( X = x ) ∩ ( Y = y ) + X x X y y * Pr ( X = x ) ∩ ( Y = y ) = X x x * X y Pr ( X = x ) ∩ ( Y = y ) + X y y * X x Pr ( X = x ) ∩ ( Y = y ) = X x x * Pr [ X = x ] + X y y * Pr Y = y = E [ X ] + E [ Y ] . 9.2 Sorting Nuts and Bolts Problem 9.2.1 ( Sorting Nuts and Bolts ) You are given a set of n nuts and n bolts. Every nut have a matching bolt, and all the n pairs of nuts and bolts have di ff erent sizes. Unfortunately, you get the nuts and bolts separated from each other and you have to match the nuts to the bolts. Furthermore, given a nut and a bolt, all you can do is to try and match one bolt against a nut (i.e., you can not compare two nuts to each other, or two bolts to each other). When comparing a nut to a bolt, either they match, or one is smaller than other (and you known the relationship after the comparison). How to match the n nuts to the n bolts quickly? Namely, while performing a small number of comparisons....
View Full Document
- Fall '08
- Algorithms, Probability theory, Randomness