Docsity

CSE 525: Randomized algorithms & probabilistic analysis Lecture notes, Lecture notes of Algorithms and Programming

Toggle sidebar
bg1
CSE 525: Randomized algorithms & probabilistic analysis
Lecture notes
Spring 2019
James R. Lee
Paul G. Allen School of Computer Science & Engineering
University of Washington
Contents
1 First moments 3
1.1 The probabilistic method ................................... 3
1.2 Linearity of expectation ................................... 3
1.3 The method of conditional expectation ........................... 4
1.4 Markov’s inequality ...................................... 5
1.5 Crossing number inequalities ................................ 5
2 Second moments 7
2.1 Threshold phenomena in random graphs ......................... 7
2.2 Chebyshev’s inequality and second moments ....................... 7
2.3 Unbiased estimators ..................................... 9
2.4 Percolation on a tree ..................................... 10
2.5 Using unbiased estimators to count ............................. 11
3 Chernoff bounds 12
3.1 Randomized rounding .................................... 14
3.2 Some more applications ................................... 16
3.2.1 Balls in bins ...................................... 16
3.2.2 Randomized Quicksort ............................... 17
3.3 Negative correlation ..................................... 18
4 Martingales 20
4.1 Doob martingales ....................................... 20
4.2 The Hoeffding-Azuma inequality .............................. 21
4.3 Proof .............................................. 23
4.4 Additional applications .................................... 24
4.4.1 Concentration in product spaces .......................... 24
4.4.2 Tighter concentration of the chromatic number .................. 25
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b

Partial preview of the text

Download CSE 525: Randomized algorithms & probabilistic analysis Lecture notes and more Lecture notes Algorithms and Programming in PDF only on Docsity!

CSE 525: Randomized algorithms & probabilistic analysis

James R. Lee

Paul G. Allen School of Computer Science & Engineering University of Washington

 - Spring Lecture notes 
  • 1 First moments Contents
    • 1.1 The probabilistic method
    • 1.2 Linearity of expectation
    • 1.3 The method of conditional expectation
    • 1.4 Markov’s inequality
    • 1.5 Crossing number inequalities
  • 2 Second moments
    • 2.1 Threshold phenomena in random graphs
    • 2.2 Chebyshev’s inequality and second moments
    • 2.3 Unbiased estimators
    • 2.4 Percolation on a tree
    • 2.5 Using unbiased estimators to count
  • 3 Chernoff bounds
    • 3.1 Randomized rounding
    • 3.2 Some more applications
      • 3.2.1 Balls in bins
      • 3.2.2 Randomized Quicksort
    • 3.3 Negative correlation
  • 4 Martingales
    • 4.1 Doob martingales
    • 4.2 The Hoeffding-Azuma inequality
    • 4.3 Proof
    • 4.4 Additional applications
      • 4.4.1 Concentration in product spaces
      • 4.4.2 Tighter concentration of the chromatic number
  • 5 Memoryless random variables and low-diameter partitions
    • 5.1 Random tree embeddings
    • 5.2 Random low-diameter partitions
    • 5.3 Memoryless random variables
    • 5.4 The partitioning algorithm
  • 6 Low-distortion embeddings
    • 6.1 Distances to subsets
      • 6.1.1 Fréchet’s embedding
      • 6.1.2 Bourgain’s embedding
  • 7 The curse of dimensionality and dimension reduction
    • 7.1 The Johnson-Lindenstrauss lemma
  • 8 Compressive sensing and the RIP
    • 8.1 The restricted isometry property
    • 8.2 Random construction of RIP matrices
  • 9 Concentration for sums of random matrices
    • 9.1 Symmetric matrices
    • 9.2 The method of exponential moments for matrices
    • 9.3 Large-deviation bounds
  • 10 Spectral sparsification
    • 10.1 Laplacians of graphs
      • 10.1.1 Spectral sparsification
    • 10.2 Random sampling
      • 10.2.1 Effective resistances
  • 11 Random walks and electrical networks
    • 11.1 Hitting times and cover times
    • 11.2 Random walks and electrical networks
    • 11.3 Cover times
    • 11.4 Matthews’ bound
  • 12 Markov chains and mixing times
    • 12.1 The Fundamental Theorem
    • 12.2 Eigenvalues and mixing
    • 12.3 Mixing times
    • 12.4 Some Markov chains
  • 13 Eigenvalues, expansion, and rapid mixing
    • 13.1 Conductance
    • 13.2 Multi-commodity flows
    • 13.3 The Gibbs sampler
  • References

