随机算法 (Spring 2013)/Threshold and Concentration

From TCS Wiki
Revision as of 09:43, 1 April 2013 by imported>Etone (The Chernoff bound)
Jump to navigation Jump to search

Erdős–Rényi Random Graphs

Consider a graph G(V,E) which is randomly generated as:

  • |V|=n;
  • {u,v}(V2), uvE independently with probability p.

Such graph is denoted as G(n,p). This is called the Erdős–Rényi model or G(n,p) model for random graphs.

Informally, the presence of every edge of G(n,p) is determined by an independent coin flipping (with probability of HEADs p).

Monotone properties

A graph property is a predicate of graph which depends only on the structure of the graph.

Definition
Let Gn=2(V2), where |V|=n, be the set of all possible graphs on n vertices. A graph property is a boolean function P:Gn{0,1} which is invariant under permutation of vertices, i.e. P(G)=P(H) whenever G is isomorphic to H.

We are interested in the monotone properties, i.e., those properties that adding edges will not change a graph from having the property to not having the property.

Definition
A graph property P is monotone if for any GH, both on n vertices, G having property P implies H having property P.

By seeing the property as a function mapping a set of edges to a numerical value in {0,1}, a monotone property is just a monotonically increasing set function.

Some examples of monotone graph properties:

  • Hamiltonian;
  • k-clique;
  • contains a subgraph isomorphic to some H;
  • non-planar;
  • chromatic number >k (i.e., not k-colorable);
  • girth <.

From the last two properties, you can see another reason that the Erdős theorem is unintuitive.

Some examples of non-monotone graph properties:

  • Eulerian;
  • contains an induced subgraph isomorphic to some H;

For all monotone graph properties, we have the following theorem.

Theorem
Let P be a monotone graph property. Suppose G1=G(n,p1), G2=G(n,p2), and 0p1p21. Then
Pr[P(G1)]Pr[P(G2)].

Although the statement in the theorem looks very natural, it is difficult to evaluate the probability that a random graph has some property. However, the theorem can be very easily proved by using the idea of coupling, a proof technique in probability theory which compare two unrelated random variables by forcing them to be related.

Proof.

For any {u,v}([n]2), let X{u,v} be independently and uniformly distributed over the continuous interval [0,1]. Let uvG1 if and only if X{u,v}[0,p1] and let uvG2 if and only if X{u,v}[0,p2].

It is obvious that G1G(n,p1) and G2G(n,p2). For any {u,v}, uvG1 means that X{u,v}[0,p1][0,p2], which implies that uvG2. Thus, G1G2.

Since P is monotone, P(G1)=1 implies P(G2). Thus,

Pr[P(G1)=1]Pr[P(G2)=1].

Threshold phenomenon

One of the most fascinating phenomenon of random graphs is that for so many natural graph properties, the random graph G(n,p) suddenly changes from almost always not having the property to almost always having the property as p grows in a very small range.

A monotone graph property P is said to have the threshold p(n) if

  • when pp(n), Pr[P(G(n,p))]=0 as n (also called G(n,p) almost always does not have P); and
  • when pp(n), Pr[P(G(n,p))]=1 as n (also called G(n,p) almost always has P).

