Randomized Algorithms CS648 Lecture 22 โข Chebyshev Inequality โข Method of Bounded Difference 1 Chernoff Bound Theorem : Suppose ๐ฟ๐ , ๐ฟ๐ , โฆ , ๐ฟ๐ be ๐ independent Bernoulli random variables with parameters ๐๐ , ๐๐ , โฆ , ๐๐ , that is, ๐ฟ๐ takes value 1 with probability ๐๐ and 0 with probability ๐ โ ๐๐ . Let ๐ฟ = ๐ ๐ฟ๐ and ๐ = ๐ฌ[๐ฟ] = ๐ ๐๐ . For any ๐น > ๐, ๐ ๐๐น ๐ ๐ฟโฅ ๐+๐น ๐ โค (๐ + ๐น) ๐+๐น ๐ ๐ฟ โฅ ๐ โ ๐น ๐ โค ๐โ๐๐น ๐ /๐ Limitations: โข Works only for bounding sum of random variables. โข Requires independence among ๐ฟ๐ , ๐ฟ๐ , โฆ , ๐ฟ๐ . THREE EXAMPLES TO ILLUSTRATE THE INAPPLICABILITY OF CHERNOFF BOUND 3 Red-blue balls out of bin Randomized Experiment: There are ๐ red and ๐ blue balls in a bag. We take out ๐ balls from the bag uniformly randomly and without replacement. ๐: no. of red balls in the sample. ๐ if ๐th ball in the sample is red ๐๐ = ๐ otherwise ๐ = ๐ ๐๐ ๐ ๐ = = = ๐ ๐(๐๐ = ๐) ๐ ๐ ๐ ๏จ ๐ ๐ = ๐ ๐[๐๐ ] ๐ Aim: To show ๐ฟ is concentrated around ๐. Question: Can we apply Chernoff bound ? Answer: NO because ๐๐ โs are NOT independent. 4 Balls into Bins (number of empty bins) 1 2 3 4 5 1 2 3 โฆ โฆ m-1 m โฆ n ๐ : random variable denoting the number of empty bins. ๐ if ๐th bin is empty ๐๐ = ๐ otherwise ๐ = ๐โค๐ ๐๐ = ๐โค๐(1 โ ๐1 )๐ = ๐(1 โ ๐1 )๐ = ๐/๐ for ๐ = ๐ ๏จ ๐[๐ฟ] = ๐โค๐ ๐[๐ฟ๐ ] ๐ Aim: To show that ๐ is concentrated around ๐ . Question: Can we apply Chernoff bound ? Answer: NO because ๐๐ โs are NOT independent. 5 Number of Triangles in a random graph ๐ฎ(๐, ๐) : A graph on ๐ vertices where each edge is present with probability ๐ independent of others. ๐ ๐ ๐ ๐ ๐ ๐ป : random variable denoting the number of triangles. ๐ if triangle ๐๐๐ is present in ๐ฎ ๐ป๐๐๐ = ๐ otherwise๐ ๐ 1 ๐ 3 = ๐ = for ๐ = ๏จ ๐[๐ป] = ๐,๐,๐โ๐ฝ ๐[๐ป๐๐๐ ] 3 ๐๐ 2 Aim: To show that ๐ป is concentrated around ๐๐ . ๐๐ Question: Can we apply Chernoff bound ? Answer: NO because ๐ป๐๐๐ โs are NOT independent. 6 CHEBYSHEVโS INEQUALITY 7 Chebyshevโs inequality Let ๐ฟ be a random variable defined over a probability space. Question: How to capture deviation of ๐ฟ from ๐ ๐ฟ ? Define ๐ฝ = ๐ฟ โ ๐ ๐ฟ Question: What is ๐ ๐ฝ ? Answer: ๐ ๐ Redefine ๐ฝ = ๐ฟ โ ๐ ๐ฟ Question: What is ๐ ๐ฝ ? Answer: ๐ ๐ฟ๐ โ ๐ ๐ ๐ Called variance of ๐ฟ 8 Chebyshevโs inequality Let ๐ฟ be a random variable defined over a probability space. ๐ ๐ฟโ๐ ๐ โฅ๐ = ๐ ๐ฟ โ ๐ ๐ ๐ โฅ ๐๐ Applying Markov Inequality, ๐[ ๐ฟ โ ๐ ๐ฟ ๐ ] โค ๐๐ ๐ ๐ฟ๐ โ ๐ ๐ ๐ = ๐๐ variance of ๐ฟ = ๐๐ Limitations: โข โข โข Calculating ๐ ๐ฟ๐ is sometimes difficult. Usually gives bounds that are better than Markov Inequality but inferior to the bound achieved by other methods. Simple practice problems will be given to you on the use of Chebyshev Inequality. 9 METHOD OF BOUNDED DIFFERENCE (MOBD) The most powerful method for bounding the probability of deviation of a random variable from expected value 10 The Power of MOBD โข Tightest bound for Randomized Quick Sort was derived using MOBD. ๐ธ๐ : number of comparisons during randomized quick sort on ๐ elements. ๐(๐ธ๐ โฅ ๐ + ๐ ๐ ๐ธ๐ = ๐โ๐๐ (log log ๐ + log log log ๐) โข MOBD subsumes Chernoff bound. โข Based on theory of Martingales. Note: Proof similar and almost as hard as the proof of Chernoff bound. [Not part of the course] 11 Notations ๐๐ , โฆ , ๐๐ : a sequence of ๐ random variables. ๐ = ๐(๐๐ , โฆ , ๐๐ ) be a function of ๐ random variables. Objective: to achieve a bound on the probability of deviation of ๐ from ๐[๐]. ๐(|๐ โ ๐ ๐ | > ฯต ๐[๐]|) = ? Notations: ๐ฟ๐ โถ (๐๐ , โฆ , ๐๐ ) ๐จ๐ โถ (๐๐ , โฆ , ๐๐ ) โ๐ฟ๐ = ๐จ๐ โ means โ๐๐ = ๐๐ , โฆ , ๐๐ = ๐๐โ 12 A new perspective The value of ๐ is well defined once the values taken by ๐๐ , โฆ , ๐๐ is exposed. View the process of exposing the values of ๐๐ , โฆ , ๐๐ happening gradually in ๐ steps. โข In the beginning, when none of the ๐๐ , โฆ , ๐๐ is revealed, all we can say about value of ๐ is that its expected value is ๐[๐]. โข In first step, ๐๐ is exposed. If ๐๐ takes value ๐๐ , all we can say about value of ๐ is that its expected value is ๐[๐|๐ฟ๐ = ๐จ๐ ]. โข In second step, ๐๐ is also exposed. If ๐๐ takes value ๐๐ , all we can say about value of ๐ is that its expected value is ๐[๐|๐ฟ๐ = ๐จ๐ ]. โฆ The next slide will give a visual description of the process mentioned above. But ponder over this slide before pressing the next button. 13 The value of ๐ and the gradual exposition of ๐๐ โs ๐๐ = ๐๐ ๐[๐|๐ฟ๐ = ๐จ๐ ] ๐[๐] ๐[๐|๐ฟ๐ = ๐จ๐ ] โฆ ๐๐ = ๐๐ โฆ โฆ โฆ ๐๐ = ๐๐ โฆ ๐๐ = ๐๐ ๐[๐|๐ฟ๐โ๐ = ๐จ๐โ๐ ] ๐[๐|๐ฟ๐ = ๐จ๐ ] ๐(๐จ๐ ) Examples to illustrate the meaning of ๐[๐|๐ฟ๐ = ๐จ๐ ] Algorithm : Quick sort ๐: no. of comparisons during quick sort on ๐ elements. ๐[๐|๐ฟ๐ = ๐จ๐ ] : Given first ๐ pivot elements, the expected number of comparisons during quick sort on ๐ elements. 14 The value of ๐ and the gradual exposition of ๐๐ โs ๐๐ = ๐๐ ๐[๐|๐ฟ๐ = ๐จ๐ ] ๐[๐] ๐[๐|๐ฟ๐ = ๐จ๐ ] โฆ ๐๐ = ๐๐ โฆ โฆ โฆ ๐๐ = ๐๐ โฆ ๐๐ = ๐๐ ๐[๐|๐ฟ๐โ๐ = ๐จ๐โ๐ ] ๐[๐|๐ฟ๐ = ๐จ๐ ] ๐(๐จ๐ ) Examples to illustrate the meaning of ๐[๐|๐ฟ๐ = ๐จ๐ ] Stochastic Process : Ball-Bin problem ๐: no. of empty bins ๐[๐|๐ฟ๐ = ๐จ๐ ]: Given the destination of first ๐ balls, the expected number of empty bins. 15 Gradual exposition of ๐๐ โs ๐๐ = ๐๐ ๐[๐|๐ฟ๐ = ๐จ๐ ] ๐[๐] ๐[๐|๐ฟ๐ = ๐จ๐ ] โฆ ๐๐ = ๐๐ โฆ โฆ โฆ ๐๐ = ๐๐ โฆ ๐๐ = ๐๐ ๐[๐|๐ฟ๐โ๐ = ๐จ๐โ๐ ] ๐[๐|๐ฟ๐ = ๐จ๐ ] ๐(๐จ๐ ) Examples to illustrate the meaning of ๐[๐|๐ฟ๐ = ๐จ๐ ] Random Structure : Random graph ๐: no. of triangles in ๐ฎ(๐, ๐) ๐[๐|๐ฟ๐ = ๐จ๐ ]: Given the presence/absence of ๐๐ , โฆ , ๐๐ edges, the expected number of triangles in the random graph. 16 THE INTUITION UNDERLYING MOBD 17 Method of Bounded Difference ๐[๐|๐ฟ๐ = ๐จ๐ , ๐๐+๐ = ๐ท] ๐๐ = ๐๐ โฆ โฆ โฆ ๐๐ = ๐๐ โฆ ๐๐+๐ = ๐ถ โฆ ๐[๐|๐ฟ๐ = ๐จ๐ ] ๐[๐] ๐[๐|๐ฟ๐ = ๐จ๐ , ๐๐+๐ = ๐ถ] ๐(๐จ๐ ) 18 Method of Bounded Difference ๐[๐|๐ฟ๐ = ๐จ๐ , ๐๐+๐ = ๐ท] ๐๐ = ๐๐ โฆ โฆ โฆ ๐๐ = ๐๐ โฆ ๐๐+๐ = ๐ถ โฆ ๐[๐|๐ฟ๐ = ๐จ๐ ] ๐[๐] ๐[๐|๐ฟ๐ = ๐จ๐ , ๐๐+๐ = ๐ถ] ๐(๐จ๐ ) For any ๐จ๐ , and any ๐ถ, ๐ท โ ๐๐+๐, if if |๐[๐|๐ฟ๐ = ๐จ๐ , ๐๐+๐ = ๐ท] โ ๐[๐|๐ฟ๐ = ๐จ๐ , ๐๐+๐ = ๐ถ]| is small, then Most probably ๐(๐จ๐ ) will be close to ๐[๐]. Think for a while over the above statement before proceeding further. 19 Method of Bounded Difference - I ๐[๐|๐ฟ๐ = ๐จ๐ , ๐๐+๐ = ๐ท] ๐๐ = ๐๐ โฆ โฆ โฆ ๐๐ = ๐๐ โฆ ๐๐+๐ = ๐ถ โฆ ๐[๐|๐ฟ๐ = ๐จ๐ ] ๐[๐] Theorem 1: ๐[๐|๐ฟ๐ = ๐จ๐ , ๐๐+๐ = ๐ถ] ๐(๐จ๐ ) If there are positive numbers ๐๐ โs such that for any ๐จ๐ , and any ๐ถ, ๐ท โ ๐๐+๐ , |๐[๐|๐ฟ๐ = ๐จ๐ , ๐๐+๐ = ๐ท] โ ๐[๐|๐ฟ๐ = ๐จ๐ , ๐๐+๐ = ๐ถ]| < ๐๐ Then ๐๐๐ ๐(|๐ โ ๐ ๐ | โฅ t) โค ๐๐ฑ๐ฉ โ ๐ ๐ ๐๐ Note: In order to get a meaningful bound using Therem1, you must have small ๐๐ โs . 20 Method of Bounded Difference - II Definition: function ๐(๐๐ , โฆ , ๐๐ ) is said to satisfy Lipschitz condition with parameters ๐๐ โs if ๐ ๐จ โ ๐ ๐จโฒ โค ๐๐ For all ๐จ, ๐จโฒ that differ only at ๐th coordinate. Theorem 2: If ๐ satisfies Lipschitz condition and ๐๐ , โฆ , ๐๐ are independent, then ๐๐๐ ๐(|๐ โ ๐ ๐ | โฅ t) โค ๐๐ฑ๐ฉ โ ๐ ๐ ๐ ๐ Remark: This form is easiest to use but requires independence. 21 MOBD SUBSUMES CHERNOFF BOUND 22 MOBD subsumes Chernoff Bound ๐๐ , โฆ , ๐๐ are 0-1 independent random variables. ๐ = ๐ ๐๐ ๏จ ๐ satisfies Lipschitz condition with parameters ๐๐ = ๐ Hence applying Theorem 2 ๐๐๐ ๐(|๐ โ ๐ ๐ | โฅ t) โค ๐๐ฑ๐ฉ โ ๐ ๐ ๐ ๐ ๐๐๐ = ๐๐ฑ๐ฉ โ ๐ = ๐โ๐ l๐ ๐ = ๐โ๐ for ๐ = ๐ ln ๐ for ๐ = ๐ ln ๐ 23 PROBLEM 1 NO. OF EMPTY BINS 24 Balls into Bins (number of empty bins) 1 2 3 4 5 1 2 3 โฆ โฆ n-1 n โฆ n ๐๐ : random variable denoting the number of balls in ๐th bin. ๐(๐๐ , โฆ , ๐๐ ) : number of empty bins. Observation: ๐๐ takes value in range [๐, ๐]. Question: What is ๐๐ s.t. |๐[๐|๐๐ = ๐ถ] โ ๐[๐|๐๐ = ๐ท]| < ๐๐ for any given ๐ถ, ๐ท? Answer: For ๐ถ = ๐, ๐ท = ๐, ๐ ๐ ๐๐ = โฆ๐ โ ๐ โ (๐ โ ๐) ๐ โ ๐โ๐ โ๐ ๐โ๐ ๐ This will give very inferior bound 25 Balls into Bins (number of empty bins) 1 2 3 4 5 1 2 3 โฆ โฆ n-1 n โฆ n ๐๐ : random variable denoting the destination of ๐th ball. ๐(๐๐ , โฆ , ๐๐ ) : number empty bins. our choice of random variables ๐ We of failed because ๐ Observation: for defining ๐ was bad. Can you think of other random variables such that ๐ is a function of them ? โข ๐๐ , โฆ , ๐๐ are independent. โข ๐ satisfies Lipschitz condition with parameters ๐๐ = ๐ Hence ๐(|๐ โ ๐ ๐ | โฅ t) โค ๐๐ฑ๐ฉ โ ๐๐๐ ๐ ๐ ๐๐ ๐๐๐ = ๐๐ฑ๐ฉ โ ๐ โค ๐โ๐ for ๐ > ๐ ln ๐ 26 Balls into Bins (number of empty bins) Theorem: If ๐ balls are thrown r.u.i. into ๐ bins, then the number of empty bins ๐ will be within range ± ๐ ln ๐ with probability at least ๐ โ ๐โ๐ . ๐ Lesson to be learnt from this exercise: Be careful in selecting the base random variables ๐๐ , โฆ , ๐๐ used in defining ๐. 27 PROBLEM 2 RED-BLUE BALLS OUT OF BIN 28 Red-blue balls out of bin Randomized Experiment: There are ๐ red and ๐ blue balls in a bag. We take out ๐ balls from the bag uniformly randomly and without replacement. ๐: no. of red balls in the sample. ๐ if ๐th ball in the sample is red ๐๐ = ๐ otherwise ๐ = ๐ ๐๐ ๐ = ๐ ๐ = ๐ ๐[๐๐ ] ๐ Observation: ๐๐ are not independent ๏จ Can apply Theorem 1 only. Question: What is ๐๐ s.t. |๐[๐|๐ฟ๐โ๐ = ๐จ๐โ๐ , ๐๐ = ๐ถ] โ |๐[๐|๐ฟ๐โ๐ = ๐จ๐โ๐ , ๐๐ = ๐ท]| < ๐๐ for any given ๐จ๐โ๐ , ๐ถ, ๐ท ? 29 Red-blue balls out of bin ๐จ๐โ๐ ๐ โ ๐ balls ๐th ball โฆ โฆ โฆ Let ๐จ๐โ๐ has ๐ red balls. ๐[๐|๐ฟ๐โ๐ = ๐จ๐โ๐ , ๐๐ = ๐] = ? ๐ + ๐ + ๐[๐|๐ฟ๐โ๐ = ๐จ๐โ๐ , ๐๐ = ๐] = ? ๐ + ๐โ๐โ๐ (๐ โ ๐) ๐๐ โ ๐ ๐โ๐ (๐ โ ๐) ๐๐ โ ๐ ๏จ |๐[๐|๐ฟ๐โ๐ = ๐จ๐โ๐ , ๐๐ = ๐] โ ๐[๐|๐ฟ๐โ๐ = ๐จ๐โ๐ , ๐๐ = ๐]| < ๐ ๏จ ๐๐ < ๐ Applying Theorem 1 ๐(|๐ โ ๐ ๐ | โฅ t) โค ๐๐ฑ๐ฉ โ ๐๐๐ ๐ ๐ ๐๐ ๐๐๐ < ๐๐ฑ๐ฉ โ ๐ โค ๐โ๐ for ๐ > ๐ ln ๐ 30 Red-blue balls out of bin Theorem: There are ๐ red and ๐ blue balls in a bag. Suppose we take out ๐ balls from the bag uniformly randomly and without replacement. The ๐ number of red balls in the sample is within range ± ๐ ln ๐ with ๐ โ๐ probability at least ๐ โ ๐ . 31 PROBLEM 3 NO. OF TRIANGLES IN RANDOM GRAPH Do it as exercise. This problem will also be posted in practice sheet. 32
© Copyright 2026 Paperzz