MAX-3SAT. Let’s consider a 3-CNF formula over the variables x 1 , x 2 ,... , xn. Such a formula has the form ϕ  C 1 ∧ C 2 ∧ · · · ∧ Cm where each clause is an OR of three literals involving distinct variables: Ci  zi 1 ∨ zi 2 ∨ zi 3. A literal is a variable or its negation. For instance, (x 2 ∨ x¯ 3 ∨ x¯ 4 ) ∧ (x 3 ∨ x¯ 5 ∨ x¯ 1 ) ∧ (x 1 ∨ x 5 ∨ x 4 ) is a 3-CNF formula.

Claim 1.4. If ϕ is a 3-CNF formula with m clauses, then there exists an assignment that makes at least^78 m clauses evaluate to true.

Proof. We will prove this using the probabilistic method. For every variable independently, we choose a uniformly random truth assignment: true or false each with probability 1 / 2. Let Ai equal 1 if clause Ci is satisfied by our random assignment, and equal 0 otherwise. Then P(Ai  1 )  7 / 8 because there are 7 ways to satisfy a clause out of the 8 possible truth values for its literals. Let A  A 1 + · · · + Am denote the total number of satisfied clauses. By linearity of expectation, we have

E[A] 

∑^ m

i 1

E[Ai ]  7 8

m. (1.1)

Since a random assignment satisfies 78 m clauses in expectation, there must exist at least one assignment that satisfies this many clauses. 

MAX-CUT. Consider an undirected graph G  (V, E). A cut is a subset S ⊆ V, and we use E(S, S¯) to denote the set of edges crossing the cut S. This is the set of edges with one endpoint in S and one not in S.

Claim 1.5. In any graph G  (V, E) , there exists a cut S ⊆ V that cuts at least half the edges, i.e., |E(S, S¯)| > |E 2 |.

Proof. We construct a random set S ⊆ V by including every vertex in S independently with probability 1 / 2. For an edge e ∈ E, let Ae  1 if e crosses the cut S, and 0 otherwise. First, it should be apparent that P(Ae  1 )  1 / 2. Therefore by linearity of expectation,

E

|E(S, S¯)|

e∈E

E[Ae ]  |E| 2

Thus there must exist at least one cut S that has at least half the edges crossing it. 

1.3 The method of conditional expectation

Claim 1.4 asserts that there exists an assignment satisfying at least 78 m clauses, but what if we wish to actually find one? One way is to randomly sample from the underlying distribution and then check the resulting assignment. Analyzing the probability of success will require our first tail bound ; we’ll get there in the next section. Let’s examine another way that actually results in a deterministic algorithm. Let S(x 1 , x 2 ,... , xn ) denote the expected number of satisfied clauses given a partial truth assignment to the input variables, where we choose the unassigned variables uniformly at random. We will use T to denote true, F to denote false, and? to denote that no assignment has been chosen for that variable. For instance, S(?, ?,... , ?) denotes the expected number of satisfied clauses in a random assignment, and we have already seen (cf. (1.1)) that

S(?, ?,... , ?)  78 m.

Note that a simple linear-time algorithm can estimate S(x 1 , x 2 ,... , xn ) for any partial assignment x 1 ,... , xn ∈ {T, F, ?} by simply going through the clauses one by one. As an example, consider the clause x 1 ∨ x¯ 2 ∨ x¯ 4. The probability that a random assignment satisfies this is 7 / 8. If we assign x 1  F, then the probability becomes 3 / 4 , and if we set x 1  T, then the probability becomes 1. Observe that S(?, ?,... , ?) 

2 S(F, ?,... , ?)^ +^

2 S(T, ?,... , ?)^.

Since S(?, ?,... , ?) > 78 m, it must hold that S(F, ?,... , ?) > 78 m or S(T, ?,... , ?) > 78 m. As we have just argued, it’s possible to compute both these quantities and figure out which is larger. We can then set x 1 to the corresponding value and keep assigning truth values recursively. Eventually, this process ends at a full assignment to the variables that satisfies at least 78 m clauses. The key property we employed here is the ability to efficiently compute the conditional expectation of the underlying random variable under a partial assignment.

1.4 Markov’s inequality

The probabilistic method shows the existence of an object, but it doesn’t necessarily give us a randomized algorithm to construct it. If we just know that the probability of an event is non-zero, it could still be very tiny; we might need to do an arbitrarily large number of random experiments before we get a positive outcome. Sometimes we can say more.

Tool 1.6 (Markov’s inequality). Let X be a non-negative random variable. Then for any α > 0 , we have P[X > α] 6

E X

α. The proof of this lemma is easy; we leave it as an exercise.

Consider now our MAX-3SAT example above. Let X denote the number of unsatisfied clauses in a random truth assignment. We know from the preceding analysis that E[X] 6 18 m. Markov’s inequality tells us that for any ε > 0 ,