The classic method for proving the threshold is the so-called second moment method (Chebyshev's inequality).

Threshold for 4-clique

Theorem
The threshold for a random graph G(n,p) to contain a 4-clique is p=n2/3.

We formulate the problem as such. For any 4-subset of vertices S(V4), let XS be the indicator random variable such that

XS={1S is a clique,0otherwise.

Let X=S(V4)XS be the total number of 4-cliques in G.

It is sufficient to prove the following lemma.

Lemma
  • If p=o(n2/3), then Pr[X1]0 as n.
  • If p=ω(n2/3), then Pr[X1]1 as n.
Proof.

The first claim is proved by the first moment (expectation and Markov's inequality) and the second claim is proved by the second moment method (Chebyshev's inequality).

Every 4-clique has 6 edges, thus for any S(V4),

E[XS]=Pr[XS=1]=p6.

By the linearity of expectation,

E[X]=S(V4)E[XS]=(n4)p6.

Applying Markov's inequality

Pr[X1]E[X]=O(n4p6)=o(1), if p=o(n2/3).

The first claim is proved.

To prove the second claim, it is equivalent to show that Pr[X=0]=o(1) if p=ω(n2/3). By the Chebyshev's inequality,

Pr[X=0]Pr[|XE[X]|E[X]]Var[X](E[X])2,

where the variance is computed as

Var[X]=Var[S(V4)XS]=S(V4)Var[XS]+S,T(V4),STCov(XS,XT).

For any S(V4),

Var[XS]=E[XS2]E[XS]2E[XS2]=E[XS]=p6. Thus the first term of above formula is S(V4)Var[XS]=O(n4p6).

We now compute the covariances. For any S,T(V4) that ST:

  • Case.1: |ST|1, so S and T do not share any edges. XS and XT are independent, thus Cov(XS,XT)=0.
  • Case.2: |ST|=2, so S and T share an edge. Since |ST|=6, there are (n6)=O(n6) pairs of such S and T.
Cov(XS,XT)=E[XSXT]E[XS]E[XT]E[XSXT]=Pr[XS=1XT=1]=p11
since there are 11 edges in the union of two 4-cliques that share a common edge. The contribution of these pairs is O(n6p11).
  • Case.2: |ST|=3, so S and T share a triangle. Since |ST|=5, there are (n5)=O(n5) pairs of such S and T. By the same argument,
Cov(XS,XT)Pr[XS=1XT=1]=p9
since there are 9 edges in the union of two 4-cliques that share a triangle. The contribution of these pairs is O(n5p9).

Putting all these together,

Var[X]=O(n4p6+n6p11+n5p9).

And

Pr[X=0]Var[X](E[X])2=O(n4p6+n2p1+n3p3),

which is o(1) if p=ω(n2/3). The second claim is also proved.

Threshold for balanced subgraphs

The above theorem can be generalized to any "balanced" subgraphs.

Definition
  • The density of a graph G(V,E), denoted ρ(G), is defined as ρ(G)=|E||V|.
  • A graph G(V,E) is balanced if ρ(H)ρ(G) for all subgraphs H of G.

Cliques are balanced, because (k2)k(n2)n for any kn. The threshold for 4-clique is a direct corollary of the following general theorem.

Theorem (Erdős–Rényi 1960)
Let H be a balanced graph with k vertices and edges. The threshold for the property that a random graph G(n,p) contains a (not necessarily induced) subgraph isomorphic to H is p=nk/.
Sketch of proof.

For any S(Vk), let XS indicate whether GS (the subgraph of G induced by S) contain a subgraph H. Then

pE[XS]k!p, since there are at most k! ways to match the substructure.

Note that k does not depend on n. Thus, E[XS]=Θ(p). Let X=S(Vk)XS be the number of H-subgraphs.

E[X]=Θ(nkp).

By Markov's inequality, Pr[X1]E[X]=Θ(nkp) which is o(1) when pn/k.

By Chebyshev's inequality, Pr[X=0]Var[X]E[X]2 where

Var[X]=S(Vk)Var[XS]+STCov(XS,XT).

The first term S(Vk)Var[XS]S(Vk)E[XS2]=S(Vk)E[XS]=E[X]=Θ(nkp).

For the covariances, Cov(XS,XT)0 only if |ST|=i for 2ik1. Note that |ST|=i implies that |ST|=2ki. And for balanced H, the number of edges of interest in S and T is 2iρ(HST)2iρ(H)=2i/k. Thus, Cov(XS,XT)E[XSXT]p2i/k. And,

STCov(XS,XT)=i=2k1O(n2kip2i/k)

Therefore, when pn/k,

Pr[X=0]Var[X]E[X]2Θ(nkp)+i=2k1O(n2kip2i/k)Θ(n2kp2)=Θ(nkp)+i=2k1O(nipi/k)=o(1).


Chernoff Bound

Suppose that we have a fair coin. If we toss it once, then the outcome is completely unpredictable. But if we toss it, say for 1000 times, then the number of HEADs is very likely to be around 500. This striking phenomenon, illustrated in the right figure, is called the concentration. The Chernoff bound captures the concentration of independent trials.

The Chernoff bound is also a tail bound for the sum of independent random variables which may give us exponentially sharp bounds.

Before proving the Chernoff bound, we should talk about the moment generating functions.

Moment generating functions

The more we know about the moments of a random variable X, the more information we would have about X. There is a so-called moment generating function, which "packs" all the information about the moments of X into one function.

Definition
The moment generating function of a random variable X is defined as E[eλX] where λ is the parameter of the function.

By Taylor's expansion and the linearity of expectations,

E[eλX]=E[k=0λkk!Xk]=k=0λkk!E[Xk]

The moment generating function E[eλX] is a function of λ.

The Chernoff bound

The Chernoff bounds are exponentially sharp tail inequalities for the sum of independent trials. The bounds are obtained by applying Markov's inequality to the moment generating function of the sum of independent trials, with some appropriate choice of the parameter λ.

Chernoff bound (the upper tail)
Let X=i=1nXi, where X1,X2,,Xn are independent Poisson trials. Let μ=E[X].
Then for any δ>0,
Pr[X(1+δ)μ](eδ(1+δ)(1+δ))μ.
Proof.
For any λ>0, X(1+δ)μ is equivalent to that eλXeλ(1+δ)μ, thus
Pr[X(1+δ)μ]=Pr[eλXeλ(1+δ)μ]E[eλX]eλ(1+δ)μ,

where the last step follows by Markov's inequality.

Computing the moment generating function E[eλX]:

E[eλX]=E[eλi=1nXi]=E[i=1neλXi]=i=1nE[eλXi].(for independent random variables)

Let pi=Pr[Xi=1] for i=1,2,,n. Then,

μ=E[X]=E[i=1nXi]=i=1nE[Xi]=i=1npi.

We bound the moment generating function for each individual Xi as follows.

E[eλXi]=pieλ1+(1pi)eλ0=1+pi(eλ1)epi(eλ1),

where in the last step we apply the Taylor's expansion so that ey1+y where y=pi(eλ1)0. (By doing this, we can transform the product to the sum of pi, which is μ.)

Therefore,

E[eλX]=i=1nE[eλXi]i=1nepi(eλ1)=exp(i=1npi(eλ1))=e(eλ1)μ.

Thus, we have shown that for any λ>0,

Pr[X(1+δ)μ]E[eλX]eλ(1+δ)μe(eλ1)μeλ(1+δ)μ=(e(eλ1)eλ(1+δ))μ.

For any δ>0, we can let λ=ln(1+δ)>0 to get

Pr[X(1+δ)μ](eδ(1+δ)(1+δ))μ.

The idea of the proof is actually quite clear: we apply Markov's inequality to eλX and for the rest, we just estimate the moment generating function E[eλX]. To make the bound as tight as possible, we minimized the e(eλ1)eλ(1+δ) by setting λ=ln(1+δ), which can be justified by taking derivatives of e(eλ1)eλ(1+δ).


We then proceed to the lower tail, the probability that the random variable deviates below the mean value:

Chernoff bound (the lower tail)
Let X=i=1nXi, where X1,X2,,Xn are independent Poisson trials. Let μ=E[X].
Then for any 0<δ<1,
Pr[X(1δ)μ](eδ(1δ)(1δ))μ.
Proof.
For any λ<0, by the same analysis as in the upper tail version,
Pr[X(1δ)μ]=Pr[eλXeλ(1δ)μ]E[eλX]eλ(1δ)μ(e(eλ1)eλ(1δ))μ.

For any 0<δ<1, we can let λ=ln(1δ)<0 to get

Pr[X(1δ)μ](eδ(1δ)(1δ))μ.

Some useful special forms of the bounds can be derived directly from the above general forms of the bounds. We now know better why we say that the bounds are exponentially sharp.

Useful forms of the Chernoff bound
Let X=i=1nXi, where X1,X2,,Xn are independent Poisson trials. Let μ=E[X]. Then
1. for 0<δ1,
Pr[X(1+δ)μ]<exp(μδ23);
Pr[X(1δ)μ]<exp(μδ22);
2. for t2eμ,
Pr[Xt]2t.
Proof.
To obtain the bounds in (1), we need to show that for 0<δ<1, eδ(1+δ)(1+δ)eδ2/3 and eδ(1δ)(1δ)eδ2/2. We can verify both inequalities by standard analysis techniques.

To obtain the bound in (2), let t=(1+δ)μ. Then δ=t/μ12e1. Hence,

Pr[X(1+δ)μ](eδ(1+δ)(1+δ))μ(e1+δ)(1+δ)μ(e2e)t2t

Balls into bins, revisited

Throwing m balls uniformly and independently to n bins, what is the maximum load of all bins with high probability? In the last class, we gave an analysis of this problem by using a counting argument.

Now we give a more "advanced" analysis by using Chernoff bounds.


For any i[n] and j[m], let Xij be the indicator variable for the event that ball j is thrown to bin i. Obviously

E[Xij]=Pr[ball j is thrown to bin i]=1n

Let Yi=j[m]Xij be the load of bin i.


Then the expected load of bin i is

()μ=E[Yi]=E[j[m]Xij]=j[m]E[Xij]=m/n.

For the case m=n, it holds that μ=1

Note that Yi is a sum of m mutually independent indicator variable. Applying Chernoff bound, for any particular bin i[n],

Pr[Yi>(1+δ)μ](eδ(1+δ)1+δ)μ.

When m=n

When m=n, μ=1. Write c=1+δ. The above bound can be written as

Pr[Yi>c]ec1cc.

Let c=elnnlnlnn, we evaluate ec1cc by taking logarithm to its reciprocal.

ln(ccec1)=clncc+1=c(lnc1)+1=elnnlnlnn(lnlnnlnlnlnn)+1elnnlnlnn2elnlnn+12lnn.

Thus,

Pr[Yi>elnnlnlnn]1n2.

Applying the union bound, the probability that there exists a bin with load >12lnn is

nPr[Y1>elnnlnlnn]1n.

Therefore, for m=n, with high probability, the maximum load is O(elnnlnlnn).

For larger m

When mnlnn, then according to (), μ=mnlnn

We can apply an easier form of the Chernoff bounds,

Pr[Yi2eμ]22eμ22elnn<1n2.

By the union bound, the probability that there exists a bin with load 2emn is,

nPr[Y1>2emn]=nPr[Y1>2eμ]1n.

Therefore, for mnlnn, with high probability, the maximum load is O(mn).