P

[

X >

8 +^ ε

m

]

(^6) ( 1 / 8 m +/^8 ε)m  (^1) +^1 8 ε 6 1 − ε.

The last inequality is only true if we assume ε 6 7 / 8 , but for any value ε > 7 / 8 , the probability is clearly zero. This means that, with probability at least ε, we will get an assignment that satisfies at least ( 7 / 8 − ε)-fraction of clauses. So in expectation, after 1 /ε samples, we will get an assignment that is very close to the one guaranteed to exist. The same kind of reasoning applies to our MAX-CUT analysis.

1.5 Crossing number inequalities

Let’s look at one more application of the linearity of expectation. It is almost as elementary as the examples above, but has some powerful consequences in incidence geometry and sum-product estimates. If G  (V, E) is an undirected graph, we use the notation cr(G) to denote the crossing number of G_._ This is the minimum number of edge crossings required to draw G in the plane. A drawing of

2 Second moments

2.1 Threshold phenomena in random graphs

Consider a positive integer n and value p ∈ [ 0 , 1 ]. Perhaps the simplest model of random (undirected) graphs is Gn,p. To sample a graph from Gn,p , we add every edge {i, j} (for i , j and i, j ∈ { 1 ,... , n}) independently with probability p. For example, if X denotes the number of edges in a Gn,p graph, then E X  p

n 2

A 4 -clique in a graph is a set of four nodes such that all

2

 6 possible edges between the nodes are present. Let G a random graph sampled according to Gn,p , and let C 4 denote the event that G contains a 4 -clique. It will turn out that if p  n−^2 /^3 , then G contains a 4 -clique with probability close to 1 , while if p  n−^2 /^3 , then P[C 4 ] will be close to 0. Thus p  n−^2 /^3 is a “threshold” for the appearance of a 4 -clique.

Remark 2.1_._ Here we use the asymptotic notation f (n)  1 (n) to denote that limn→∞ f (n)/ 1 (n)  ∞. Similarly, f (n)  1 (n) means that limn→∞ f (n)/ 1 (n)  0.

We can use a simple first moment calculation for one side of our desired threshold behavior.

Lemma 2.2. If p  n−^2 /^3 then P[C 4 ] → 0 as n → ∞.

Proof. Let X denote the number of 4 -cliques in G ∼ Gn,p. We can write X 

S XS^ where the set S runs over all

n 4

subsets of four vertices in G, and XS  1 if there is a 4 -clique on S, and XS  0 otherwise. We have P[XS  1 ]  p^6 since all 6 edges must be present, thus by linearity of expectation E X  p^6

n 4

. So if p  n−^2 /^3 , then E X → 0 as n → ∞. But now Markov’s inequality implies that

P[C 4 ]  P[X > 1 ] 6 E X → 0. 

On the other hand, proving that p  n−^2 /^3 ⇒ P[C 4 ] → 1 is more delicate. Even though a first moment calculation implies that, in this case, E X → ∞, this is not enough to conclude that P[C 4 ] → 1. For instance, it could be the case that with probability 1 − (^) n^12 , we have no 4 -cliques, but with probability (^) n^12 we see all possible

n 4

4 -cliques. In that case, E X  n^2 , but still the probability of seeing a 4 -clique would be (^) n^12. We need to exploit the fact that the appearances of distinct 4 -cliques are mostly independent events. Certainly if S and S′^ are two disjoint sets of vertices, then the corresponding random variables XS and XS′^ are independent.

2.2 Chebyshev’s inequality and second moments

First, we recall the notion of the variance of a real-valued random variable X: Var(X)  E (X − E[X])^2. If we know something about the variance, we can improve upon Markov’s inequality.

Tool 2.3 (Chebyshev inequality). If X is a real-valued random variable with μ  E X, then for every α > 0 ,

P

|X − μ| > α

6 Var(X) α^2

Proof. Simply apply Markov’s inequality to the nonnegative random variable (X − μ)^2. 

One consequence of the Chebyshev inequality is the following simple fact.

Corollary 2.4. If X is a real-valued random variable, then

P(X  0 ) 6

Var(X) (E X)^2.

Proof. Using the Chebyshev inequality, we have:

P(X  0 ) 6 P (|X − E X| > E X) 6 Var(X) (E X)^2

Now we are in position to analyze the other side of the threshold. It will help to have the following definition: For two random variables X and Y, we define their covariance by Cov(X, Y)  E[XY] − E[X] E[Y]. Note that if X and Y are independent, then Cov(X, Y)  0.

Lemma 2.5. If X  X 1 + · · · + Xn , then

Var(X) 

∑^ n

i 1

Var(Xi ) +

∑^ n

i 1

j,i

Cov(Xi , Xj ).

Proof. One observe first that for any random variable X, we have Var(X)  E[X^2 ] − (E X)^2 , hence

Var(X)  E * ,

∑^ n

i 1

Xi +

2 − * ,

E

∑^ n

i 1

Xi +

2 .

Expanding the squares and collecting terms yields the desired result. 

Lemma 2.6. If p  n−^2 /^3 , then P[C 4 ] → 1 as n → ∞

Proof. As before, let X 

S XS^ denote the number of^4 -cliques in^ G^ ∼ Gn,p^. Our goal is to show that P[X  0 ] → 0 as n → ∞. Using Corollary 2.4, it suffices to show that Var(X)  (E X)^2. The main task will be evaluating Var(X). Write Var(X) 

S

Var(XS) +

S

T,S

Cov(XS , XT ).

First, observe that since XS is a { 0 , 1 } random variable, we have Var(XS) 6 E[X^2 S]  E[XS], yielding

Var(X) 6 E[X] +

S

T,S

Cov(XS , XT ). (2.1)

Now we evaluate the second sum. The value Cov(XS , XT ) depends on |S ∩ T|. In particular, if |S ∩ T| 6 1 , then Cov(XS , XT )  0 since S and T share no possible edges, hence the events XS and XT are independent. Next, note that Cov(XS , XT ) 6 E[XS XT ], and the latter event is that we have a 4 -clique on both S and T. Thus if |S ∩ T|  2 , then Cov(XS , XT ) 6 p^11 (since for XS  XT  1 to happen, we need 11 edges to be present). Similarly, if |S ∩ T|  3 , then Cov(XS , XT ) 6 p^9. So now we are simply left to count the possibilities: (^) ∑

S

T,S

Cov(XS , XT ) 6 O(n^6 )p^11 + O(n^5 )p^9.

(Make sure you understand why this line is true!) From (2.1), we conclude that

Var(X) 6 O(n^4 )p^6 + O(n^6 )p^11 + O(n^5 )p^9.

Also, recall that E X 

n 4

p^6  Θ(n^4 p^6 ), so (E X)^2  Θ(n^8 p^12 ). In particular, if p  n−^2 /^3 , then Var(X)  (E X)^2. Combined with Corollary 2.4, this yields the desired result. 

2.4 Percolation on a tree

In the last lecture, we used the fact that for a real-valued random variable X, we have

P(X  0 ) 6

Var(X) (E X)^2

Let us see that second moments can also control the probability that a non-negative random variable is non-zero. (A generalization of this inequality often goes by the name “Payley-Zygmund inequality.”)

Lemma 2.10. If X is a non-negative random variable, then

P(X > 0 ) >

(E X)^2

E[X^2 ]

Proof. The proof relies on the Cauchy-Schwarz inequality: For any two real-valued random variables Y and Z, E |YZ| 6

E[Y^2 ]

E[Z^2 ].

We will use Y  X and Z  (^1) {X> 0 }, i.e. Z is the indicator of the event that X > 0 :

E X  E

X 1 {X> 0 }

E[X^2 ]

E 1 {X> 0 } 

E[X^2 ]

P(X > 0 ).

Rearranging and squaring both sides completes the proof. 

Let’s now consider the following model of percolation on the complete (rooted) binary tree of depth n. Fix a parameter p ∈ [ 0 , 1 ] and also an orientation of the tree (so that we can refer to “left” and “right” children). Suppose that every left edge is independently deleted with probability 1 − p and every right edge is independently deleted with probability p. Let X  ∑Z denote the number of leaves which can reach the root of the tree. Here, the sum is over all 2 n^ leaves and Z is the indicator random variable that is 1 precisely when the path from the root to the leaf ` remains intact. Here we are interested in the probability that there exists at least one reachable leaf, i.e. P[X > 0 ].

The first moment. It is relatively easy to compute the expected value of X:

E X 

∑^ n

i 0

n i

pi^ ( 1 − p)n−i^  (p + 1 − p)n^  1.

The summation variable i indexes the number of left turns that a root-leaf path makes. If a path makes i left turns, then the probability it remains intact is pi^ ( 1 − p)n−i^. Furthermore, we can specify a root-leaf path by a sequence of “left” and “right” turns; this implies that the number of leaves whose root-leaf path contains exactly i left turns is

n i

This calculation doesn’t tell us that there is a root-leaf with decent probability. Certainly if p  0 or p  1 , then there is a leaf with probability one (the left-most and right-most paths, respectively). But what about intermediate values of p? What if p  1 / 2?

The second moment. Let’s now compute the second moment, but we’ll be a bit more clever. Let Xn denote the number of reachable leaves in a tree of depth n. If XL and XR denote the number of reachable leaves under the left and right subtrees, then X^2 n  (XL + XR)^2  X^2 L + X^2 R + 2 XL XR. Observe that E[X^2 L]  p E[X^2 n− 1 ], E[X^2 R]  ( 1 − p) E[X^2 n− 1 ], E[XL]  p E[Xn− 1 ]  p and E[XR]  ( 1 − p) E[Xn− 1 ]. Since XL and XR are independent, we have

E[X^2 n ]  E[X^2 n− 1 ] + 2 p( 1 − p).

Since X 0  1 , we get E[X^2 n ]  1 + 2 np( 1 − p). Now applying Lemma 2.10 gives

P(X > 0 ) >

1 + 2 np( 1 − p).

Thus if p  Θ( 1 /n), there exists a reachable leaf with constant probability. If p  1 / 2 , we get a leaf with probability at least 2 /(n + 2 ). Notice that this still leaves a number of interesting questions to be answered. We know that P(X > 0 ) > 2 /(n + 2 ), but E[X^2 n ]  Θ(n). Is it the case that we see Θ(

n) reachable leaves with probability Θ( 1 /n)? [See video of the discrete torus being covered by random walk—the asymptotics of the cover time are determined by a related percolation process on a complete tree.]

2.5 Using unbiased estimators to count

Consider a formula in disjunctive normal form (a DNF formula), e.g.

ϕ  (X 1 ∧ X 2 ∧ X¯ 3 ) ∨ ( X¯ 2 ∧ X 5 ) ∨ · · ·

We can easily determine whether such a formula is satisfiable (we just check whether each term separately is satisfiable). On the other hand, counting the number of satisfying assignments to such a formula is #P-hard. (That means the problem is at least as hard as an NP-complete problem; this class of decision problems is thought to be extremely difficult to solve.) The reason for this hardness is easy to see. Suppose that ϕ is a CNF formula. Then de Morgan’s laws can be used to write ¬ϕ as a DNF formula in polynomial time. But if ϕ is a formula on n variables, then

satisfying assignments to ϕ  2 n^ −

satisfying assignments to ¬ϕ

Nevertheless, we will show that one can obtain an efficient algorithm to approximate the number of satisfying assignments.

Theorem 2.11 (Karp and Luby, 1983). Given a DNF formula ϕ with n variables and m terms, and a number ε > 0 , there is an algorithm running in time O(mn/ε^2 ) that outputs a value Z such that

P

( 1 − ε)Z 6 N(ϕ) 6 ( 1 + ε)Z

where N(ϕ) is the number of satisfying assignments to ϕ.

Theorem 3.1 (Chernoff bound, mutiplicative error). For every β > 1 , it holds that

P

X > βμ

eβ−^1 ββ

)μ , (3.1)

and

P

X 6

μ β

e^1 /β−^1 ββ

)μ

. (3.2)

It’s easy to use these formulae, but it sometimes helps to employ the slightly weaker bounds: If we put β  1 + δ for 0 < δ < 1 ,

P

X > ( 1 + δ)μ

6 e−^

δ^2 μ (^3) ,

P

X 6 ( 1 − δ)μ

6 e−^

δ^2 μ (^2).

The main point is that these tail bounds go down exponentially in the mean μ and the multiplicative deviation β, as opposed to the previous tail bounds we’ve seen (Markov and Chebyshev) that only go down polynomially.

Proof of Theorem 3.5. Much as we proved Chebyshev’s inequality by applying Markov’s inequality to the random variable |X − E X|^2 , the Chernoff bound is proved by applying a function to the underlying random variable X and then applying Markov’s inequality. Let t > 0 be a parameter we will choose later and write

P[X > βμ]  P

etX^ > etβμ

E[etX^ ] etβμ^

The point of applying the function X 7 → etX^ is that we can exploit independence:

E

etX^

 E

[

et(X^1 +···+Xn^ )

]

 E

∏^ n

i 1

etXi

∏^ n

i 1

E

etXi^

Now write: E[etXi^ ]  ( 1 − pi ) + pi et^  1 + pi (et^ − 1 ) 6 epi^ (e

t (^) − 1 ) ,

where the last inequality uses 1 + x 6 ex^ which is valid for all x ∈ R. Plugging this into (3.4) yields

E

etX^

∏^ n

i 1

epi^ (e

t (^) − 1 )  eμ(e

t (^) − (^1) )

Now recalling (3.3), we have P[X > βμ] 6 eμ(e

t (^) − 1 −βt) .

Choosing t  ln β yields (3.7). One can prove (3.8) similarly. 

3.1 Randomized rounding

A classical technique in the field of approximation algorithms is to write down a linear programming relaxation of a combinatorial problem. The linear program (LP) is then solved in polynomial time, and one rounds the fractional solution to an integral solution that is, hopefully, not too much worse than the optimal solution. A classical example goes back to Raghavan and Thompson. Let D  (V, A) be a directed network, and suppose that we are given a sequence of terminal pairs (s 1 , t 1 ), (s 2 , t 2 ),... , (sk , tk ) where {si }, {ti } ⊆ V. We use =  (D, {(si , ti )}) denote this instance of the min-congestion disjoint paths problem. The goal is to choose, for every i, a directed si - ti path γi in D so as to minimize the maximum congestion of an arc e ∈ A:

opt(=)  minimize

max e∈A #{i : e ∈ γi }

This problem is NP-hard. Our goal will be an approximation algorithm that outputs a solution {γi } so that the congestion of every edge is at most α · opt. The number α is called the approximation factor of our algorithm.

A fractional relaxation. Our approach will be to compute first a fractional solution that sends 1 unit of flow from si to ti for every i. A flow can be thought of in the following way. Let Pi denote the set of simple, directed si - ti paths in D, and let P denote the set of all simple directed paths in D. Here, simple means that no arc is repeated. A multi-flow F is a mapping F : P → R+ of paths to nonnegative real numbers. The multi-flow F routes the demands {(si , ti )} if, for every i  1 ,... , k, we have

γ∈Pi F(γ)^ ^1 , i.e. we send at least one unit of flow from si to ti for every i. Finally, the congestion of an arc e ∈ A under the flow F is the value conF (e) 

γ∈P:e∈γ F(γ), i.e. the amount of flow passing through the arc^ e. We make the definition:

LP(=)  minimizeF

max e∈A

conF (e)

where the minimum is over all multi-flows F that route the demands {(si , ti )}. It should be clear that LP(=) 6 opt(=). The reason we write LP(=) is that this value can be computed by a linear program of polynomial-size. This is not precisely clear from our formulation because there are possibly exponentially many paths in P, but there is a compact formulation of the LP using standard techniques (see the remark at the end of this section). Given a multi-flow F, we will round it to an integral multi-flow F′, where an integral flow is one such that, for every i  1 ,... , k, we have F′(γ)  1 for exactly one γ ∈ Pi. Note that an integral flow represents a solution to the initial disjoint paths problem. Furthermore, we will now show that for some α > 1 , we have max e∈A

conF′^ (e) 6 α · ( 1 + max e∈A

conF (e)).

In particular, if we apply this to the optimal fractional flow F∗, we arrive at

max e∈A conF (e) 6 α · ( 1 + max e∈A conF∗^ (e))  α( 1 + LP(=)) 6 α( 1 + opt(=)) 6 2 α · opt(=) ,

implying that we have achieved an 2 α-approximation to the optimal solution. (Note that we have used the trivial bound opt > 1 .)

Remark 3.3_._ Note that if we knew conF (e) > C′^ log n for some constant C′^ and every e ∈ A, then we could actually choose β  O( 1 ) and still achieve a bound of n−^3 on the probability of an over congested edge. This means that if all the fractional congestions are Ω(log n), we can get an O( 1 ) approximation.

Remark 3.4_._ To compute the optimal fractional multi-flow, we write a linear program with variables {Fe : e ∈ A}. Our program should minimize the value λ such that Fe 6 λ for every e ∈ A. Moreover, to make sure that the variables {Fe : e ∈ A} correspond to an optimal flow, we should add the flow constraints at every non-terminal vertex: The flow in should be equal to the flow out of the vertex. At terminals, we have to allow there to be a surplus or deficit based on whether we are at a source or a sink. This program has O(m) variables and O(m + n) linear constraints, where m  |A| and n  |V |.

3.2 Some more applications

In the preceding lecture, we saw our first large-deviation inequality. Let X 1 , X 2 ,... , Xn be a family of independent (but not necessarily identically distributed) { 0 , 1 } random variables and X  X 1 + X 2 + · · · + Xn. Let pi  E[Xi ] and define μ  E[X]  p 1 + p 2 + · · · + pn. We recall the following multiplicative form of the “Chernoff bound.”

Theorem 3.5 (Chernoff bound, mutiplicative error). For every β > 1 , it holds that

P

X > βμ

eβ−^1 ββ

)μ , (3.7)

and

P

X 6

μ β

e^1 /β−^1 ββ

)μ

. (3.8)

3.2.1 Balls in bins

Suppose we throw m balls uniformly at random into n bins. For i  1 ,... , n, let X(i)^ denote the number of balls that land in bin i. Let Z : max(X(^1 ),... , X(n)) denote the maximum load. Even to bound E[Z] seems tricky, and it is often the case that evaluating the expected maximum of a family of random variables requires understanding their tail behavior. Let X( ji )be the indicator random variable that is 1 if ball j lands in bin i. Then E[X( ji )]  1 /n and

hence by linearity of expectation, E[X(i)]  m/n. Applying Theorem 3.5 yields, for any i  1 ,... , n,

P

[

X(i)^ > β m n

]

e β

)βm/n

. (3.9)

Let’s consider two representative regimes.

Regime I: m  n. By choosing β  (^) log logc^ log^ n n for c > 1 large enough (as in the preceding lecture), (3.9) gives P

[

X(i)^ > β

]

6 n−^2

Now the deviation probability is small enough to apply a union bound:

P[Z > β] 6

∑^ n

i 1

P[X(i)^ > β] 6 n · n−^3  (^1) n.

Thus with high probability, the maximum load is O( (^) log loglog^ n n ).

Regime II: m > cn log n , c > 0. In this case, we have m/n > c log n, so applying (3.9) and a union bound gives P[Z > β] 6 n · β−cβ^ log^ n^.

Now choosing β  1 /c gives P[Z > β] (^6 1) n , implying that the maximum load is only an O( 1 ) factor more than its expectation.

In comparing the two regimes, note that as the expected number of balls per bin rises, we actually get more concentration around the mean.

3.2.2 Randomized Quicksort

I don’t particularly like this application since it requires some unnatural machinations to get independent random variables. In the next lecture, we will see that large-deviation inequalities hold for martingales, and this argument becomes more natural. But a quick recap: Consider the numbers { 1 , 2 ,... , n}. We construct a random rooted tree T where each node v ∈ V( T ) has an associated subset Sv ⊆ { 1 ,... , n} defined as follows: For the root r ∈ V( T ), we have Sr  { 1 ,... , n}. Then inductively, for a node v with |Sv | > 1 , we partition Sv uniformly at random into two sets SvL , SRv with |SLv |, |SRv | > 1 , and we give v two children labeled by these sets. Thus T has precisely n leaves labeled by the singleton sets { 1 },... , {n}. Let Di denote the depth of the leaf labeled by {i}. The following claim is straightforward to verify inductively: The number of comparisons made by Quicksort is precisely D 1 + D 2 + · · · + Dn. (Strictly speaking, this is only true because we are including the pivot in one of the two child lists, but a more clever implementation would only do better.)

Claim 3.6. There is a constant C > 1 such that for any i ∈ { 1 , 2 ,... , n} , it holds that

P[Di > C log n] 6 n−^2.

Taking a union bound gives

P[# comparisons > Cn log n] 6 1 n

i.e. Quicksort runs in O(n log n) time with high probability. Fix an element i ∈ { 1 ,... , n}. Let S 0 , S 1 ,... , SDi  {i} be the labels of the nodes occuring from the root down to the leaf labeled {i} in T. Define Sj : {i} for j > Di. Then an elementary calculation gives

P

[

|Sj+ 1 | 6 1 2

|Sj |

]

∀j > 0.

Define:

Yj 

1 if |Sj+ 1 | 6 12 |Sj | or Sj+ 1  Sj 0 otherwise.

The next claim is straightforward to verify.

Claim 3.7. For every j > 0 , we have P[Yj  1 ] > 12_. Moreover, if_

∑M− 1

j 0 Yj^ >^ log 2 n , then^ Di^6 M_._ If {Yj } were independent random variables, then we could apply (3.8) to conclude that

P

[

Y 0 + Y 1 + · · · + YM− 1 6

M

2 β

]

e^1 /β β

)βM/ 2

connects two vertices that are already connected in the graph with edges {e 1 ,... , ek }, then P[Xe  1 | Xe 1  · · ·  Xek  1 ]  0. Actually proving negative correlation for this family is non-trivial.

It turns out that the Chernoff bounds Theorem 3.5 hold if we consider negatively correlated random variables. It is still an area of active research to determine good notions for “negative dependence” in general settings. In particular, the notion of of negative correlation above is unsuitable for many settings, especially because it can be hard to verify and does not satisfy natural closure properties (making it difficult to derive new negatively correlated families from old ones). Theorem 3.8 (Chernoff for negatively correlated random variables). If, in the statement of Theorem 3.5, we only assume that X 1 ,... , Xn are negatively correlated { 0 , 1 } random variables (instead of independent), then the conclusion still holds. Proof. To see this, note that the one place we used independence in the proof of Theorem 3.5 is in the calculation: When X  X 1 + · · · + Xn ,

E

etX^

 E

∏^ n

i 1

etXi

∏^ n

i 1

E

etXi^

Let us see that the inequality E

etX^

∏n i 1 E^

etXi

still holds when {X 1 ,... , Xn } are only assumed to be negatively correlated. To this end, let { X˜ 1 ,... , X˜n } be independent { 0 , 1 } random variables with E[ X˜i ]  E[Xi ] for each i  1 ,... , n, and define X˜ : X˜ 1 + · · · + X˜n. For any nonnegative integer k,

E[Xk^ ] 

α

E[X 1 α 1 X 2 α 2 · · · X nα n] ,

where the sum is over all α ∈ Rn^ with αi > 0 and

i αi^ ^ k. Using the negative correlation property, this gives E[Xk^ ] 6

α

E[X 1 α 1 ] E[Xα 2 2 ] · · · E[Xα n n] 

α

E[ X˜ 1 α 1 ] E[ X˜ 2 α 2 ] · · · E[ X˜α n n],

where the last line follows because Xi and X˜i have the same distribution for every i. Finally, note that by independence, ∑

α

E[ X˜ 1 α 1 ] E[ X˜α 2 2 ] · · · E[ X˜α n n] 

α

E[ X˜ 1 α 1 X˜ 2 α 2 · · · X˜α n n]  E[ X˜k^ ].

We conclude that for every integer k > 0 ,

E[Xk^ ] 6 E[ X˜k^ ]. (3.11) Using the Taylor expansion

etX^  1 + tX + t

2 X 2

2 +^

t^3 X^3 6 +^ · · ·^ , and applying (3.11) to each term gives

E[etX^ ] 6 E[et^ X˜^ ] 

∏^ n

i 1

E[et^ X˜i^ ] 

∏^ n

i 1

E[etXi^ ] ,

yielding our desired inequality. Now the proof of the Chernoff bound can proceed exactly as in the preceding lecture. 

4 Martingales

We have seen that if X  X 1 + · · · + Xn is a sum of independent { 0 , 1 } random variables, then X is tightly concentrated around its expected value E[X]. The fact that the random variables were { 0 , 1 }-valued was not essential; similar concentration results hold if we simply assume that they are in some bounded range [−L, L]. One can also relax the independence assumption, as we will see next. Consider a sequence of random variables X 0 , X 1 , X 2 ,.. .. The sequence {Xi } is called a discrete- time martingale if it holds that E[Xi+ 1 | X 0 , X 1 ,... , Xi ]  Xi for every i  0 , 1 , 2 ,.. .. More generally, the sequence is {Xi } is a martingale with respect to another sequence of random variables {Yi } if it for every i, it holds that

E[Xi+ 1 | Y 0 , Y 1 ,... , Yi ]  Xi.

Note that this is equivalent to E[Xi+ 1 − Xi | Y 0 , Y 1 ,... , Yi ]  0. If one thinks of {Y 0 , Y 1 ,... , Yi } as all the “information” up to time i, then this says that the difference Xi+ 1 − Xi is unbiased conditioned on the past up to time i. Observe that for any i, we have

E[Xi ]  E[E[Xi | X 0 ,... , Xi− 1 ]]  E[Xi− 1 ]  · · ·  E[X 0 ].

Martingales form an extremely useful class of random processes that appear in a vast array of settings (e.g., finance, machine learning, information theory, statistical physics, etc.). The classic example is that of a Gambler whose bank roll is X 0. At each time, she chooses to play some game in the casino at some stakes. If we assume that every game is fair (that is, the expected utility from playing the game is 0 ), then the sequence {X 0 , X 1 ,.. .} forms a martingale, where Xi is the amount of money she has at time i. Remark 4.1_._ The correct level of generality at which to define martingales involves a filtration. Formally, this is an increasing sequence of σ-algebras on our measure space (Ω, μ, F ): F 0 ⊆ F 1 ⊆ · · · ⊆ F. A sequence of random variables {Xi } is a martingale with respect to the filtration {Fi } if E[Xi+ 1 | Fi ]  Xi for every i > 0.

4.1 Doob martingales

One reason martingales are so powerful is that they model a situation where one gains progressively more information over time. Suppose that U is a set of objects, and f : U → R. Let X be a random variable taking values in U, and let {Yi } be another sequence of random variables. The associated Doob martingale is given by Xi  E[ f (X) | Y 0 , Y 1 ,... , Yi ]. In words, this is our “estimate” for the value of f (X) given the information contained in {Y 0 ,... , Yi }. To see that this is always a martingale with respect to {Yi }, observe that

E[Xi+ 1 | Y 0 ,... , Yi ]  E[E[ f (X) | Y 0 ,... , Yi+ 1 ] | Y 0 ,... , Yi ]  E[ f (X) | Y 0 ,... , Yi ]  Xi ,

where we have used the tower rule of conditional expectations.