<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tcs.nju.edu.cn/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=172.16.65.0%2F24</id>
	<title>TCS Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://tcs.nju.edu.cn/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=172.16.65.0%2F24"/>
	<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Special:Contributions/172.16.65.0/24"/>
	<updated>2026-09-15T16:58:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Extremal_graphs&amp;diff=3512</id>
		<title>Combinatorics (Fall 2010)/Extremal graphs</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Extremal_graphs&amp;diff=3512"/>
		<updated>2010-10-14T06:38:40Z</updated>

		<summary type="html">&lt;p&gt;172.16.65.101: /* Turán&amp;#039;s theorem */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Extremal Graph Theory ==&lt;br /&gt;
&lt;br /&gt;
=== Mantel&#039;s theorem ===&lt;br /&gt;
We consider a typical extremal problem for graphs: the largest possible number of edges of &#039;&#039;&#039;triangle-free&#039;&#039;&#039; graphs, i.e. graphs contains no &amp;lt;math&amp;gt;K_3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Theorem (Mantel 1907)|&lt;br /&gt;
:Suppose &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt; is graph on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertice without triangles. Then &amp;lt;math&amp;gt;|E|\le\frac{n^2}{4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Prooftitle|First proof. (pigeonhole principle)|&lt;br /&gt;
We prove an equivalent theorem: Any &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;|V|=n&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;|E|&amp;gt;\frac{n^2}{4}&amp;lt;/math&amp;gt; must have a triangle.&lt;br /&gt;
&lt;br /&gt;
Use induction on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;. The theorem holds trivially for &amp;lt;math&amp;gt;n\le 3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Induction hypothesis: assume the theorem hold for &amp;lt;math&amp;gt;|V|\le n-1&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices, without loss of generality, assume that &amp;lt;math&amp;gt;|E|=\frac{n^2}{4}+1&amp;lt;/math&amp;gt;, we will show that &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; must contain a triangle. Take a &amp;lt;math&amp;gt;uv\in E&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt; be the subgraph of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; induced by &amp;lt;math&amp;gt;V\setminus \{u,v\}&amp;lt;/math&amp;gt;. Clearly, &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt; has &amp;lt;math&amp;gt;n-2&amp;lt;/math&amp;gt; vertices.&lt;br /&gt;
:&#039;&#039;&#039;Case.1:&#039;&#039;&#039; If &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt; has &amp;lt;math&amp;gt;&amp;gt;\frac{(n-2)^2}{4}&amp;lt;/math&amp;gt; edges, then by the induction hypothesis, &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt; has a triangle.&lt;br /&gt;
:&#039;&#039;&#039;Case.2:&#039;&#039;&#039; If &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt; has &amp;lt;math&amp;gt;\le\frac{(n-2)^2}{4}&amp;lt;/math&amp;gt; edges, then at least &amp;lt;math&amp;gt;\left(\frac{n^2}{4}+1\right)-\frac{(n-2)^2}{4}-1=n-1&amp;lt;/math&amp;gt; edges are between &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\{u,v\}&amp;lt;/math&amp;gt;. By pigeonhole principle, there must be a vertex in &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt; that is adjacent to both &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;. Thus, &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; has a triangle.&lt;br /&gt;
}} &lt;br /&gt;
&lt;br /&gt;
{{Prooftitle|Second proof. (Cauchy-Schwarz inequality)|(Mantel&#039;s original proof)&lt;br /&gt;
For any edge &amp;lt;math&amp;gt;uv\in E&amp;lt;/math&amp;gt;, no vertex can be a neighbor of both &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;, or otherwise there will be a triangle. Thus, for any edge &amp;lt;math&amp;gt;uv\in E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;d_u+d_v\le n&amp;lt;/math&amp;gt;. It follows that&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{uv\in E}(d_u+d_v)\le n|E|&amp;lt;/math&amp;gt;.&lt;br /&gt;
Note that &amp;lt;math&amp;gt;d(v)&amp;lt;/math&amp;gt; appears exactly &amp;lt;math&amp;gt;d_v&amp;lt;/math&amp;gt; times in the sum, so that&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{uv\in E}(d_u+d_v)=\sum_{v\in V}d_v^2&amp;lt;/math&amp;gt;.&lt;br /&gt;
Applying Chauchy-Schwarz inequality,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
n|E|\ge\sum_{v\in V}d_v^2\ge\frac{\left(\sum_{v\in V}d_v\right)^2}{n}=\frac{4|E|^2}{n},&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
where the last equation is due to Euler&#039;s equality &amp;lt;math&amp;gt;\sum_{v\in V}d_v=2|E|&amp;lt;/math&amp;gt;. The theorem follows.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Prooftitle|Third proof. (inequality of the arithmetic and geometric mean)|&lt;br /&gt;
Assume that &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt; has &amp;lt;math&amp;gt;|V|=n&amp;lt;/math&amp;gt; vertices and is triangle-free.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; be the largest independent set in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; and let &amp;lt;math&amp;gt;\alpha=|A|&amp;lt;/math&amp;gt;. &lt;br /&gt;
Since &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; is triangle-free, for very vertex &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;, all its neighbors must form an independent set, thus &amp;lt;math&amp;gt;d(v)\le \alpha&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Take &amp;lt;math&amp;gt;B=V\setminus A&amp;lt;/math&amp;gt; and let &amp;lt;math&amp;gt;\beta=|B|&amp;lt;/math&amp;gt;.&lt;br /&gt;
Since &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; is an independent set, all edges in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; must have at least one endpoint in &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;. Counting the edges in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; according to their endpoints in &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, we obtain &amp;lt;math&amp;gt;|E|\le\sum_{v\in B}d_v&amp;lt;/math&amp;gt;. By the inequality of the arithmetic and geometric mean,&lt;br /&gt;
:&amp;lt;math&amp;gt;|E|\le\sum_{v\in B}d_v\le\alpha\beta\le\left(\frac{\alpha+\beta}{2}\right)^2=\frac{n^2}{4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Turán&#039;s theorem ===&lt;br /&gt;
{{Theorem|Theorem (Turán 1941)|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt; be a graph with &amp;lt;math&amp;gt;|V|=n&amp;lt;/math&amp;gt;. If &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; has no &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;-clique, &amp;lt;math&amp;gt;k\ge 2&amp;lt;/math&amp;gt;, then&lt;br /&gt;
::&amp;lt;math&amp;gt;|E|\le\frac{r-2}{2(r-1)}n^2&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Prooftitle|First proof. (induction)|(Turán&#039;s original proof)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Prooftitle|Second proof. (weight shifting)|(due to Motzkin and Straus)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Prooftitle|Third proof. (the probabilistic method)|(due to Alon and Spencer)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Prooftitle|Fourth proof.|&lt;br /&gt;
Let &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt; be a &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;-clique-free graph on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices with a maximum number of edges.&lt;br /&gt;
:&#039;&#039;&#039;Claim:&#039;&#039;&#039; &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; does not contain three vertices &amp;lt;math&amp;gt;u,v,w&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;uv\in E&amp;lt;/math&amp;gt; but &amp;lt;math&amp;gt;uw\not\in E, vw\not\in E&amp;lt;/math&amp;gt;.&lt;br /&gt;
Suppose otherwise. There are two cases.&lt;br /&gt;
* &#039;&#039;&#039;Case.1:&#039;&#039;&#039; &amp;lt;math&amp;gt;d(w)&amp;lt;d(u)&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;d(w)&amp;lt;d(v)&amp;lt;/math&amp;gt;. Without loss of generality, suppose that &amp;lt;math&amp;gt;d(w)&amp;lt;d(u)&amp;lt;/math&amp;gt;. We duplicate &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; by creating a new vertex &amp;lt;math&amp;gt;u&#039;&amp;lt;/math&amp;gt; which has exactly the same neighbors as &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; (but &amp;lt;math&amp;gt;uu&#039;&amp;lt;/math&amp;gt; is not an edge). Such duplication will not increase the clique size. We then remove &amp;lt;math&amp;gt;w&amp;lt;/math&amp;gt;. The resulting graph &amp;lt;math&amp;gt;G&#039;&amp;lt;/math&amp;gt; is still &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;-clique-free, and has &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices. The number of edges in &amp;lt;math&amp;gt;G&#039;&amp;lt;/math&amp;gt; is&lt;br /&gt;
::&amp;lt;math&amp;gt;|E(G&#039;)|=|E(G)|+d(u)-d(w)&amp;gt;|E(G)|\,&amp;lt;/math&amp;gt;,&lt;br /&gt;
:which contradicts the assumption that &amp;lt;math&amp;gt;|E(G)|&amp;lt;/math&amp;gt; is maximal.&lt;br /&gt;
* &#039;&#039;&#039;Case.2:&#039;&#039;&#039; &amp;lt;math&amp;gt;d(w)\ge d(u)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d(w)\ge d(v)&amp;lt;/math&amp;gt;. Duplicate &amp;lt;math&amp;gt;w&amp;lt;/math&amp;gt; twice and delete &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;. The new graph &amp;lt;math&amp;gt;G&#039;&amp;lt;/math&amp;gt; has no &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;-clique, and the number of edges is&lt;br /&gt;
::&amp;lt;math&amp;gt;|E(G&#039;)|=|E(G)|+2d(w)-(d(u)+d(v)+1)&amp;gt;|E(G)|\,&amp;lt;/math&amp;gt;.&lt;br /&gt;
:Contradiction again.&lt;br /&gt;
&lt;br /&gt;
The claim implies that &amp;lt;math&amp;gt;uv\not\in E&amp;lt;/math&amp;gt; defines an equivalence relation on vertices (to be more precise, it guarantees the transitivity of the relation, while the reflexivity and symmetry hold directly). Graph &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; must be a complete multipartite graph &amp;lt;math&amp;gt;K_{n_1,n_2,\ldots,n_{r-1}}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;n_1+n_2+\cdots +n_{r-1}=n&amp;lt;/math&amp;gt;. Optimize the edge number, we have the Turán graph.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Erdős–Stone theorem ===&lt;br /&gt;
&lt;br /&gt;
== Cycle Structures ==&lt;br /&gt;
=== Girth ===&lt;br /&gt;
&lt;br /&gt;
=== Hamiltonian cycle ===&lt;/div&gt;</summary>
		<author><name>172.16.65.101</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Extremal_graphs&amp;diff=3511</id>
		<title>Combinatorics (Fall 2010)/Extremal graphs</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Extremal_graphs&amp;diff=3511"/>
		<updated>2010-10-14T06:37:54Z</updated>

		<summary type="html">&lt;p&gt;172.16.65.101: /* Turán&amp;#039;s theorem */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Extremal Graph Theory ==&lt;br /&gt;
&lt;br /&gt;
=== Mantel&#039;s theorem ===&lt;br /&gt;
We consider a typical extremal problem for graphs: the largest possible number of edges of &#039;&#039;&#039;triangle-free&#039;&#039;&#039; graphs, i.e. graphs contains no &amp;lt;math&amp;gt;K_3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Theorem (Mantel 1907)|&lt;br /&gt;
:Suppose &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt; is graph on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertice without triangles. Then &amp;lt;math&amp;gt;|E|\le\frac{n^2}{4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Prooftitle|First proof. (pigeonhole principle)|&lt;br /&gt;
We prove an equivalent theorem: Any &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;|V|=n&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;|E|&amp;gt;\frac{n^2}{4}&amp;lt;/math&amp;gt; must have a triangle.&lt;br /&gt;
&lt;br /&gt;
Use induction on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;. The theorem holds trivially for &amp;lt;math&amp;gt;n\le 3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Induction hypothesis: assume the theorem hold for &amp;lt;math&amp;gt;|V|\le n-1&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices, without loss of generality, assume that &amp;lt;math&amp;gt;|E|=\frac{n^2}{4}+1&amp;lt;/math&amp;gt;, we will show that &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; must contain a triangle. Take a &amp;lt;math&amp;gt;uv\in E&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt; be the subgraph of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; induced by &amp;lt;math&amp;gt;V\setminus \{u,v\}&amp;lt;/math&amp;gt;. Clearly, &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt; has &amp;lt;math&amp;gt;n-2&amp;lt;/math&amp;gt; vertices.&lt;br /&gt;
:&#039;&#039;&#039;Case.1:&#039;&#039;&#039; If &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt; has &amp;lt;math&amp;gt;&amp;gt;\frac{(n-2)^2}{4}&amp;lt;/math&amp;gt; edges, then by the induction hypothesis, &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt; has a triangle.&lt;br /&gt;
:&#039;&#039;&#039;Case.2:&#039;&#039;&#039; If &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt; has &amp;lt;math&amp;gt;\le\frac{(n-2)^2}{4}&amp;lt;/math&amp;gt; edges, then at least &amp;lt;math&amp;gt;\left(\frac{n^2}{4}+1\right)-\frac{(n-2)^2}{4}-1=n-1&amp;lt;/math&amp;gt; edges are between &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\{u,v\}&amp;lt;/math&amp;gt;. By pigeonhole principle, there must be a vertex in &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt; that is adjacent to both &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;. Thus, &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; has a triangle.&lt;br /&gt;
}} &lt;br /&gt;
&lt;br /&gt;
{{Prooftitle|Second proof. (Cauchy-Schwarz inequality)|(Mantel&#039;s original proof)&lt;br /&gt;
For any edge &amp;lt;math&amp;gt;uv\in E&amp;lt;/math&amp;gt;, no vertex can be a neighbor of both &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;, or otherwise there will be a triangle. Thus, for any edge &amp;lt;math&amp;gt;uv\in E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;d_u+d_v\le n&amp;lt;/math&amp;gt;. It follows that&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{uv\in E}(d_u+d_v)\le n|E|&amp;lt;/math&amp;gt;.&lt;br /&gt;
Note that &amp;lt;math&amp;gt;d(v)&amp;lt;/math&amp;gt; appears exactly &amp;lt;math&amp;gt;d_v&amp;lt;/math&amp;gt; times in the sum, so that&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{uv\in E}(d_u+d_v)=\sum_{v\in V}d_v^2&amp;lt;/math&amp;gt;.&lt;br /&gt;
Applying Chauchy-Schwarz inequality,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
n|E|\ge\sum_{v\in V}d_v^2\ge\frac{\left(\sum_{v\in V}d_v\right)^2}{n}=\frac{4|E|^2}{n},&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
where the last equation is due to Euler&#039;s equality &amp;lt;math&amp;gt;\sum_{v\in V}d_v=2|E|&amp;lt;/math&amp;gt;. The theorem follows.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Prooftitle|Third proof. (inequality of the arithmetic and geometric mean)|&lt;br /&gt;
Assume that &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt; has &amp;lt;math&amp;gt;|V|=n&amp;lt;/math&amp;gt; vertices and is triangle-free.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; be the largest independent set in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; and let &amp;lt;math&amp;gt;\alpha=|A|&amp;lt;/math&amp;gt;. &lt;br /&gt;
Since &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; is triangle-free, for very vertex &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;, all its neighbors must form an independent set, thus &amp;lt;math&amp;gt;d(v)\le \alpha&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Take &amp;lt;math&amp;gt;B=V\setminus A&amp;lt;/math&amp;gt; and let &amp;lt;math&amp;gt;\beta=|B|&amp;lt;/math&amp;gt;.&lt;br /&gt;
Since &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; is an independent set, all edges in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; must have at least one endpoint in &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;. Counting the edges in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; according to their endpoints in &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, we obtain &amp;lt;math&amp;gt;|E|\le\sum_{v\in B}d_v&amp;lt;/math&amp;gt;. By the inequality of the arithmetic and geometric mean,&lt;br /&gt;
:&amp;lt;math&amp;gt;|E|\le\sum_{v\in B}d_v\le\alpha\beta\le\left(\frac{\alpha+\beta}{2}\right)^2=\frac{n^2}{4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Turán&#039;s theorem ===&lt;br /&gt;
{{Theorem|Theorem (Turán 1941)|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt; be a graph with &amp;lt;math&amp;gt;|V|=n&amp;lt;/math&amp;gt;. If &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; has no &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;-clique, &amp;lt;math&amp;gt;k\ge 2&amp;lt;/math&amp;gt;, then&lt;br /&gt;
::&amp;lt;math&amp;gt;|E|\le\frac{r-2}{r-1}\frac{n^2}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Prooftitle|First proof. (induction)|(Turán&#039;s original proof)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Prooftitle|Second proof. (weight shifting)|(due to Motzkin and Straus)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Prooftitle|Third proof. (the probabilistic method)|(due to Alon and Spencer)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Prooftitle|Fourth proof.|&lt;br /&gt;
Let &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt; be a &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;-clique-free graph on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices with a maximum number of edges.&lt;br /&gt;
:&#039;&#039;&#039;Claim:&#039;&#039;&#039; &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; does not contain three vertices &amp;lt;math&amp;gt;u,v,w&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;uv\in E&amp;lt;/math&amp;gt; but &amp;lt;math&amp;gt;uw\not\in E, vw\not\in E&amp;lt;/math&amp;gt;.&lt;br /&gt;
Suppose otherwise. There are two cases.&lt;br /&gt;
* &#039;&#039;&#039;Case.1:&#039;&#039;&#039; &amp;lt;math&amp;gt;d(w)&amp;lt;d(u)&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;d(w)&amp;lt;d(v)&amp;lt;/math&amp;gt;. Without loss of generality, suppose that &amp;lt;math&amp;gt;d(w)&amp;lt;d(u)&amp;lt;/math&amp;gt;. We duplicate &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; by creating a new vertex &amp;lt;math&amp;gt;u&#039;&amp;lt;/math&amp;gt; which has exactly the same neighbors as &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; (but &amp;lt;math&amp;gt;uu&#039;&amp;lt;/math&amp;gt; is not an edge). Such duplication will not increase the clique size. We then remove &amp;lt;math&amp;gt;w&amp;lt;/math&amp;gt;. The resulting graph &amp;lt;math&amp;gt;G&#039;&amp;lt;/math&amp;gt; is still &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;-clique-free, and has &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices. The number of edges in &amp;lt;math&amp;gt;G&#039;&amp;lt;/math&amp;gt; is&lt;br /&gt;
::&amp;lt;math&amp;gt;|E(G&#039;)|=|E(G)|+d(u)-d(w)&amp;gt;|E(G)|\,&amp;lt;/math&amp;gt;,&lt;br /&gt;
:which contradicts the assumption that &amp;lt;math&amp;gt;|E(G)|&amp;lt;/math&amp;gt; is maximal.&lt;br /&gt;
* &#039;&#039;&#039;Case.2:&#039;&#039;&#039; &amp;lt;math&amp;gt;d(w)\ge d(u)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d(w)\ge d(v)&amp;lt;/math&amp;gt;. Duplicate &amp;lt;math&amp;gt;w&amp;lt;/math&amp;gt; twice and delete &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;. The new graph &amp;lt;math&amp;gt;G&#039;&amp;lt;/math&amp;gt; has no &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;-clique, and the number of edges is&lt;br /&gt;
::&amp;lt;math&amp;gt;|E(G&#039;)|=|E(G)|+2d(w)-(d(u)+d(v)+1)&amp;gt;|E(G)|\,&amp;lt;/math&amp;gt;.&lt;br /&gt;
:Contradiction again.&lt;br /&gt;
&lt;br /&gt;
The claim implies that &amp;lt;math&amp;gt;uv\not\in E&amp;lt;/math&amp;gt; defines an equivalence relation on vertices (to be more precise, it guarantees the transitivity of the relation, while the reflexivity and symmetry hold directly). Graph &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; must be a complete multipartite graph &amp;lt;math&amp;gt;K_{n_1,n_2,\ldots,n_{r-1}}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;n_1+n_2+\cdots +n_{r-1}=n&amp;lt;/math&amp;gt;. Optimize the edge number, we have the Turán graph.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Erdős–Stone theorem ===&lt;br /&gt;
&lt;br /&gt;
== Cycle Structures ==&lt;br /&gt;
=== Girth ===&lt;br /&gt;
&lt;br /&gt;
=== Hamiltonian cycle ===&lt;/div&gt;</summary>
		<author><name>172.16.65.101</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Existence,_the_probabilistic_method&amp;diff=3015</id>
		<title>Combinatorics (Fall 2010)/Existence, the probabilistic method</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Existence,_the_probabilistic_method&amp;diff=3015"/>
		<updated>2010-09-13T05:12:41Z</updated>

		<summary type="html">&lt;p&gt;172.16.65.101: /* Sampling */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Counting arguments ==&lt;br /&gt;
;Circuit complexity&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;&#039;boolean function&#039;&#039;&#039; is a function is the form &amp;lt;math&amp;gt;f:\{0,1\}^n\rightarrow \{0,1\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Formally, a boolean circuit is a directed acyclic graph. Nodes with indegree zero are input nodes, labeled &amp;lt;math&amp;gt;x_1, x_2, \ldots , x_n&amp;lt;/math&amp;gt;. A circuit has a unique node with outdegree zero, called the output node. Every other node is a gate. There are three types of gates: AND, OR (both with indegree two), and NOT (with indegree one).&lt;br /&gt;
&lt;br /&gt;
Computations in Turing machines can be simulated by circuits, and any boolean function in &#039;&#039;&#039;P&#039;&#039;&#039; can be computed by a circuit with polynomially many gates. Thus, if we can find a function in &#039;&#039;&#039;NP&#039;&#039;&#039; that cannot be computed by any circuit with polynomially many gates, then &#039;&#039;&#039;NP&#039;&#039;&#039;&amp;lt;math&amp;gt;\neq&amp;lt;/math&amp;gt;&#039;&#039;&#039;P&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The following theorem due to Shannon says that functions with exponentially large circuit complexity do exist.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem (Shannon 1949)|&lt;br /&gt;
:There is a boolean function &amp;lt;math&amp;gt;f:\{0,1\}^n\rightarrow \{0,1\}&amp;lt;/math&amp;gt; with circuit complexity greater than &amp;lt;math&amp;gt;\frac{2^n}{3n}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| &lt;br /&gt;
We first count the number of boolean functions &amp;lt;math&amp;gt;f:\{0,1\}^n\rightarrow \{0,1\}&amp;lt;/math&amp;gt;. There are &amp;lt;math&amp;gt;2^{2^n}&amp;lt;/math&amp;gt; boolean functions &amp;lt;math&amp;gt;f:\{0,1\}^n\rightarrow \{0,1\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then we count the number of boolean circuit with fixed number of gates.&lt;br /&gt;
Fix an integer &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, we count the number of circuits with &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; gates. By the [http://en.wikipedia.org/wiki/De_Morgan&#039;s_laws De Morgan&#039;s laws], we can assume that all NOTs are pushed back to the inputs. Each gate has one of the two types (AND or OR), and has two inputs. Each of the inputs to a gate is either a constant 0 or 1, an input variable &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt;, an inverted input variable &amp;lt;math&amp;gt;\neg x_i&amp;lt;/math&amp;gt;, or the output of another gate; thus, there are at most &amp;lt;math&amp;gt;2+2n+t-1&amp;lt;/math&amp;gt; possible gate inputs. It follows that the number of circuits with &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; gates is at most &amp;lt;math&amp;gt;2^t(t+2n+1)^{2t}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;t=2^n/3n&amp;lt;/math&amp;gt;, then&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{2^t(t+2n+1)^{2t}}{2^{2^n}}=o(1)&amp;lt;1,&amp;lt;/math&amp;gt;      thus, &amp;lt;math&amp;gt;2^t(t+2n+1)^{2t} &amp;lt; 2^{2^n}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each boolean circuit computes one boolean function. Therefore, there must exist a boolean function &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; which cannot be computed by any circuits with &amp;lt;math&amp;gt;2^n/3n&amp;lt;/math&amp;gt; gates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Note that by Shannon&#039;s theorem, not only there exists a boolean function with exponentially large circuit complexity, but &#039;&#039;almost all&#039;&#039; boolean functions have exponentially large circuit complexity.&lt;br /&gt;
&lt;br /&gt;
=== Double counting ===&lt;br /&gt;
;Intersecting families;&lt;br /&gt;
&lt;br /&gt;
An &amp;lt;math&amp;gt;\mathcal{F}\subseteq 2^S&amp;lt;/math&amp;gt; is an &#039;&#039;&#039;intersecting&#039;&#039;&#039; family if for any &amp;lt;math&amp;gt;A,B\in\mathcal{F}&amp;lt;/math&amp;gt; it holds that &amp;lt;math&amp;gt;A\cap B\neq\emptyset&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Suppose that &amp;lt;math&amp;gt;n\ge 2k&amp;lt;/math&amp;gt;. For &amp;lt;math&amp;gt;\mathcal{F}\subseteq{S\choose k}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;|S|=n&amp;lt;/math&amp;gt;, we can let all &amp;lt;math&amp;gt;A\in \mathcal{F}&amp;lt;/math&amp;gt; contain one common element &amp;lt;math&amp;gt;a\in S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;A-\{a\}&amp;lt;/math&amp;gt; enumerates all &amp;lt;math&amp;gt;{n-1\choose k-1}&amp;lt;/math&amp;gt; possible combinations of &amp;lt;math&amp;gt;(k-1)&amp;lt;/math&amp;gt; elements in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. This gives us an intersecting family of size  &amp;lt;math&amp;gt;|\mathcal{F}|={n-1\choose k-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The following theorem says that this is the largest possible cardinality an intersecting &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; can achieve. The theorem was first proved by Erdős, Ko, and Rado in 1938, but published 23 years later. It is a fundamental result in the area of extremal set theory, which studies the maximum (or minimum) possible cardinality of a set system satisfying certain structural assumption. In this example, the structural assumption is intersecting.&lt;br /&gt;
&lt;br /&gt;
Here we present a probabilistic proof by Katona.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem (Erdős-Ko-Rado 1961)|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;\mathcal{F}\subseteq{S\choose k}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;|S|=n&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n\ge 2k&amp;lt;/math&amp;gt;. If &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; is an intersecting family then &amp;lt;math&amp;gt;|\mathcal{F}|\le{n-1\choose k-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| (due to Katona 1972).&lt;br /&gt;
&lt;br /&gt;
Without loss of generality, let &amp;lt;math&amp;gt;S=[n]&amp;lt;/math&amp;gt;.&lt;br /&gt;
For &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;A_i=\{(i+j)\bmod n\mid j\in[k]\}&amp;lt;/math&amp;gt;. Then we make the following claim.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Claim 1:&#039;&#039;&#039; &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; can contain at most &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; many &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
The claim can be easily proved by observing that for any &amp;lt;math&amp;gt;i,j\in[n]&amp;lt;/math&amp;gt; that &amp;lt;math&amp;gt;i&amp;lt;j&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;A_j&amp;lt;/math&amp;gt; are disjoint if &amp;lt;math&amp;gt;j-i&amp;gt;k&amp;lt;/math&amp;gt;, thus in order to make &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; intersecting, all &amp;lt;math&amp;gt;A_i,A_j\in\mathcal{F}&amp;lt;/math&amp;gt; have &amp;lt;math&amp;gt;|i-j|\le k&amp;lt;/math&amp;gt;. This is violated once there are more than &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; many &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now we prove the Erdős-Ko-Rado theorem. Let a permutation &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[n]&amp;lt;/math&amp;gt; and an integer &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt; be chosen uniformly and independently at random. Let &lt;br /&gt;
:&amp;lt;math&amp;gt;R=\{\sigma((i+j)\bmod n)\mid j\in[k]\}, \quad\mbox{ or equivalently }R=\sigma(A_i)&amp;lt;/math&amp;gt;. &lt;br /&gt;
By Claim 1, for any fixed permutation &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, the family &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; can contain at most &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; of the sets &amp;lt;math&amp;gt;\sigma(A_i)&amp;lt;/math&amp;gt;, thus conditioning on any particular &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\Pr[R\in\mathcal{F}\mid \sigma]\le\frac{k}{n}&amp;lt;/math&amp;gt;. Hence &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[R\in\mathcal{F}]\le\frac{k}{n}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
On the other hand, by our construction, &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; is uniformly chosen from &amp;lt;math&amp;gt;{S\choose k}&amp;lt;/math&amp;gt;, thus&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[R\in\mathcal{F}]=\frac{|\mathcal{F}|}{{n\choose k}}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore,&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
|\mathcal{F}|\le\frac{k}{n}{n\choose k}={n-1\choose k-1}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== The averaging principle ===&lt;br /&gt;
&lt;br /&gt;
== The Pigeonhole Principle ==&lt;br /&gt;
&lt;br /&gt;
== The Probabilistic Method ==&lt;br /&gt;
&lt;br /&gt;
Suppose we want prove the existence of mathematic objects with certain properties. One way to do so is to explicitly construct such an object. This kind of proofs can be interpreted as &#039;&#039;deterministic algorithms&#039;&#039; which find the object with desirable properties.&lt;br /&gt;
&lt;br /&gt;
The probabilistic method provides another way of proving the existence of objects: instead of explicitly constructing an object, we define a probability space of objects in which the probability is positive that a randomly selected object has the required property.&lt;br /&gt;
&lt;br /&gt;
The basic principle of the probabilistic method is very simple, and can be stated in intuitive ways:&lt;br /&gt;
*If an object chosen randomly from a universe satisfies a property with positive probability, then there must be an object in the universe that satisfies that property.&lt;br /&gt;
:For example, for a ball(the object) randomly chosen from a box(the universe) of balls, if the probability that the chosen ball is blue(the property) is &amp;gt;0, then there must be a blue ball in the box.&lt;br /&gt;
*Any random variable assumes at least one value that is no smaller than its expectation, and at least one value that is no greater than the expectation.&lt;br /&gt;
:For example, if we know the average height of the students in the class is &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;, then we know there is a students whose height is at least &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;, and there is a student whose height is at most &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Although the idea of  the probabilistic method is simple, it provides us a powerful tool for existential proof. In same cases, the proof itself is a &#039;&#039;randomized algorithm&#039;&#039;, and if we are lucky, the algorithm could be very efficient.&lt;br /&gt;
&lt;br /&gt;
=== Sampling ===&lt;br /&gt;
;Ramsey number&lt;br /&gt;
&lt;br /&gt;
Recall the Ramsey theorem which states that in a meeting of at least six people, there are either three people knowing each other or three people not knowing each other. In graph theoretical terms, this means that no matter how we color the edges of &amp;lt;math&amp;gt;K_6&amp;lt;/math&amp;gt; (the complete graph on six vertices), there must be a &#039;&#039;&#039;monochromatic&#039;&#039;&#039; &amp;lt;math&amp;gt;K_3&amp;lt;/math&amp;gt; (a triangle whose edges have the same color).&lt;br /&gt;
&lt;br /&gt;
Generally, the &#039;&#039;&#039;Ramsey number&#039;&#039;&#039; &amp;lt;math&amp;gt;R(k,\ell)&amp;lt;/math&amp;gt; is the smallest integer &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; such that in any two-coloring of the edges of a complete graph on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; by red and blue, either there is a red &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; or there is a blue &amp;lt;math&amp;gt;K_\ell&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Ramsey showed in 1929 that &amp;lt;math&amp;gt;R(k,\ell)&amp;lt;/math&amp;gt; is finite for any &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;. It is extremely hard to compute the exact value of &amp;lt;math&amp;gt;R(k,\ell)&amp;lt;/math&amp;gt;. Here we give a lower bound of &amp;lt;math&amp;gt;R(k,k)&amp;lt;/math&amp;gt; by the probabilistic method.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem (Erdős 1947)|&lt;br /&gt;
:If &amp;lt;math&amp;gt;{n\choose k}\cdot 2^{1-{k\choose 2}}&amp;lt;1&amp;lt;/math&amp;gt; then it is possible to color the edges of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; with two colors so that there is no monochromatic &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; subgraph.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| Consider a random two-coloring of edges of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; obtained as follows:&lt;br /&gt;
* For each edge of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt;, independently flip a fair coin to decide the color of the edge.&lt;br /&gt;
&lt;br /&gt;
For any fixed set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; vertices, let &amp;lt;math&amp;gt;\mathcal{E}_S&amp;lt;/math&amp;gt; be the event that the &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; subgraph induced by &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is monochromatic. There are &amp;lt;math&amp;gt;{k\choose 2}&amp;lt;/math&amp;gt; many edges in &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt;, therefore&lt;br /&gt;
:&amp;lt;math&amp;gt;\Pr[\mathcal{E}_S]=2\cdot 2^{-{k\choose 2}}=2^{1-{k\choose 2}}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since there are &amp;lt;math&amp;gt;{n\choose k}&amp;lt;/math&amp;gt; possible choices of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;, by the union bound&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[\exists S, \mathcal{E}_S]\le {n\choose k}\cdot\Pr[\mathcal{E}_S]={n\choose k}\cdot 2^{1-{k\choose 2}}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Due to the assumption, &amp;lt;math&amp;gt;{n\choose k}\cdot 2^{1-{k\choose 2}}&amp;lt;1&amp;lt;/math&amp;gt;, thus there exists a two coloring that none of &amp;lt;math&amp;gt;\mathcal{E}_S&amp;lt;/math&amp;gt; occurs, which means  there is no monochromatic &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; subgraph.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;k\ge 3&amp;lt;/math&amp;gt; and we take &amp;lt;math&amp;gt;n=\lfloor2^{k/2}\rfloor&amp;lt;/math&amp;gt;, then&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
{n\choose k}\cdot 2^{1-{k\choose 2}}&lt;br /&gt;
&amp;amp;&amp;lt;&lt;br /&gt;
\frac{n^k}{k!}\cdot\frac{2^{1+\frac{k}{2}}}{2^{k^2/2}}\\&lt;br /&gt;
&amp;amp;\le &lt;br /&gt;
\frac{2^{k^2/2}}{k!}\cdot\frac{2^{1+\frac{k}{2}}}{2^{k^2/2}}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\frac{2^{1+\frac{k}{2}}}{k!}\\&lt;br /&gt;
&amp;amp;&amp;lt;1.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
By the above theorem, there exists a two-coloring of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; that there is no monochromatic &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt;. Therefore, the Ramsey number &amp;lt;math&amp;gt;R(k,k)&amp;gt;\lfloor2^{k/2}\rfloor&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;k\ge 3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that for sufficiently large &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n= \lfloor 2^{k/2}\rfloor&amp;lt;/math&amp;gt;, then the probability that there exists a monochromatic &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; is bounded by&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
{n\choose k}\cdot 2^{1-{k\choose 2}}&lt;br /&gt;
&amp;lt;&lt;br /&gt;
\frac{2^{1+\frac{k}{2}}}{k!}&lt;br /&gt;
\ll 1,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
which means that a random two-coloring of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; is very likely not to contain a monochromatic  &amp;lt;math&amp;gt;K_{2\log n}&amp;lt;/math&amp;gt;. This gives us a very simple randomized algorithm for finding a two-coloring of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; without monochromatic &amp;lt;math&amp;gt;K_{2\log n}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Linearity of expectation ===&lt;br /&gt;
&lt;br /&gt;
;Maximum cut&lt;br /&gt;
&lt;br /&gt;
Given an undirected graph &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt;, a set &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; of edges of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; is called a &#039;&#039;&#039;cut&#039;&#039;&#039; if &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; is disconnected after removing the edges in &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;. We can represent a cut by &amp;lt;math&amp;gt;c(S,T)&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;(S,T)&amp;lt;/math&amp;gt; is a bipartition of the vertex set &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;c(S,T)=\{uv\in E\mid u\in S,v\in T\}&amp;lt;/math&amp;gt; is the set of edges crossing between &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We have seen how to compute min-cut: either by deterministic max-flow algorithm, or by Karger&#039;s randomized algorithm. On the other hand, max-cut is hard to compute, because it is &#039;&#039;&#039;NP-complete&#039;&#039;&#039;. Actually, the weighted version of max-cut is among the [http://en.wikipedia.org/wiki/Karp&#039;s_21_NP-complete_problems Karp&#039;s 21 NP-complete problems].&lt;br /&gt;
&lt;br /&gt;
We now show by the probabilistic method that a max-cut always has at least half the edges.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem|&lt;br /&gt;
:Given an undirected graph &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices and &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; edges, there is a cut of size at least &amp;lt;math&amp;gt;\frac{m}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| Enumerate the vertices in an arbitrary order. Partition the vertex set &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; into two disjoint sets &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; as follows.&lt;br /&gt;
:For each vertex &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;,&lt;br /&gt;
:* independently choose one of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; with equal probability, and let &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; join the chosen set.&lt;br /&gt;
&lt;br /&gt;
For each vertex &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;X_v\in\{S,T\}&amp;lt;/math&amp;gt; be the random variable which represents the set that &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; joins. For each edge &amp;lt;math&amp;gt;uv\in E&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;Y_{uv}&amp;lt;/math&amp;gt; be the 0-1 random variable which indicates whether &amp;lt;math&amp;gt;uv&amp;lt;/math&amp;gt; crosses between &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. Clearly,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[Y_{uv}=1]=\Pr[X_u\neq X_v]=\frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The size of &amp;lt;math&amp;gt;c(S,T)&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;Y=\sum_{uv\in E}Y_{uv}&amp;lt;/math&amp;gt;. By the linearity of expectation,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[Y]=\sum_{uv\in E}\mathbf{E}[Y_{uv}]=\sum_{uv\in E}\Pr[Y_{uv}=1]=\frac{m}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore, there exist a bipartition &amp;lt;math&amp;gt;(S,T)&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;|c(S,T)|\ge\frac{m}{2}&amp;lt;/math&amp;gt;, i.e. there exists a cut of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; which contains at least &amp;lt;math&amp;gt;\frac{m}{2}&amp;lt;/math&amp;gt; edges.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Maximum satisfiability&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a number of boolean variables &amp;lt;math&amp;gt;x_1,x_2,\ldots,\in\{\mathrm{true},\mathrm{false}\}&amp;lt;/math&amp;gt;. A &#039;&#039;&#039;literal&#039;&#039;&#039; is either a variable &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; itself or its negation &amp;lt;math&amp;gt;\neg x_i&amp;lt;/math&amp;gt;. A logic expression is a &#039;&#039;&#039;conjunctive normal form (CNF)&#039;&#039;&#039; if it is written as the conjunction(AND) of a set of &#039;&#039;&#039;clauses&#039;&#039;&#039;, where each clause is a disjunction(OR) of literals. For example:&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
(x_1\vee \neg x_2 \vee \neg x_3)\wedge (\neg x_1\vee \neg x_3)\wedge (x_1\vee x_2\vee x_4)\wedge (x_4\vee \neg x_3)\wedge (x_4\vee \neg x_1).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The satisfiability (SAT) problem ask whether the CNF is satisfiable, i.e. there exists an assignment of variables to the values of true and false so that all clauses are true. The maximum satisfiability (MAXSAT) is the optimization version of SAT, which ask for an assignment that the number of satisfied clauses is maximized.&lt;br /&gt;
&lt;br /&gt;
SAT is the first problem known to be &#039;&#039;&#039;NP-complete&#039;&#039;&#039; (the Cook-Levin theorem). MAXSAT is also &#039;&#039;&#039;NP-complete&#039;&#039;&#039;. We then see that there always exists a roughly good truth assignment which satisfies half the clauses.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem|&lt;br /&gt;
:For any set of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; clauses, there is a truth assignment that satisfies at least &amp;lt;math&amp;gt;\frac{m}{2}&amp;lt;/math&amp;gt; clauses.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| For each variable, independently assign a random value in &amp;lt;math&amp;gt;\{\mathrm{true},\mathrm{false}\}&amp;lt;/math&amp;gt; with equal probability. For the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;th clause, let &amp;lt;math&amp;gt;X_i&amp;lt;/math&amp;gt; be the random variable which indicates whether the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;th clause is satisfied. Suppose that there are &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; literals in the clause. The probability that the clause is satisfied is &lt;br /&gt;
:&amp;lt;math&amp;gt;\Pr[X_k=1]\ge(1-2^{-k})\ge\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;X=\sum_{i=1}^m X_i&amp;lt;/math&amp;gt; be the number of satisfied clauses. By the linearity of expectation,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[X]=\sum_{i=1}^{m}\mathbf{E}[X_i]\ge \frac{m}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore, there exists an assignment such that at least &amp;lt;math&amp;gt;\frac{m}{2}&amp;lt;/math&amp;gt; clauses are satisfied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Alterations ===&lt;br /&gt;
;Independent sets&lt;br /&gt;
An independent set of a graph is a set of vertices with no edges between them. The following theorem gives a lower bound on the size of the largest independent set.&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt; be a graph on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices with &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; edges. Then &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; has an independent set with at least &amp;lt;math&amp;gt;\frac{n^2}{4m}&amp;lt;/math&amp;gt; vertices.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| Let &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; be a set of vertices constructed as follows:&lt;br /&gt;
:For each vertex &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;:&lt;br /&gt;
:* &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is included in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; independently with probability &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;,&lt;br /&gt;
&amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; to be determined.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;X=|S|&amp;lt;/math&amp;gt;. It is obvious that &amp;lt;math&amp;gt;\mathbf{E}[X]=np&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each edge &amp;lt;math&amp;gt;e\in E&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;Y_{e}&amp;lt;/math&amp;gt; be the random variable which indicates whether both endpoints of &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; are in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[Y_{uv}]=\Pr[u\in S\wedge v\in S]=p^2.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Let &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; be the number of edges in the subgraph of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; induced by &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. It holds that &amp;lt;math&amp;gt;Y=\sum_{e\in E}Y_e&amp;lt;/math&amp;gt;. By linearity of expectation,&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{E}[Y]=\sum_{e\in E}\mathbf{E}[Y_e]=mp^2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that although &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is not necessary an independent set, it can be modified to one if for each edge &amp;lt;math&amp;gt;e&amp;lt;/math&amp;gt; of the induced subgraph &amp;lt;math&amp;gt;G(S)&amp;lt;/math&amp;gt;, we delete one of the endpoint of &amp;lt;math&amp;gt;e&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt; be the resulting set. It is obvious that &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt; is an independent set since there is no edge left in the induced subgraph &amp;lt;math&amp;gt;G(S^*)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Since there are &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; edges in &amp;lt;math&amp;gt;G(S)&amp;lt;/math&amp;gt;, there are at most &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; vertices in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; are deleted to make it become &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt;. Therefore, &amp;lt;math&amp;gt;|S^*|\ge X-Y&amp;lt;/math&amp;gt;. By linearity of expectation,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[|S^*|]\ge\mathbf{E}[X-Y]=\mathbf{E}[X]-\mathbf{E}[Y]=np-mp^2.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
The expectation is maximized when &amp;lt;math&amp;gt;p=\frac{n}{2m}&amp;lt;/math&amp;gt;, thus&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[|S^*|]\ge n\cdot\frac{n}{2m}-m\left(\frac{n}{2m}\right)^2=\frac{n^2}{4m}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
There exists an independent set which contains at least &amp;lt;math&amp;gt;\frac{n^2}{4m}&amp;lt;/math&amp;gt; vertices.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The proof actually propose a randomized algorithm for constructing large independent set:&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Algorithm|&lt;br /&gt;
Given a graph on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices with &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; edges, let &amp;lt;math&amp;gt;d=\frac{2m}{n}&amp;lt;/math&amp;gt; be the average degree.&lt;br /&gt;
#For each vertex &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is included in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; independently with probability &amp;lt;math&amp;gt;\frac{1}{d}&amp;lt;/math&amp;gt;.&lt;br /&gt;
#For each remaining edge in the induced subgraph &amp;lt;math&amp;gt;G(S)&amp;lt;/math&amp;gt;, remove one of the endpoints from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt; be the resulting set. We have shown that &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt; is an independent set and &amp;lt;math&amp;gt;\mathbf{E}[|S^*|]\ge\frac{n^2}{4m}&amp;lt;/math&amp;gt;.&lt;/div&gt;</summary>
		<author><name>172.16.65.101</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Existence,_the_probabilistic_method&amp;diff=3014</id>
		<title>Combinatorics (Fall 2010)/Existence, the probabilistic method</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Existence,_the_probabilistic_method&amp;diff=3014"/>
		<updated>2010-09-13T05:11:08Z</updated>

		<summary type="html">&lt;p&gt;172.16.65.101: /* The Lovász Local Lemma */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Counting arguments ==&lt;br /&gt;
;Circuit complexity&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;&#039;boolean function&#039;&#039;&#039; is a function is the form &amp;lt;math&amp;gt;f:\{0,1\}^n\rightarrow \{0,1\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Formally, a boolean circuit is a directed acyclic graph. Nodes with indegree zero are input nodes, labeled &amp;lt;math&amp;gt;x_1, x_2, \ldots , x_n&amp;lt;/math&amp;gt;. A circuit has a unique node with outdegree zero, called the output node. Every other node is a gate. There are three types of gates: AND, OR (both with indegree two), and NOT (with indegree one).&lt;br /&gt;
&lt;br /&gt;
Computations in Turing machines can be simulated by circuits, and any boolean function in &#039;&#039;&#039;P&#039;&#039;&#039; can be computed by a circuit with polynomially many gates. Thus, if we can find a function in &#039;&#039;&#039;NP&#039;&#039;&#039; that cannot be computed by any circuit with polynomially many gates, then &#039;&#039;&#039;NP&#039;&#039;&#039;&amp;lt;math&amp;gt;\neq&amp;lt;/math&amp;gt;&#039;&#039;&#039;P&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The following theorem due to Shannon says that functions with exponentially large circuit complexity do exist.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem (Shannon 1949)|&lt;br /&gt;
:There is a boolean function &amp;lt;math&amp;gt;f:\{0,1\}^n\rightarrow \{0,1\}&amp;lt;/math&amp;gt; with circuit complexity greater than &amp;lt;math&amp;gt;\frac{2^n}{3n}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| &lt;br /&gt;
We first count the number of boolean functions &amp;lt;math&amp;gt;f:\{0,1\}^n\rightarrow \{0,1\}&amp;lt;/math&amp;gt;. There are &amp;lt;math&amp;gt;2^{2^n}&amp;lt;/math&amp;gt; boolean functions &amp;lt;math&amp;gt;f:\{0,1\}^n\rightarrow \{0,1\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then we count the number of boolean circuit with fixed number of gates.&lt;br /&gt;
Fix an integer &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, we count the number of circuits with &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; gates. By the [http://en.wikipedia.org/wiki/De_Morgan&#039;s_laws De Morgan&#039;s laws], we can assume that all NOTs are pushed back to the inputs. Each gate has one of the two types (AND or OR), and has two inputs. Each of the inputs to a gate is either a constant 0 or 1, an input variable &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt;, an inverted input variable &amp;lt;math&amp;gt;\neg x_i&amp;lt;/math&amp;gt;, or the output of another gate; thus, there are at most &amp;lt;math&amp;gt;2+2n+t-1&amp;lt;/math&amp;gt; possible gate inputs. It follows that the number of circuits with &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; gates is at most &amp;lt;math&amp;gt;2^t(t+2n+1)^{2t}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;t=2^n/3n&amp;lt;/math&amp;gt;, then&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{2^t(t+2n+1)^{2t}}{2^{2^n}}=o(1)&amp;lt;1,&amp;lt;/math&amp;gt;      thus, &amp;lt;math&amp;gt;2^t(t+2n+1)^{2t} &amp;lt; 2^{2^n}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each boolean circuit computes one boolean function. Therefore, there must exist a boolean function &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; which cannot be computed by any circuits with &amp;lt;math&amp;gt;2^n/3n&amp;lt;/math&amp;gt; gates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Note that by Shannon&#039;s theorem, not only there exists a boolean function with exponentially large circuit complexity, but &#039;&#039;almost all&#039;&#039; boolean functions have exponentially large circuit complexity.&lt;br /&gt;
&lt;br /&gt;
=== Double counting ===&lt;br /&gt;
;Intersecting families;&lt;br /&gt;
&lt;br /&gt;
An &amp;lt;math&amp;gt;\mathcal{F}\subseteq 2^S&amp;lt;/math&amp;gt; is an &#039;&#039;&#039;intersecting&#039;&#039;&#039; family if for any &amp;lt;math&amp;gt;A,B\in\mathcal{F}&amp;lt;/math&amp;gt; it holds that &amp;lt;math&amp;gt;A\cap B\neq\emptyset&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Suppose that &amp;lt;math&amp;gt;n\ge 2k&amp;lt;/math&amp;gt;. For &amp;lt;math&amp;gt;\mathcal{F}\subseteq{S\choose k}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;|S|=n&amp;lt;/math&amp;gt;, we can let all &amp;lt;math&amp;gt;A\in \mathcal{F}&amp;lt;/math&amp;gt; contain one common element &amp;lt;math&amp;gt;a\in S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;A-\{a\}&amp;lt;/math&amp;gt; enumerates all &amp;lt;math&amp;gt;{n-1\choose k-1}&amp;lt;/math&amp;gt; possible combinations of &amp;lt;math&amp;gt;(k-1)&amp;lt;/math&amp;gt; elements in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. This gives us an intersecting family of size  &amp;lt;math&amp;gt;|\mathcal{F}|={n-1\choose k-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The following theorem says that this is the largest possible cardinality an intersecting &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; can achieve. The theorem was first proved by Erdős, Ko, and Rado in 1938, but published 23 years later. It is a fundamental result in the area of extremal set theory, which studies the maximum (or minimum) possible cardinality of a set system satisfying certain structural assumption. In this example, the structural assumption is intersecting.&lt;br /&gt;
&lt;br /&gt;
Here we present a probabilistic proof by Katona.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem (Erdős-Ko-Rado 1961)|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;\mathcal{F}\subseteq{S\choose k}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;|S|=n&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n\ge 2k&amp;lt;/math&amp;gt;. If &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; is an intersecting family then &amp;lt;math&amp;gt;|\mathcal{F}|\le{n-1\choose k-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| (due to Katona 1972).&lt;br /&gt;
&lt;br /&gt;
Without loss of generality, let &amp;lt;math&amp;gt;S=[n]&amp;lt;/math&amp;gt;.&lt;br /&gt;
For &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;A_i=\{(i+j)\bmod n\mid j\in[k]\}&amp;lt;/math&amp;gt;. Then we make the following claim.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Claim 1:&#039;&#039;&#039; &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; can contain at most &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; many &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
The claim can be easily proved by observing that for any &amp;lt;math&amp;gt;i,j\in[n]&amp;lt;/math&amp;gt; that &amp;lt;math&amp;gt;i&amp;lt;j&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;A_j&amp;lt;/math&amp;gt; are disjoint if &amp;lt;math&amp;gt;j-i&amp;gt;k&amp;lt;/math&amp;gt;, thus in order to make &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; intersecting, all &amp;lt;math&amp;gt;A_i,A_j\in\mathcal{F}&amp;lt;/math&amp;gt; have &amp;lt;math&amp;gt;|i-j|\le k&amp;lt;/math&amp;gt;. This is violated once there are more than &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; many &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now we prove the Erdős-Ko-Rado theorem. Let a permutation &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[n]&amp;lt;/math&amp;gt; and an integer &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt; be chosen uniformly and independently at random. Let &lt;br /&gt;
:&amp;lt;math&amp;gt;R=\{\sigma((i+j)\bmod n)\mid j\in[k]\}, \quad\mbox{ or equivalently }R=\sigma(A_i)&amp;lt;/math&amp;gt;. &lt;br /&gt;
By Claim 1, for any fixed permutation &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, the family &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; can contain at most &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; of the sets &amp;lt;math&amp;gt;\sigma(A_i)&amp;lt;/math&amp;gt;, thus conditioning on any particular &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\Pr[R\in\mathcal{F}\mid \sigma]\le\frac{k}{n}&amp;lt;/math&amp;gt;. Hence &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[R\in\mathcal{F}]\le\frac{k}{n}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
On the other hand, by our construction, &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; is uniformly chosen from &amp;lt;math&amp;gt;{S\choose k}&amp;lt;/math&amp;gt;, thus&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[R\in\mathcal{F}]=\frac{|\mathcal{F}|}{{n\choose k}}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore,&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
|\mathcal{F}|\le\frac{k}{n}{n\choose k}={n-1\choose k-1}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== The averaging principle ===&lt;br /&gt;
&lt;br /&gt;
== The Pigeonhole Principle ==&lt;br /&gt;
&lt;br /&gt;
== The Probabilistic Method ==&lt;br /&gt;
&lt;br /&gt;
Suppose we want prove the existence of mathematic objects with certain properties. One way to do so is to explicitly construct such an object. This kind of proofs can be interpreted as &#039;&#039;deterministic algorithms&#039;&#039; which find the object with desirable properties.&lt;br /&gt;
&lt;br /&gt;
The probabilistic method provides another way of proving the existence of objects: instead of explicitly constructing an object, we define a probability space of objects in which the probability is positive that a randomly selected object has the required property.&lt;br /&gt;
&lt;br /&gt;
The basic principle of the probabilistic method is very simple, and can be stated in intuitive ways:&lt;br /&gt;
*If an object chosen randomly from a universe satisfies a property with positive probability, then there must be an object in the universe that satisfies that property.&lt;br /&gt;
:For example, for a ball(the object) randomly chosen from a box(the universe) of balls, if the probability that the chosen ball is blue(the property) is &amp;gt;0, then there must be a blue ball in the box.&lt;br /&gt;
*Any random variable assumes at least one value that is no smaller than its expectation, and at least one value that is no greater than the expectation.&lt;br /&gt;
:For example, if we know the average height of the students in the class is &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;, then we know there is a students whose height is at least &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;, and there is a student whose height is at most &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Although the idea of  the probabilistic method is simple, it provides us a powerful tool for existential proof. In same cases, the proof itself is a &#039;&#039;randomized algorithm&#039;&#039;, and if we are lucky, the algorithm could be very efficient.&lt;br /&gt;
&lt;br /&gt;
=== Sampling ===&lt;br /&gt;
;Ramsey number&lt;br /&gt;
&lt;br /&gt;
Recall the Ramsey theorem which states that in a meeting of at least six people, there are either three people knowing each other or three people not knowing each other. In graph theoretical terms, this means that no matter how we color the edges of &amp;lt;math&amp;gt;K_6&amp;lt;/math&amp;gt; (the complete graph on six vertices), there must be a &#039;&#039;&#039;monochromatic&#039;&#039;&#039; &amp;lt;math&amp;gt;K_3&amp;lt;/math&amp;gt; (a triangle whose edges have the same color).&lt;br /&gt;
&lt;br /&gt;
Generally, the &#039;&#039;&#039;Ramsey number&#039;&#039;&#039; &amp;lt;math&amp;gt;R(k,\ell)&amp;lt;/math&amp;gt; is the smallest integer &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; such that in any two-coloring of the edges of a complete graph on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; by red and blue, either there is a red &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; or there is a blue &amp;lt;math&amp;gt;K_\ell&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Ramsey showed in 1929 that &amp;lt;math&amp;gt;R(k,\ell)&amp;lt;/math&amp;gt; is finite for any &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;. It is extremely hard to compute the exact value of &amp;lt;math&amp;gt;R(k,\ell)&amp;lt;/math&amp;gt;. Here we give a lower bound of &amp;lt;math&amp;gt;R(k,k)&amp;lt;/math&amp;gt; by the probabilistic method.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem (Erdős 1947)|&lt;br /&gt;
:If &amp;lt;math&amp;gt;{n\choose k}\cdot 2^{1-{k\choose 2}}&amp;lt;1&amp;lt;/math&amp;gt; then it is possible to color the edges of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; with two colors so that there is no monochromatic &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; subgraph.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| Consider a random two-coloring of edges of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; obtained as follows:&lt;br /&gt;
* For each edge of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt;, independently flip a fair coin to decide the color of the edge.&lt;br /&gt;
&lt;br /&gt;
For any fixed set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; vertices, let &amp;lt;math&amp;gt;\mathcal{E}_S&amp;lt;/math&amp;gt; be the event that the &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; subgraph induced by &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is monochromatic. There are &amp;lt;math&amp;gt;{k\choose 2}&amp;lt;/math&amp;gt; many edges in &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt;, therefore&lt;br /&gt;
:&amp;lt;math&amp;gt;\Pr[\mathcal{E}_S]=2\cdot 2^{-{k\choose 2}}=2^{1-{k\choose 2}}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since there are &amp;lt;math&amp;gt;{n\choose k}&amp;lt;/math&amp;gt; possible choices of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;, by the union bound&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[\exists S, \mathcal{E}_S]\le {n\choose k}\cdot\Pr[\mathcal{E}_S]={n\choose k}\cdot 2^{1-{k\choose 2}}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Due to the assumption, &amp;lt;math&amp;gt;{n\choose k}\cdot 2^{1-{k\choose 2}}&amp;lt;1&amp;lt;/math&amp;gt;, thus there exists a two coloring that none of &amp;lt;math&amp;gt;\mathcal{E}_S&amp;lt;/math&amp;gt; occurs, which means  there is no monochromatic &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; subgraph.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;k\ge 3&amp;lt;/math&amp;gt; and we take &amp;lt;math&amp;gt;n=\lfloor2^{k/2}\rfloor&amp;lt;/math&amp;gt;, then&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
{n\choose k}\cdot 2^{1-{k\choose 2}}&lt;br /&gt;
&amp;amp;&amp;lt;&lt;br /&gt;
\frac{n^k}{k!}\cdot\frac{2^{1+\frac{k}{2}}}{2^{k^2/2}}\\&lt;br /&gt;
&amp;amp;\le &lt;br /&gt;
\frac{2^{k^2/2}}{k!}\cdot\frac{2^{1+\frac{k}{2}}}{2^{k^2/2}}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\frac{2^{1+\frac{k}{2}}}{k!}\\&lt;br /&gt;
&amp;amp;&amp;lt;1.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
By the above theorem, there exists a two-coloring of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; that there is no monochromatic &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt;. Therefore, the Ramsey number &amp;lt;math&amp;gt;R(k,k)&amp;gt;\lfloor2^{k/2}\rfloor&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;k\ge 3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that for sufficiently large &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n= \lfloor 2^{k/2}\rfloor&amp;lt;/math&amp;gt;, then the probability that there exists a monochromatic &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; is bounded by&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
{n\choose k}\cdot 2^{1-{k\choose 2}}&lt;br /&gt;
&amp;lt;&lt;br /&gt;
\frac{2^{1+\frac{k}{2}}}{k!}&lt;br /&gt;
\ll 1,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
which means that a random two-coloring of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; is very likely not to contain a monochromatic  &amp;lt;math&amp;gt;K_{2\log n}&amp;lt;/math&amp;gt;. This gives us a very simple randomized algorithm for finding a two-coloring of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; without monochromatic &amp;lt;math&amp;gt;K_{2\log n}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Blocking number&lt;br /&gt;
Let &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; be a set. Let &amp;lt;math&amp;gt;2^{S}=\{A\mid A\subseteq S\}&amp;lt;/math&amp;gt; be the power set of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;{S\choose k}=\{A\mid A\subseteq S\mbox{ and }|A|=k\}&amp;lt;/math&amp;gt; be the &#039;&#039;&#039;&amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-uniform&#039;&#039;&#039; of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
We call &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; a &#039;&#039;&#039;set family&#039;&#039;&#039; (or a &#039;&#039;&#039;set system&#039;&#039;&#039;)  with &#039;&#039;&#039;ground set&#039;&#039;&#039; &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; if &amp;lt;math&amp;gt;\mathcal{F}\subseteq 2^{S}&amp;lt;/math&amp;gt;. The members of &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; are subsets of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Given a set family &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; with ground set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;,&lt;br /&gt;
a set &amp;lt;math&amp;gt;T\subseteq S&amp;lt;/math&amp;gt; is a &#039;&#039;&#039;blocking set&#039;&#039;&#039; of &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; if all &amp;lt;math&amp;gt;A\in\mathcal{F}&amp;lt;/math&amp;gt; have &amp;lt;math&amp;gt;A\cap T\neq \emptyset&amp;lt;/math&amp;gt;, i.e. &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; intersects (blocks) all member set of &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem|&lt;br /&gt;
:Given a set family &amp;lt;math&amp;gt;\mathcal{F}\subseteq{S\choose k}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;m=|\mathcal{F}|&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n=|S|&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; has a blocking set of size &amp;lt;math&amp;gt;\left\lceil\frac{n\ln m}{k}\right\rceil&amp;lt;/math&amp;gt;. &lt;br /&gt;
}}&lt;br /&gt;
{{Proof| Let &amp;lt;math&amp;gt;\tau=\left\lceil\frac{n\ln m}{k}\right\rceil&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; be a set chosen uniformly at random from &amp;lt;math&amp;gt;{S\choose \tau}&amp;lt;/math&amp;gt;. We show that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is a blocking set of &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; with a probability &amp;gt;0.&lt;br /&gt;
&lt;br /&gt;
Fix any &amp;lt;math&amp;gt;A\in\mathcal{F}&amp;lt;/math&amp;gt;. Recall that &amp;lt;math&amp;gt;\mathcal{F}\subseteq{S\choose k}&amp;lt;/math&amp;gt;, thus &amp;lt;math&amp;gt;|A|=k&amp;lt;/math&amp;gt;. And&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Pr[A\cap T=\emptyset]&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\frac{\left|{S-A\choose \tau}\right|}{\left|{S\choose \tau}\right|}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\frac{{n-k\choose \tau}}{{n\choose\tau}}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\frac{(n-k)\cdot(n-k-1)\cdots(n-k-\tau+1)}{n\cdot(n-1)\cdots(n-\tau+1)}\\&lt;br /&gt;
&amp;amp;&amp;lt;&lt;br /&gt;
\left(1-\frac{k}{n}\right)^{\tau}\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\exp\left(-\frac{k\tau}{n}\right)\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\frac{1}{m}.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
By the union bound, the probability that there exists an &amp;lt;math&amp;gt;A\in\mathcal{F}&amp;lt;/math&amp;gt; that misses &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[\exists A\in\mathcal{F}, A\cap T=\emptyset]\le m\Pr[A\cap T=\emptyset]&amp;lt;m\cdot\frac{1}{m}=1.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Thus, the probability that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is a blocking set&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[\forall A\in\mathcal{F}, A\cap T\neq\emptyset]&amp;gt;0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
There exists a blocking set of size &amp;lt;math&amp;gt;\tau=\left\lceil\frac{n\ln m}{k}\right\rceil&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The theorem also hints us to a randomized algorithm. In order to make the algorithm efficient, we relax the size of &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\tau=\frac{2n\ln m}{k}&amp;lt;/math&amp;gt;. Uniformly choose &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; elements from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; to form the set &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, by the above analysis, the probability that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is NOT a blocking set is at most&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
m\exp\left(-\frac{n\tau}{k}\right)=m\exp(-2\ln m)=\frac{1}{m}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Thus, a blocking set is found with high probability.&lt;br /&gt;
&lt;br /&gt;
=== Linearity of expectation ===&lt;br /&gt;
&lt;br /&gt;
;Maximum cut&lt;br /&gt;
&lt;br /&gt;
Given an undirected graph &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt;, a set &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; of edges of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; is called a &#039;&#039;&#039;cut&#039;&#039;&#039; if &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; is disconnected after removing the edges in &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;. We can represent a cut by &amp;lt;math&amp;gt;c(S,T)&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;(S,T)&amp;lt;/math&amp;gt; is a bipartition of the vertex set &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;c(S,T)=\{uv\in E\mid u\in S,v\in T\}&amp;lt;/math&amp;gt; is the set of edges crossing between &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We have seen how to compute min-cut: either by deterministic max-flow algorithm, or by Karger&#039;s randomized algorithm. On the other hand, max-cut is hard to compute, because it is &#039;&#039;&#039;NP-complete&#039;&#039;&#039;. Actually, the weighted version of max-cut is among the [http://en.wikipedia.org/wiki/Karp&#039;s_21_NP-complete_problems Karp&#039;s 21 NP-complete problems].&lt;br /&gt;
&lt;br /&gt;
We now show by the probabilistic method that a max-cut always has at least half the edges.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem|&lt;br /&gt;
:Given an undirected graph &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices and &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; edges, there is a cut of size at least &amp;lt;math&amp;gt;\frac{m}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| Enumerate the vertices in an arbitrary order. Partition the vertex set &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; into two disjoint sets &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; as follows.&lt;br /&gt;
:For each vertex &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;,&lt;br /&gt;
:* independently choose one of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; with equal probability, and let &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; join the chosen set.&lt;br /&gt;
&lt;br /&gt;
For each vertex &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;X_v\in\{S,T\}&amp;lt;/math&amp;gt; be the random variable which represents the set that &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; joins. For each edge &amp;lt;math&amp;gt;uv\in E&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;Y_{uv}&amp;lt;/math&amp;gt; be the 0-1 random variable which indicates whether &amp;lt;math&amp;gt;uv&amp;lt;/math&amp;gt; crosses between &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. Clearly,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[Y_{uv}=1]=\Pr[X_u\neq X_v]=\frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The size of &amp;lt;math&amp;gt;c(S,T)&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;Y=\sum_{uv\in E}Y_{uv}&amp;lt;/math&amp;gt;. By the linearity of expectation,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[Y]=\sum_{uv\in E}\mathbf{E}[Y_{uv}]=\sum_{uv\in E}\Pr[Y_{uv}=1]=\frac{m}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore, there exist a bipartition &amp;lt;math&amp;gt;(S,T)&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;|c(S,T)|\ge\frac{m}{2}&amp;lt;/math&amp;gt;, i.e. there exists a cut of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; which contains at least &amp;lt;math&amp;gt;\frac{m}{2}&amp;lt;/math&amp;gt; edges.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Maximum satisfiability&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a number of boolean variables &amp;lt;math&amp;gt;x_1,x_2,\ldots,\in\{\mathrm{true},\mathrm{false}\}&amp;lt;/math&amp;gt;. A &#039;&#039;&#039;literal&#039;&#039;&#039; is either a variable &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; itself or its negation &amp;lt;math&amp;gt;\neg x_i&amp;lt;/math&amp;gt;. A logic expression is a &#039;&#039;&#039;conjunctive normal form (CNF)&#039;&#039;&#039; if it is written as the conjunction(AND) of a set of &#039;&#039;&#039;clauses&#039;&#039;&#039;, where each clause is a disjunction(OR) of literals. For example:&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
(x_1\vee \neg x_2 \vee \neg x_3)\wedge (\neg x_1\vee \neg x_3)\wedge (x_1\vee x_2\vee x_4)\wedge (x_4\vee \neg x_3)\wedge (x_4\vee \neg x_1).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The satisfiability (SAT) problem ask whether the CNF is satisfiable, i.e. there exists an assignment of variables to the values of true and false so that all clauses are true. The maximum satisfiability (MAXSAT) is the optimization version of SAT, which ask for an assignment that the number of satisfied clauses is maximized.&lt;br /&gt;
&lt;br /&gt;
SAT is the first problem known to be &#039;&#039;&#039;NP-complete&#039;&#039;&#039; (the Cook-Levin theorem). MAXSAT is also &#039;&#039;&#039;NP-complete&#039;&#039;&#039;. We then see that there always exists a roughly good truth assignment which satisfies half the clauses.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem|&lt;br /&gt;
:For any set of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; clauses, there is a truth assignment that satisfies at least &amp;lt;math&amp;gt;\frac{m}{2}&amp;lt;/math&amp;gt; clauses.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| For each variable, independently assign a random value in &amp;lt;math&amp;gt;\{\mathrm{true},\mathrm{false}\}&amp;lt;/math&amp;gt; with equal probability. For the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;th clause, let &amp;lt;math&amp;gt;X_i&amp;lt;/math&amp;gt; be the random variable which indicates whether the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;th clause is satisfied. Suppose that there are &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; literals in the clause. The probability that the clause is satisfied is &lt;br /&gt;
:&amp;lt;math&amp;gt;\Pr[X_k=1]\ge(1-2^{-k})\ge\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;X=\sum_{i=1}^m X_i&amp;lt;/math&amp;gt; be the number of satisfied clauses. By the linearity of expectation,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[X]=\sum_{i=1}^{m}\mathbf{E}[X_i]\ge \frac{m}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore, there exists an assignment such that at least &amp;lt;math&amp;gt;\frac{m}{2}&amp;lt;/math&amp;gt; clauses are satisfied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Alterations ===&lt;br /&gt;
;Independent sets&lt;br /&gt;
An independent set of a graph is a set of vertices with no edges between them. The following theorem gives a lower bound on the size of the largest independent set.&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt; be a graph on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices with &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; edges. Then &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; has an independent set with at least &amp;lt;math&amp;gt;\frac{n^2}{4m}&amp;lt;/math&amp;gt; vertices.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| Let &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; be a set of vertices constructed as follows:&lt;br /&gt;
:For each vertex &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;:&lt;br /&gt;
:* &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is included in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; independently with probability &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;,&lt;br /&gt;
&amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; to be determined.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;X=|S|&amp;lt;/math&amp;gt;. It is obvious that &amp;lt;math&amp;gt;\mathbf{E}[X]=np&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each edge &amp;lt;math&amp;gt;e\in E&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;Y_{e}&amp;lt;/math&amp;gt; be the random variable which indicates whether both endpoints of &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; are in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[Y_{uv}]=\Pr[u\in S\wedge v\in S]=p^2.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Let &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; be the number of edges in the subgraph of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; induced by &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. It holds that &amp;lt;math&amp;gt;Y=\sum_{e\in E}Y_e&amp;lt;/math&amp;gt;. By linearity of expectation,&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{E}[Y]=\sum_{e\in E}\mathbf{E}[Y_e]=mp^2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that although &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is not necessary an independent set, it can be modified to one if for each edge &amp;lt;math&amp;gt;e&amp;lt;/math&amp;gt; of the induced subgraph &amp;lt;math&amp;gt;G(S)&amp;lt;/math&amp;gt;, we delete one of the endpoint of &amp;lt;math&amp;gt;e&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt; be the resulting set. It is obvious that &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt; is an independent set since there is no edge left in the induced subgraph &amp;lt;math&amp;gt;G(S^*)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Since there are &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; edges in &amp;lt;math&amp;gt;G(S)&amp;lt;/math&amp;gt;, there are at most &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; vertices in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; are deleted to make it become &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt;. Therefore, &amp;lt;math&amp;gt;|S^*|\ge X-Y&amp;lt;/math&amp;gt;. By linearity of expectation,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[|S^*|]\ge\mathbf{E}[X-Y]=\mathbf{E}[X]-\mathbf{E}[Y]=np-mp^2.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
The expectation is maximized when &amp;lt;math&amp;gt;p=\frac{n}{2m}&amp;lt;/math&amp;gt;, thus&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[|S^*|]\ge n\cdot\frac{n}{2m}-m\left(\frac{n}{2m}\right)^2=\frac{n^2}{4m}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
There exists an independent set which contains at least &amp;lt;math&amp;gt;\frac{n^2}{4m}&amp;lt;/math&amp;gt; vertices.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The proof actually propose a randomized algorithm for constructing large independent set:&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Algorithm|&lt;br /&gt;
Given a graph on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices with &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; edges, let &amp;lt;math&amp;gt;d=\frac{2m}{n}&amp;lt;/math&amp;gt; be the average degree.&lt;br /&gt;
#For each vertex &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is included in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; independently with probability &amp;lt;math&amp;gt;\frac{1}{d}&amp;lt;/math&amp;gt;.&lt;br /&gt;
#For each remaining edge in the induced subgraph &amp;lt;math&amp;gt;G(S)&amp;lt;/math&amp;gt;, remove one of the endpoints from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt; be the resulting set. We have shown that &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt; is an independent set and &amp;lt;math&amp;gt;\mathbf{E}[|S^*|]\ge\frac{n^2}{4m}&amp;lt;/math&amp;gt;.&lt;/div&gt;</summary>
		<author><name>172.16.65.101</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Existence,_the_probabilistic_method&amp;diff=3013</id>
		<title>Combinatorics (Fall 2010)/Existence, the probabilistic method</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Existence,_the_probabilistic_method&amp;diff=3013"/>
		<updated>2010-09-13T05:06:18Z</updated>

		<summary type="html">&lt;p&gt;172.16.65.101: /* The Probabilistic Method */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Counting arguments ==&lt;br /&gt;
;Circuit complexity&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;&#039;boolean function&#039;&#039;&#039; is a function is the form &amp;lt;math&amp;gt;f:\{0,1\}^n\rightarrow \{0,1\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Formally, a boolean circuit is a directed acyclic graph. Nodes with indegree zero are input nodes, labeled &amp;lt;math&amp;gt;x_1, x_2, \ldots , x_n&amp;lt;/math&amp;gt;. A circuit has a unique node with outdegree zero, called the output node. Every other node is a gate. There are three types of gates: AND, OR (both with indegree two), and NOT (with indegree one).&lt;br /&gt;
&lt;br /&gt;
Computations in Turing machines can be simulated by circuits, and any boolean function in &#039;&#039;&#039;P&#039;&#039;&#039; can be computed by a circuit with polynomially many gates. Thus, if we can find a function in &#039;&#039;&#039;NP&#039;&#039;&#039; that cannot be computed by any circuit with polynomially many gates, then &#039;&#039;&#039;NP&#039;&#039;&#039;&amp;lt;math&amp;gt;\neq&amp;lt;/math&amp;gt;&#039;&#039;&#039;P&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The following theorem due to Shannon says that functions with exponentially large circuit complexity do exist.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem (Shannon 1949)|&lt;br /&gt;
:There is a boolean function &amp;lt;math&amp;gt;f:\{0,1\}^n\rightarrow \{0,1\}&amp;lt;/math&amp;gt; with circuit complexity greater than &amp;lt;math&amp;gt;\frac{2^n}{3n}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| &lt;br /&gt;
We first count the number of boolean functions &amp;lt;math&amp;gt;f:\{0,1\}^n\rightarrow \{0,1\}&amp;lt;/math&amp;gt;. There are &amp;lt;math&amp;gt;2^{2^n}&amp;lt;/math&amp;gt; boolean functions &amp;lt;math&amp;gt;f:\{0,1\}^n\rightarrow \{0,1\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then we count the number of boolean circuit with fixed number of gates.&lt;br /&gt;
Fix an integer &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, we count the number of circuits with &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; gates. By the [http://en.wikipedia.org/wiki/De_Morgan&#039;s_laws De Morgan&#039;s laws], we can assume that all NOTs are pushed back to the inputs. Each gate has one of the two types (AND or OR), and has two inputs. Each of the inputs to a gate is either a constant 0 or 1, an input variable &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt;, an inverted input variable &amp;lt;math&amp;gt;\neg x_i&amp;lt;/math&amp;gt;, or the output of another gate; thus, there are at most &amp;lt;math&amp;gt;2+2n+t-1&amp;lt;/math&amp;gt; possible gate inputs. It follows that the number of circuits with &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; gates is at most &amp;lt;math&amp;gt;2^t(t+2n+1)^{2t}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;t=2^n/3n&amp;lt;/math&amp;gt;, then&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{2^t(t+2n+1)^{2t}}{2^{2^n}}=o(1)&amp;lt;1,&amp;lt;/math&amp;gt;      thus, &amp;lt;math&amp;gt;2^t(t+2n+1)^{2t} &amp;lt; 2^{2^n}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each boolean circuit computes one boolean function. Therefore, there must exist a boolean function &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; which cannot be computed by any circuits with &amp;lt;math&amp;gt;2^n/3n&amp;lt;/math&amp;gt; gates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Note that by Shannon&#039;s theorem, not only there exists a boolean function with exponentially large circuit complexity, but &#039;&#039;almost all&#039;&#039; boolean functions have exponentially large circuit complexity.&lt;br /&gt;
&lt;br /&gt;
=== Double counting ===&lt;br /&gt;
;Intersecting families;&lt;br /&gt;
&lt;br /&gt;
An &amp;lt;math&amp;gt;\mathcal{F}\subseteq 2^S&amp;lt;/math&amp;gt; is an &#039;&#039;&#039;intersecting&#039;&#039;&#039; family if for any &amp;lt;math&amp;gt;A,B\in\mathcal{F}&amp;lt;/math&amp;gt; it holds that &amp;lt;math&amp;gt;A\cap B\neq\emptyset&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Suppose that &amp;lt;math&amp;gt;n\ge 2k&amp;lt;/math&amp;gt;. For &amp;lt;math&amp;gt;\mathcal{F}\subseteq{S\choose k}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;|S|=n&amp;lt;/math&amp;gt;, we can let all &amp;lt;math&amp;gt;A\in \mathcal{F}&amp;lt;/math&amp;gt; contain one common element &amp;lt;math&amp;gt;a\in S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;A-\{a\}&amp;lt;/math&amp;gt; enumerates all &amp;lt;math&amp;gt;{n-1\choose k-1}&amp;lt;/math&amp;gt; possible combinations of &amp;lt;math&amp;gt;(k-1)&amp;lt;/math&amp;gt; elements in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. This gives us an intersecting family of size  &amp;lt;math&amp;gt;|\mathcal{F}|={n-1\choose k-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The following theorem says that this is the largest possible cardinality an intersecting &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; can achieve. The theorem was first proved by Erdős, Ko, and Rado in 1938, but published 23 years later. It is a fundamental result in the area of extremal set theory, which studies the maximum (or minimum) possible cardinality of a set system satisfying certain structural assumption. In this example, the structural assumption is intersecting.&lt;br /&gt;
&lt;br /&gt;
Here we present a probabilistic proof by Katona.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem (Erdős-Ko-Rado 1961)|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;\mathcal{F}\subseteq{S\choose k}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;|S|=n&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n\ge 2k&amp;lt;/math&amp;gt;. If &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; is an intersecting family then &amp;lt;math&amp;gt;|\mathcal{F}|\le{n-1\choose k-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| (due to Katona 1972).&lt;br /&gt;
&lt;br /&gt;
Without loss of generality, let &amp;lt;math&amp;gt;S=[n]&amp;lt;/math&amp;gt;.&lt;br /&gt;
For &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;A_i=\{(i+j)\bmod n\mid j\in[k]\}&amp;lt;/math&amp;gt;. Then we make the following claim.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Claim 1:&#039;&#039;&#039; &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; can contain at most &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; many &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
The claim can be easily proved by observing that for any &amp;lt;math&amp;gt;i,j\in[n]&amp;lt;/math&amp;gt; that &amp;lt;math&amp;gt;i&amp;lt;j&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;A_j&amp;lt;/math&amp;gt; are disjoint if &amp;lt;math&amp;gt;j-i&amp;gt;k&amp;lt;/math&amp;gt;, thus in order to make &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; intersecting, all &amp;lt;math&amp;gt;A_i,A_j\in\mathcal{F}&amp;lt;/math&amp;gt; have &amp;lt;math&amp;gt;|i-j|\le k&amp;lt;/math&amp;gt;. This is violated once there are more than &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; many &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now we prove the Erdős-Ko-Rado theorem. Let a permutation &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[n]&amp;lt;/math&amp;gt; and an integer &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt; be chosen uniformly and independently at random. Let &lt;br /&gt;
:&amp;lt;math&amp;gt;R=\{\sigma((i+j)\bmod n)\mid j\in[k]\}, \quad\mbox{ or equivalently }R=\sigma(A_i)&amp;lt;/math&amp;gt;. &lt;br /&gt;
By Claim 1, for any fixed permutation &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, the family &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; can contain at most &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; of the sets &amp;lt;math&amp;gt;\sigma(A_i)&amp;lt;/math&amp;gt;, thus conditioning on any particular &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\Pr[R\in\mathcal{F}\mid \sigma]\le\frac{k}{n}&amp;lt;/math&amp;gt;. Hence &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[R\in\mathcal{F}]\le\frac{k}{n}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
On the other hand, by our construction, &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; is uniformly chosen from &amp;lt;math&amp;gt;{S\choose k}&amp;lt;/math&amp;gt;, thus&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[R\in\mathcal{F}]=\frac{|\mathcal{F}|}{{n\choose k}}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore,&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
|\mathcal{F}|\le\frac{k}{n}{n\choose k}={n-1\choose k-1}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== The averaging principle ===&lt;br /&gt;
&lt;br /&gt;
== The Pigeonhole Principle ==&lt;br /&gt;
&lt;br /&gt;
== The Probabilistic Method ==&lt;br /&gt;
&lt;br /&gt;
Suppose we want prove the existence of mathematic objects with certain properties. One way to do so is to explicitly construct such an object. This kind of proofs can be interpreted as &#039;&#039;deterministic algorithms&#039;&#039; which find the object with desirable properties.&lt;br /&gt;
&lt;br /&gt;
The probabilistic method provides another way of proving the existence of objects: instead of explicitly constructing an object, we define a probability space of objects in which the probability is positive that a randomly selected object has the required property.&lt;br /&gt;
&lt;br /&gt;
The basic principle of the probabilistic method is very simple, and can be stated in intuitive ways:&lt;br /&gt;
*If an object chosen randomly from a universe satisfies a property with positive probability, then there must be an object in the universe that satisfies that property.&lt;br /&gt;
:For example, for a ball(the object) randomly chosen from a box(the universe) of balls, if the probability that the chosen ball is blue(the property) is &amp;gt;0, then there must be a blue ball in the box.&lt;br /&gt;
*Any random variable assumes at least one value that is no smaller than its expectation, and at least one value that is no greater than the expectation.&lt;br /&gt;
:For example, if we know the average height of the students in the class is &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;, then we know there is a students whose height is at least &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;, and there is a student whose height is at most &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Although the idea of  the probabilistic method is simple, it provides us a powerful tool for existential proof. In same cases, the proof itself is a &#039;&#039;randomized algorithm&#039;&#039;, and if we are lucky, the algorithm could be very efficient.&lt;br /&gt;
&lt;br /&gt;
=== Sampling ===&lt;br /&gt;
;Ramsey number&lt;br /&gt;
&lt;br /&gt;
Recall the Ramsey theorem which states that in a meeting of at least six people, there are either three people knowing each other or three people not knowing each other. In graph theoretical terms, this means that no matter how we color the edges of &amp;lt;math&amp;gt;K_6&amp;lt;/math&amp;gt; (the complete graph on six vertices), there must be a &#039;&#039;&#039;monochromatic&#039;&#039;&#039; &amp;lt;math&amp;gt;K_3&amp;lt;/math&amp;gt; (a triangle whose edges have the same color).&lt;br /&gt;
&lt;br /&gt;
Generally, the &#039;&#039;&#039;Ramsey number&#039;&#039;&#039; &amp;lt;math&amp;gt;R(k,\ell)&amp;lt;/math&amp;gt; is the smallest integer &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; such that in any two-coloring of the edges of a complete graph on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; by red and blue, either there is a red &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; or there is a blue &amp;lt;math&amp;gt;K_\ell&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Ramsey showed in 1929 that &amp;lt;math&amp;gt;R(k,\ell)&amp;lt;/math&amp;gt; is finite for any &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;. It is extremely hard to compute the exact value of &amp;lt;math&amp;gt;R(k,\ell)&amp;lt;/math&amp;gt;. Here we give a lower bound of &amp;lt;math&amp;gt;R(k,k)&amp;lt;/math&amp;gt; by the probabilistic method.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem (Erdős 1947)|&lt;br /&gt;
:If &amp;lt;math&amp;gt;{n\choose k}\cdot 2^{1-{k\choose 2}}&amp;lt;1&amp;lt;/math&amp;gt; then it is possible to color the edges of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; with two colors so that there is no monochromatic &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; subgraph.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| Consider a random two-coloring of edges of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; obtained as follows:&lt;br /&gt;
* For each edge of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt;, independently flip a fair coin to decide the color of the edge.&lt;br /&gt;
&lt;br /&gt;
For any fixed set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; vertices, let &amp;lt;math&amp;gt;\mathcal{E}_S&amp;lt;/math&amp;gt; be the event that the &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; subgraph induced by &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is monochromatic. There are &amp;lt;math&amp;gt;{k\choose 2}&amp;lt;/math&amp;gt; many edges in &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt;, therefore&lt;br /&gt;
:&amp;lt;math&amp;gt;\Pr[\mathcal{E}_S]=2\cdot 2^{-{k\choose 2}}=2^{1-{k\choose 2}}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since there are &amp;lt;math&amp;gt;{n\choose k}&amp;lt;/math&amp;gt; possible choices of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;, by the union bound&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[\exists S, \mathcal{E}_S]\le {n\choose k}\cdot\Pr[\mathcal{E}_S]={n\choose k}\cdot 2^{1-{k\choose 2}}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Due to the assumption, &amp;lt;math&amp;gt;{n\choose k}\cdot 2^{1-{k\choose 2}}&amp;lt;1&amp;lt;/math&amp;gt;, thus there exists a two coloring that none of &amp;lt;math&amp;gt;\mathcal{E}_S&amp;lt;/math&amp;gt; occurs, which means  there is no monochromatic &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; subgraph.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;k\ge 3&amp;lt;/math&amp;gt; and we take &amp;lt;math&amp;gt;n=\lfloor2^{k/2}\rfloor&amp;lt;/math&amp;gt;, then&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
{n\choose k}\cdot 2^{1-{k\choose 2}}&lt;br /&gt;
&amp;amp;&amp;lt;&lt;br /&gt;
\frac{n^k}{k!}\cdot\frac{2^{1+\frac{k}{2}}}{2^{k^2/2}}\\&lt;br /&gt;
&amp;amp;\le &lt;br /&gt;
\frac{2^{k^2/2}}{k!}\cdot\frac{2^{1+\frac{k}{2}}}{2^{k^2/2}}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\frac{2^{1+\frac{k}{2}}}{k!}\\&lt;br /&gt;
&amp;amp;&amp;lt;1.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
By the above theorem, there exists a two-coloring of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; that there is no monochromatic &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt;. Therefore, the Ramsey number &amp;lt;math&amp;gt;R(k,k)&amp;gt;\lfloor2^{k/2}\rfloor&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;k\ge 3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that for sufficiently large &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n= \lfloor 2^{k/2}\rfloor&amp;lt;/math&amp;gt;, then the probability that there exists a monochromatic &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; is bounded by&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
{n\choose k}\cdot 2^{1-{k\choose 2}}&lt;br /&gt;
&amp;lt;&lt;br /&gt;
\frac{2^{1+\frac{k}{2}}}{k!}&lt;br /&gt;
\ll 1,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
which means that a random two-coloring of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; is very likely not to contain a monochromatic  &amp;lt;math&amp;gt;K_{2\log n}&amp;lt;/math&amp;gt;. This gives us a very simple randomized algorithm for finding a two-coloring of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; without monochromatic &amp;lt;math&amp;gt;K_{2\log n}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Blocking number&lt;br /&gt;
Let &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; be a set. Let &amp;lt;math&amp;gt;2^{S}=\{A\mid A\subseteq S\}&amp;lt;/math&amp;gt; be the power set of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;{S\choose k}=\{A\mid A\subseteq S\mbox{ and }|A|=k\}&amp;lt;/math&amp;gt; be the &#039;&#039;&#039;&amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-uniform&#039;&#039;&#039; of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
We call &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; a &#039;&#039;&#039;set family&#039;&#039;&#039; (or a &#039;&#039;&#039;set system&#039;&#039;&#039;)  with &#039;&#039;&#039;ground set&#039;&#039;&#039; &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; if &amp;lt;math&amp;gt;\mathcal{F}\subseteq 2^{S}&amp;lt;/math&amp;gt;. The members of &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; are subsets of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Given a set family &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; with ground set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;,&lt;br /&gt;
a set &amp;lt;math&amp;gt;T\subseteq S&amp;lt;/math&amp;gt; is a &#039;&#039;&#039;blocking set&#039;&#039;&#039; of &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; if all &amp;lt;math&amp;gt;A\in\mathcal{F}&amp;lt;/math&amp;gt; have &amp;lt;math&amp;gt;A\cap T\neq \emptyset&amp;lt;/math&amp;gt;, i.e. &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; intersects (blocks) all member set of &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem|&lt;br /&gt;
:Given a set family &amp;lt;math&amp;gt;\mathcal{F}\subseteq{S\choose k}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;m=|\mathcal{F}|&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n=|S|&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; has a blocking set of size &amp;lt;math&amp;gt;\left\lceil\frac{n\ln m}{k}\right\rceil&amp;lt;/math&amp;gt;. &lt;br /&gt;
}}&lt;br /&gt;
{{Proof| Let &amp;lt;math&amp;gt;\tau=\left\lceil\frac{n\ln m}{k}\right\rceil&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; be a set chosen uniformly at random from &amp;lt;math&amp;gt;{S\choose \tau}&amp;lt;/math&amp;gt;. We show that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is a blocking set of &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; with a probability &amp;gt;0.&lt;br /&gt;
&lt;br /&gt;
Fix any &amp;lt;math&amp;gt;A\in\mathcal{F}&amp;lt;/math&amp;gt;. Recall that &amp;lt;math&amp;gt;\mathcal{F}\subseteq{S\choose k}&amp;lt;/math&amp;gt;, thus &amp;lt;math&amp;gt;|A|=k&amp;lt;/math&amp;gt;. And&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Pr[A\cap T=\emptyset]&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\frac{\left|{S-A\choose \tau}\right|}{\left|{S\choose \tau}\right|}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\frac{{n-k\choose \tau}}{{n\choose\tau}}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\frac{(n-k)\cdot(n-k-1)\cdots(n-k-\tau+1)}{n\cdot(n-1)\cdots(n-\tau+1)}\\&lt;br /&gt;
&amp;amp;&amp;lt;&lt;br /&gt;
\left(1-\frac{k}{n}\right)^{\tau}\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\exp\left(-\frac{k\tau}{n}\right)\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\frac{1}{m}.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
By the union bound, the probability that there exists an &amp;lt;math&amp;gt;A\in\mathcal{F}&amp;lt;/math&amp;gt; that misses &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[\exists A\in\mathcal{F}, A\cap T=\emptyset]\le m\Pr[A\cap T=\emptyset]&amp;lt;m\cdot\frac{1}{m}=1.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Thus, the probability that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is a blocking set&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[\forall A\in\mathcal{F}, A\cap T\neq\emptyset]&amp;gt;0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
There exists a blocking set of size &amp;lt;math&amp;gt;\tau=\left\lceil\frac{n\ln m}{k}\right\rceil&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The theorem also hints us to a randomized algorithm. In order to make the algorithm efficient, we relax the size of &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\tau=\frac{2n\ln m}{k}&amp;lt;/math&amp;gt;. Uniformly choose &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; elements from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; to form the set &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, by the above analysis, the probability that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is NOT a blocking set is at most&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
m\exp\left(-\frac{n\tau}{k}\right)=m\exp(-2\ln m)=\frac{1}{m}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Thus, a blocking set is found with high probability.&lt;br /&gt;
&lt;br /&gt;
=== Linearity of expectation ===&lt;br /&gt;
&lt;br /&gt;
;Maximum cut&lt;br /&gt;
&lt;br /&gt;
Given an undirected graph &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt;, a set &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; of edges of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; is called a &#039;&#039;&#039;cut&#039;&#039;&#039; if &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; is disconnected after removing the edges in &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;. We can represent a cut by &amp;lt;math&amp;gt;c(S,T)&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;(S,T)&amp;lt;/math&amp;gt; is a bipartition of the vertex set &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;c(S,T)=\{uv\in E\mid u\in S,v\in T\}&amp;lt;/math&amp;gt; is the set of edges crossing between &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We have seen how to compute min-cut: either by deterministic max-flow algorithm, or by Karger&#039;s randomized algorithm. On the other hand, max-cut is hard to compute, because it is &#039;&#039;&#039;NP-complete&#039;&#039;&#039;. Actually, the weighted version of max-cut is among the [http://en.wikipedia.org/wiki/Karp&#039;s_21_NP-complete_problems Karp&#039;s 21 NP-complete problems].&lt;br /&gt;
&lt;br /&gt;
We now show by the probabilistic method that a max-cut always has at least half the edges.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem|&lt;br /&gt;
:Given an undirected graph &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices and &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; edges, there is a cut of size at least &amp;lt;math&amp;gt;\frac{m}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| Enumerate the vertices in an arbitrary order. Partition the vertex set &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; into two disjoint sets &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; as follows.&lt;br /&gt;
:For each vertex &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;,&lt;br /&gt;
:* independently choose one of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; with equal probability, and let &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; join the chosen set.&lt;br /&gt;
&lt;br /&gt;
For each vertex &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;X_v\in\{S,T\}&amp;lt;/math&amp;gt; be the random variable which represents the set that &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; joins. For each edge &amp;lt;math&amp;gt;uv\in E&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;Y_{uv}&amp;lt;/math&amp;gt; be the 0-1 random variable which indicates whether &amp;lt;math&amp;gt;uv&amp;lt;/math&amp;gt; crosses between &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. Clearly,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[Y_{uv}=1]=\Pr[X_u\neq X_v]=\frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The size of &amp;lt;math&amp;gt;c(S,T)&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;Y=\sum_{uv\in E}Y_{uv}&amp;lt;/math&amp;gt;. By the linearity of expectation,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[Y]=\sum_{uv\in E}\mathbf{E}[Y_{uv}]=\sum_{uv\in E}\Pr[Y_{uv}=1]=\frac{m}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore, there exist a bipartition &amp;lt;math&amp;gt;(S,T)&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;|c(S,T)|\ge\frac{m}{2}&amp;lt;/math&amp;gt;, i.e. there exists a cut of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; which contains at least &amp;lt;math&amp;gt;\frac{m}{2}&amp;lt;/math&amp;gt; edges.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Maximum satisfiability&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a number of boolean variables &amp;lt;math&amp;gt;x_1,x_2,\ldots,\in\{\mathrm{true},\mathrm{false}\}&amp;lt;/math&amp;gt;. A &#039;&#039;&#039;literal&#039;&#039;&#039; is either a variable &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; itself or its negation &amp;lt;math&amp;gt;\neg x_i&amp;lt;/math&amp;gt;. A logic expression is a &#039;&#039;&#039;conjunctive normal form (CNF)&#039;&#039;&#039; if it is written as the conjunction(AND) of a set of &#039;&#039;&#039;clauses&#039;&#039;&#039;, where each clause is a disjunction(OR) of literals. For example:&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
(x_1\vee \neg x_2 \vee \neg x_3)\wedge (\neg x_1\vee \neg x_3)\wedge (x_1\vee x_2\vee x_4)\wedge (x_4\vee \neg x_3)\wedge (x_4\vee \neg x_1).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The satisfiability (SAT) problem ask whether the CNF is satisfiable, i.e. there exists an assignment of variables to the values of true and false so that all clauses are true. The maximum satisfiability (MAXSAT) is the optimization version of SAT, which ask for an assignment that the number of satisfied clauses is maximized.&lt;br /&gt;
&lt;br /&gt;
SAT is the first problem known to be &#039;&#039;&#039;NP-complete&#039;&#039;&#039; (the Cook-Levin theorem). MAXSAT is also &#039;&#039;&#039;NP-complete&#039;&#039;&#039;. We then see that there always exists a roughly good truth assignment which satisfies half the clauses.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem|&lt;br /&gt;
:For any set of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; clauses, there is a truth assignment that satisfies at least &amp;lt;math&amp;gt;\frac{m}{2}&amp;lt;/math&amp;gt; clauses.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| For each variable, independently assign a random value in &amp;lt;math&amp;gt;\{\mathrm{true},\mathrm{false}\}&amp;lt;/math&amp;gt; with equal probability. For the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;th clause, let &amp;lt;math&amp;gt;X_i&amp;lt;/math&amp;gt; be the random variable which indicates whether the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;th clause is satisfied. Suppose that there are &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; literals in the clause. The probability that the clause is satisfied is &lt;br /&gt;
:&amp;lt;math&amp;gt;\Pr[X_k=1]\ge(1-2^{-k})\ge\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;X=\sum_{i=1}^m X_i&amp;lt;/math&amp;gt; be the number of satisfied clauses. By the linearity of expectation,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[X]=\sum_{i=1}^{m}\mathbf{E}[X_i]\ge \frac{m}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore, there exists an assignment such that at least &amp;lt;math&amp;gt;\frac{m}{2}&amp;lt;/math&amp;gt; clauses are satisfied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Alterations ===&lt;br /&gt;
;Independent sets&lt;br /&gt;
An independent set of a graph is a set of vertices with no edges between them. The following theorem gives a lower bound on the size of the largest independent set.&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt; be a graph on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices with &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; edges. Then &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; has an independent set with at least &amp;lt;math&amp;gt;\frac{n^2}{4m}&amp;lt;/math&amp;gt; vertices.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| Let &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; be a set of vertices constructed as follows:&lt;br /&gt;
:For each vertex &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;:&lt;br /&gt;
:* &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is included in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; independently with probability &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;,&lt;br /&gt;
&amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; to be determined.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;X=|S|&amp;lt;/math&amp;gt;. It is obvious that &amp;lt;math&amp;gt;\mathbf{E}[X]=np&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each edge &amp;lt;math&amp;gt;e\in E&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;Y_{e}&amp;lt;/math&amp;gt; be the random variable which indicates whether both endpoints of &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; are in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[Y_{uv}]=\Pr[u\in S\wedge v\in S]=p^2.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Let &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; be the number of edges in the subgraph of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; induced by &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. It holds that &amp;lt;math&amp;gt;Y=\sum_{e\in E}Y_e&amp;lt;/math&amp;gt;. By linearity of expectation,&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{E}[Y]=\sum_{e\in E}\mathbf{E}[Y_e]=mp^2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that although &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is not necessary an independent set, it can be modified to one if for each edge &amp;lt;math&amp;gt;e&amp;lt;/math&amp;gt; of the induced subgraph &amp;lt;math&amp;gt;G(S)&amp;lt;/math&amp;gt;, we delete one of the endpoint of &amp;lt;math&amp;gt;e&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt; be the resulting set. It is obvious that &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt; is an independent set since there is no edge left in the induced subgraph &amp;lt;math&amp;gt;G(S^*)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Since there are &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; edges in &amp;lt;math&amp;gt;G(S)&amp;lt;/math&amp;gt;, there are at most &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; vertices in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; are deleted to make it become &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt;. Therefore, &amp;lt;math&amp;gt;|S^*|\ge X-Y&amp;lt;/math&amp;gt;. By linearity of expectation,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[|S^*|]\ge\mathbf{E}[X-Y]=\mathbf{E}[X]-\mathbf{E}[Y]=np-mp^2.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
The expectation is maximized when &amp;lt;math&amp;gt;p=\frac{n}{2m}&amp;lt;/math&amp;gt;, thus&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[|S^*|]\ge n\cdot\frac{n}{2m}-m\left(\frac{n}{2m}\right)^2=\frac{n^2}{4m}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
There exists an independent set which contains at least &amp;lt;math&amp;gt;\frac{n^2}{4m}&amp;lt;/math&amp;gt; vertices.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The proof actually propose a randomized algorithm for constructing large independent set:&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Algorithm|&lt;br /&gt;
Given a graph on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices with &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; edges, let &amp;lt;math&amp;gt;d=\frac{2m}{n}&amp;lt;/math&amp;gt; be the average degree.&lt;br /&gt;
#For each vertex &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is included in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; independently with probability &amp;lt;math&amp;gt;\frac{1}{d}&amp;lt;/math&amp;gt;.&lt;br /&gt;
#For each remaining edge in the induced subgraph &amp;lt;math&amp;gt;G(S)&amp;lt;/math&amp;gt;, remove one of the endpoints from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt; be the resulting set. We have shown that &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt; is an independent set and &amp;lt;math&amp;gt;\mathbf{E}[|S^*|]\ge\frac{n^2}{4m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== The Lovász Local Lemma ==&lt;br /&gt;
&lt;br /&gt;
Consider a set of &amp;quot;bad&amp;quot; events &amp;lt;math&amp;gt;A_1,A_2,\ldots,A_n&amp;lt;/math&amp;gt;. Suppose that &amp;lt;math&amp;gt;\Pr[A_i]\le p&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;1\le i\le n&amp;lt;/math&amp;gt;. We want to show that there is a situation that none of the bad events occurs. Due to the probabilistic method, we need to prove that&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]&amp;gt;0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
;Case 1&amp;lt;nowiki&amp;gt;: mutually independent events.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
If all the bad events &amp;lt;math&amp;gt;A_1,A_2,\ldots,A_n&amp;lt;/math&amp;gt; are mutually independent, then&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]\ge(1-p)^n&amp;gt;0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
for any &amp;lt;math&amp;gt;p&amp;lt;1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Case 2&amp;lt;nowiki&amp;gt;: arbitrarily dependent events.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
On the other hand, if we put no assumption on the dependencies between the events, then by the union bound (which holds unconditionally),&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]=1-\Pr\left[\bigvee_{i=1}^n A_i\right]\ge 1-np,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
which is not an interesting bound for &amp;lt;math&amp;gt;p\ge\frac{1}{n}&amp;lt;/math&amp;gt;. If we make no further assumption on the dependencies between the events, this bound is tight.&lt;br /&gt;
&lt;br /&gt;
;Example&lt;br /&gt;
:Consider that a ball is uniformly thrown into one of the &amp;lt;math&amp;gt;(n+1)&amp;lt;/math&amp;gt; bins. Let the &amp;quot;bad&amp;quot; events &amp;lt;math&amp;gt;A_1,A_2,\ldots,A_n&amp;lt;/math&amp;gt; be defined as that &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt; represents that the ball falls into the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;th bin. The only good event is that the ball falls into the &amp;lt;math&amp;gt;(n+1)&amp;lt;/math&amp;gt;th bin. Clearly, &amp;lt;math&amp;gt;\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]=1-n\cdot\frac{1}{n+1}&amp;lt;/math&amp;gt;. Thus the above union bound is achieved.&lt;br /&gt;
&lt;br /&gt;
This example shows that dependencies between the events could cause troubles.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would like to know what is going on between the two extreme cases: mutually independent events, and arbitrarily dependent events. The Lovász local lemma provides such a tool.&lt;br /&gt;
&lt;br /&gt;
=== The local lemma ===&lt;br /&gt;
The local lemma is powerful tool for showing the possibility of rare event under limited dependencies. The structure of dependencies between a set of events is described by a &#039;&#039;&#039;dependency graph&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Definition|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;A_1,A_2,\ldots,A_n&amp;lt;/math&amp;gt; be a set of events. A graph &amp;lt;math&amp;gt;D=(V,E)&amp;lt;/math&amp;gt; on the set of vertices &amp;lt;math&amp;gt;V=\{1,2,\ldots,n\}&amp;lt;/math&amp;gt; is called a &#039;&#039;&#039;dependency graph&#039;&#039;&#039; for the events &amp;lt;math&amp;gt;A_1,\ldots,A_n&amp;lt;/math&amp;gt; if for each &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;1\le i\le n&amp;lt;/math&amp;gt;, the event &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt; is mutually independent of all the events &amp;lt;math&amp;gt;\{A_j\mid (i,j)\not\in E\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
;Example&lt;br /&gt;
:Let &amp;lt;math&amp;gt;X_1,X_2,\ldots,X_m&amp;lt;/math&amp;gt; be a set of &#039;&#039;mutually independent&#039;&#039; random variables. Each event &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt; is a predicate defined on a number of variables among &amp;lt;math&amp;gt;X_1,X_2,\ldots,X_m&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;v(A_i)&amp;lt;/math&amp;gt; be the unique smallest set of variables which determine &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt;. The dependency graph &amp;lt;math&amp;gt;D=(V,E)&amp;lt;/math&amp;gt; is defined by &lt;br /&gt;
:::&amp;lt;math&amp;gt;(i,j)\in E&amp;lt;/math&amp;gt; iff &amp;lt;math&amp;gt;v(A_i)\cap v(A_j)\neq \emptyset&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This construction gives a general framework for the probability spaces with limited dependencies and is central to the constructive proof of the Lovász local lemma. In this example, each event is a predicate of variables, and the events are dependent if they depend on some common events.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following lemma, known as the Lovász local lemma, first proved by Erdős and Lovász in 1975, is an extremely powerful tool, as it supplies a way for dealing with rare events.&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem (The local lemma)|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;A_1,A_2,\ldots,A_n&amp;lt;/math&amp;gt; be a set of events, and assume that the following hold:&lt;br /&gt;
:#for all &amp;lt;math&amp;gt;1\le i\le n&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\Pr[A_i]\le p&amp;lt;/math&amp;gt;;&lt;br /&gt;
:#the maximum degree of the dependency graph for the events &amp;lt;math&amp;gt;A_1,A_2,\ldots,A_n&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;, and &lt;br /&gt;
:::&amp;lt;math&amp;gt;ep(d+1)\le 1&amp;lt;/math&amp;gt;.&lt;br /&gt;
:Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>172.16.65.101</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Existence,_the_probabilistic_method&amp;diff=3012</id>
		<title>Combinatorics (Fall 2010)/Existence, the probabilistic method</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Existence,_the_probabilistic_method&amp;diff=3012"/>
		<updated>2010-09-13T05:05:45Z</updated>

		<summary type="html">&lt;p&gt;172.16.65.101: /* Counting arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Counting arguments ==&lt;br /&gt;
;Circuit complexity&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;&#039;boolean function&#039;&#039;&#039; is a function is the form &amp;lt;math&amp;gt;f:\{0,1\}^n\rightarrow \{0,1\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Formally, a boolean circuit is a directed acyclic graph. Nodes with indegree zero are input nodes, labeled &amp;lt;math&amp;gt;x_1, x_2, \ldots , x_n&amp;lt;/math&amp;gt;. A circuit has a unique node with outdegree zero, called the output node. Every other node is a gate. There are three types of gates: AND, OR (both with indegree two), and NOT (with indegree one).&lt;br /&gt;
&lt;br /&gt;
Computations in Turing machines can be simulated by circuits, and any boolean function in &#039;&#039;&#039;P&#039;&#039;&#039; can be computed by a circuit with polynomially many gates. Thus, if we can find a function in &#039;&#039;&#039;NP&#039;&#039;&#039; that cannot be computed by any circuit with polynomially many gates, then &#039;&#039;&#039;NP&#039;&#039;&#039;&amp;lt;math&amp;gt;\neq&amp;lt;/math&amp;gt;&#039;&#039;&#039;P&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The following theorem due to Shannon says that functions with exponentially large circuit complexity do exist.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem (Shannon 1949)|&lt;br /&gt;
:There is a boolean function &amp;lt;math&amp;gt;f:\{0,1\}^n\rightarrow \{0,1\}&amp;lt;/math&amp;gt; with circuit complexity greater than &amp;lt;math&amp;gt;\frac{2^n}{3n}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| &lt;br /&gt;
We first count the number of boolean functions &amp;lt;math&amp;gt;f:\{0,1\}^n\rightarrow \{0,1\}&amp;lt;/math&amp;gt;. There are &amp;lt;math&amp;gt;2^{2^n}&amp;lt;/math&amp;gt; boolean functions &amp;lt;math&amp;gt;f:\{0,1\}^n\rightarrow \{0,1\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then we count the number of boolean circuit with fixed number of gates.&lt;br /&gt;
Fix an integer &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, we count the number of circuits with &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; gates. By the [http://en.wikipedia.org/wiki/De_Morgan&#039;s_laws De Morgan&#039;s laws], we can assume that all NOTs are pushed back to the inputs. Each gate has one of the two types (AND or OR), and has two inputs. Each of the inputs to a gate is either a constant 0 or 1, an input variable &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt;, an inverted input variable &amp;lt;math&amp;gt;\neg x_i&amp;lt;/math&amp;gt;, or the output of another gate; thus, there are at most &amp;lt;math&amp;gt;2+2n+t-1&amp;lt;/math&amp;gt; possible gate inputs. It follows that the number of circuits with &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; gates is at most &amp;lt;math&amp;gt;2^t(t+2n+1)^{2t}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;t=2^n/3n&amp;lt;/math&amp;gt;, then&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{2^t(t+2n+1)^{2t}}{2^{2^n}}=o(1)&amp;lt;1,&amp;lt;/math&amp;gt;      thus, &amp;lt;math&amp;gt;2^t(t+2n+1)^{2t} &amp;lt; 2^{2^n}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each boolean circuit computes one boolean function. Therefore, there must exist a boolean function &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; which cannot be computed by any circuits with &amp;lt;math&amp;gt;2^n/3n&amp;lt;/math&amp;gt; gates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Note that by Shannon&#039;s theorem, not only there exists a boolean function with exponentially large circuit complexity, but &#039;&#039;almost all&#039;&#039; boolean functions have exponentially large circuit complexity.&lt;br /&gt;
&lt;br /&gt;
=== Double counting ===&lt;br /&gt;
;Intersecting families;&lt;br /&gt;
&lt;br /&gt;
An &amp;lt;math&amp;gt;\mathcal{F}\subseteq 2^S&amp;lt;/math&amp;gt; is an &#039;&#039;&#039;intersecting&#039;&#039;&#039; family if for any &amp;lt;math&amp;gt;A,B\in\mathcal{F}&amp;lt;/math&amp;gt; it holds that &amp;lt;math&amp;gt;A\cap B\neq\emptyset&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Suppose that &amp;lt;math&amp;gt;n\ge 2k&amp;lt;/math&amp;gt;. For &amp;lt;math&amp;gt;\mathcal{F}\subseteq{S\choose k}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;|S|=n&amp;lt;/math&amp;gt;, we can let all &amp;lt;math&amp;gt;A\in \mathcal{F}&amp;lt;/math&amp;gt; contain one common element &amp;lt;math&amp;gt;a\in S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;A-\{a\}&amp;lt;/math&amp;gt; enumerates all &amp;lt;math&amp;gt;{n-1\choose k-1}&amp;lt;/math&amp;gt; possible combinations of &amp;lt;math&amp;gt;(k-1)&amp;lt;/math&amp;gt; elements in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. This gives us an intersecting family of size  &amp;lt;math&amp;gt;|\mathcal{F}|={n-1\choose k-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The following theorem says that this is the largest possible cardinality an intersecting &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; can achieve. The theorem was first proved by Erdős, Ko, and Rado in 1938, but published 23 years later. It is a fundamental result in the area of extremal set theory, which studies the maximum (or minimum) possible cardinality of a set system satisfying certain structural assumption. In this example, the structural assumption is intersecting.&lt;br /&gt;
&lt;br /&gt;
Here we present a probabilistic proof by Katona.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem (Erdős-Ko-Rado 1961)|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;\mathcal{F}\subseteq{S\choose k}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;|S|=n&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n\ge 2k&amp;lt;/math&amp;gt;. If &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; is an intersecting family then &amp;lt;math&amp;gt;|\mathcal{F}|\le{n-1\choose k-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| (due to Katona 1972).&lt;br /&gt;
&lt;br /&gt;
Without loss of generality, let &amp;lt;math&amp;gt;S=[n]&amp;lt;/math&amp;gt;.&lt;br /&gt;
For &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;A_i=\{(i+j)\bmod n\mid j\in[k]\}&amp;lt;/math&amp;gt;. Then we make the following claim.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Claim 1:&#039;&#039;&#039; &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; can contain at most &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; many &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
The claim can be easily proved by observing that for any &amp;lt;math&amp;gt;i,j\in[n]&amp;lt;/math&amp;gt; that &amp;lt;math&amp;gt;i&amp;lt;j&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;A_j&amp;lt;/math&amp;gt; are disjoint if &amp;lt;math&amp;gt;j-i&amp;gt;k&amp;lt;/math&amp;gt;, thus in order to make &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; intersecting, all &amp;lt;math&amp;gt;A_i,A_j\in\mathcal{F}&amp;lt;/math&amp;gt; have &amp;lt;math&amp;gt;|i-j|\le k&amp;lt;/math&amp;gt;. This is violated once there are more than &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; many &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now we prove the Erdős-Ko-Rado theorem. Let a permutation &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[n]&amp;lt;/math&amp;gt; and an integer &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt; be chosen uniformly and independently at random. Let &lt;br /&gt;
:&amp;lt;math&amp;gt;R=\{\sigma((i+j)\bmod n)\mid j\in[k]\}, \quad\mbox{ or equivalently }R=\sigma(A_i)&amp;lt;/math&amp;gt;. &lt;br /&gt;
By Claim 1, for any fixed permutation &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, the family &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; can contain at most &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; of the sets &amp;lt;math&amp;gt;\sigma(A_i)&amp;lt;/math&amp;gt;, thus conditioning on any particular &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\Pr[R\in\mathcal{F}\mid \sigma]\le\frac{k}{n}&amp;lt;/math&amp;gt;. Hence &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[R\in\mathcal{F}]\le\frac{k}{n}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
On the other hand, by our construction, &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; is uniformly chosen from &amp;lt;math&amp;gt;{S\choose k}&amp;lt;/math&amp;gt;, thus&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[R\in\mathcal{F}]=\frac{|\mathcal{F}|}{{n\choose k}}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore,&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
|\mathcal{F}|\le\frac{k}{n}{n\choose k}={n-1\choose k-1}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== The averaging principle ===&lt;br /&gt;
&lt;br /&gt;
== The Probabilistic Method ==&lt;br /&gt;
&lt;br /&gt;
Suppose we want prove the existence of mathematic objects with certain properties. One way to do so is to explicitly construct such an object. This kind of proofs can be interpreted as &#039;&#039;deterministic algorithms&#039;&#039; which find the object with desirable properties.&lt;br /&gt;
&lt;br /&gt;
The probabilistic method provides another way of proving the existence of objects: instead of explicitly constructing an object, we define a probability space of objects in which the probability is positive that a randomly selected object has the required property.&lt;br /&gt;
&lt;br /&gt;
The basic principle of the probabilistic method is very simple, and can be stated in intuitive ways:&lt;br /&gt;
*If an object chosen randomly from a universe satisfies a property with positive probability, then there must be an object in the universe that satisfies that property.&lt;br /&gt;
:For example, for a ball(the object) randomly chosen from a box(the universe) of balls, if the probability that the chosen ball is blue(the property) is &amp;gt;0, then there must be a blue ball in the box.&lt;br /&gt;
*Any random variable assumes at least one value that is no smaller than its expectation, and at least one value that is no greater than the expectation.&lt;br /&gt;
:For example, if we know the average height of the students in the class is &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;, then we know there is a students whose height is at least &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;, and there is a student whose height is at most &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Although the idea of  the probabilistic method is simple, it provides us a powerful tool for existential proof. In same cases, the proof itself is a &#039;&#039;randomized algorithm&#039;&#039;, and if we are lucky, the algorithm could be very efficient.&lt;br /&gt;
&lt;br /&gt;
=== Sampling ===&lt;br /&gt;
;Ramsey number&lt;br /&gt;
&lt;br /&gt;
Recall the Ramsey theorem which states that in a meeting of at least six people, there are either three people knowing each other or three people not knowing each other. In graph theoretical terms, this means that no matter how we color the edges of &amp;lt;math&amp;gt;K_6&amp;lt;/math&amp;gt; (the complete graph on six vertices), there must be a &#039;&#039;&#039;monochromatic&#039;&#039;&#039; &amp;lt;math&amp;gt;K_3&amp;lt;/math&amp;gt; (a triangle whose edges have the same color).&lt;br /&gt;
&lt;br /&gt;
Generally, the &#039;&#039;&#039;Ramsey number&#039;&#039;&#039; &amp;lt;math&amp;gt;R(k,\ell)&amp;lt;/math&amp;gt; is the smallest integer &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; such that in any two-coloring of the edges of a complete graph on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; by red and blue, either there is a red &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; or there is a blue &amp;lt;math&amp;gt;K_\ell&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Ramsey showed in 1929 that &amp;lt;math&amp;gt;R(k,\ell)&amp;lt;/math&amp;gt; is finite for any &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;. It is extremely hard to compute the exact value of &amp;lt;math&amp;gt;R(k,\ell)&amp;lt;/math&amp;gt;. Here we give a lower bound of &amp;lt;math&amp;gt;R(k,k)&amp;lt;/math&amp;gt; by the probabilistic method.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem (Erdős 1947)|&lt;br /&gt;
:If &amp;lt;math&amp;gt;{n\choose k}\cdot 2^{1-{k\choose 2}}&amp;lt;1&amp;lt;/math&amp;gt; then it is possible to color the edges of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; with two colors so that there is no monochromatic &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; subgraph.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| Consider a random two-coloring of edges of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; obtained as follows:&lt;br /&gt;
* For each edge of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt;, independently flip a fair coin to decide the color of the edge.&lt;br /&gt;
&lt;br /&gt;
For any fixed set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; vertices, let &amp;lt;math&amp;gt;\mathcal{E}_S&amp;lt;/math&amp;gt; be the event that the &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; subgraph induced by &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is monochromatic. There are &amp;lt;math&amp;gt;{k\choose 2}&amp;lt;/math&amp;gt; many edges in &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt;, therefore&lt;br /&gt;
:&amp;lt;math&amp;gt;\Pr[\mathcal{E}_S]=2\cdot 2^{-{k\choose 2}}=2^{1-{k\choose 2}}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since there are &amp;lt;math&amp;gt;{n\choose k}&amp;lt;/math&amp;gt; possible choices of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;, by the union bound&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[\exists S, \mathcal{E}_S]\le {n\choose k}\cdot\Pr[\mathcal{E}_S]={n\choose k}\cdot 2^{1-{k\choose 2}}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Due to the assumption, &amp;lt;math&amp;gt;{n\choose k}\cdot 2^{1-{k\choose 2}}&amp;lt;1&amp;lt;/math&amp;gt;, thus there exists a two coloring that none of &amp;lt;math&amp;gt;\mathcal{E}_S&amp;lt;/math&amp;gt; occurs, which means  there is no monochromatic &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; subgraph.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;k\ge 3&amp;lt;/math&amp;gt; and we take &amp;lt;math&amp;gt;n=\lfloor2^{k/2}\rfloor&amp;lt;/math&amp;gt;, then&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
{n\choose k}\cdot 2^{1-{k\choose 2}}&lt;br /&gt;
&amp;amp;&amp;lt;&lt;br /&gt;
\frac{n^k}{k!}\cdot\frac{2^{1+\frac{k}{2}}}{2^{k^2/2}}\\&lt;br /&gt;
&amp;amp;\le &lt;br /&gt;
\frac{2^{k^2/2}}{k!}\cdot\frac{2^{1+\frac{k}{2}}}{2^{k^2/2}}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\frac{2^{1+\frac{k}{2}}}{k!}\\&lt;br /&gt;
&amp;amp;&amp;lt;1.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
By the above theorem, there exists a two-coloring of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; that there is no monochromatic &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt;. Therefore, the Ramsey number &amp;lt;math&amp;gt;R(k,k)&amp;gt;\lfloor2^{k/2}\rfloor&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;k\ge 3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that for sufficiently large &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n= \lfloor 2^{k/2}\rfloor&amp;lt;/math&amp;gt;, then the probability that there exists a monochromatic &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; is bounded by&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
{n\choose k}\cdot 2^{1-{k\choose 2}}&lt;br /&gt;
&amp;lt;&lt;br /&gt;
\frac{2^{1+\frac{k}{2}}}{k!}&lt;br /&gt;
\ll 1,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
which means that a random two-coloring of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; is very likely not to contain a monochromatic  &amp;lt;math&amp;gt;K_{2\log n}&amp;lt;/math&amp;gt;. This gives us a very simple randomized algorithm for finding a two-coloring of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; without monochromatic &amp;lt;math&amp;gt;K_{2\log n}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Blocking number&lt;br /&gt;
Let &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; be a set. Let &amp;lt;math&amp;gt;2^{S}=\{A\mid A\subseteq S\}&amp;lt;/math&amp;gt; be the power set of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;{S\choose k}=\{A\mid A\subseteq S\mbox{ and }|A|=k\}&amp;lt;/math&amp;gt; be the &#039;&#039;&#039;&amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-uniform&#039;&#039;&#039; of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
We call &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; a &#039;&#039;&#039;set family&#039;&#039;&#039; (or a &#039;&#039;&#039;set system&#039;&#039;&#039;)  with &#039;&#039;&#039;ground set&#039;&#039;&#039; &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; if &amp;lt;math&amp;gt;\mathcal{F}\subseteq 2^{S}&amp;lt;/math&amp;gt;. The members of &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; are subsets of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Given a set family &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; with ground set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;,&lt;br /&gt;
a set &amp;lt;math&amp;gt;T\subseteq S&amp;lt;/math&amp;gt; is a &#039;&#039;&#039;blocking set&#039;&#039;&#039; of &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; if all &amp;lt;math&amp;gt;A\in\mathcal{F}&amp;lt;/math&amp;gt; have &amp;lt;math&amp;gt;A\cap T\neq \emptyset&amp;lt;/math&amp;gt;, i.e. &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; intersects (blocks) all member set of &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem|&lt;br /&gt;
:Given a set family &amp;lt;math&amp;gt;\mathcal{F}\subseteq{S\choose k}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;m=|\mathcal{F}|&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n=|S|&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; has a blocking set of size &amp;lt;math&amp;gt;\left\lceil\frac{n\ln m}{k}\right\rceil&amp;lt;/math&amp;gt;. &lt;br /&gt;
}}&lt;br /&gt;
{{Proof| Let &amp;lt;math&amp;gt;\tau=\left\lceil\frac{n\ln m}{k}\right\rceil&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; be a set chosen uniformly at random from &amp;lt;math&amp;gt;{S\choose \tau}&amp;lt;/math&amp;gt;. We show that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is a blocking set of &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; with a probability &amp;gt;0.&lt;br /&gt;
&lt;br /&gt;
Fix any &amp;lt;math&amp;gt;A\in\mathcal{F}&amp;lt;/math&amp;gt;. Recall that &amp;lt;math&amp;gt;\mathcal{F}\subseteq{S\choose k}&amp;lt;/math&amp;gt;, thus &amp;lt;math&amp;gt;|A|=k&amp;lt;/math&amp;gt;. And&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Pr[A\cap T=\emptyset]&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\frac{\left|{S-A\choose \tau}\right|}{\left|{S\choose \tau}\right|}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\frac{{n-k\choose \tau}}{{n\choose\tau}}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\frac{(n-k)\cdot(n-k-1)\cdots(n-k-\tau+1)}{n\cdot(n-1)\cdots(n-\tau+1)}\\&lt;br /&gt;
&amp;amp;&amp;lt;&lt;br /&gt;
\left(1-\frac{k}{n}\right)^{\tau}\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\exp\left(-\frac{k\tau}{n}\right)\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\frac{1}{m}.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
By the union bound, the probability that there exists an &amp;lt;math&amp;gt;A\in\mathcal{F}&amp;lt;/math&amp;gt; that misses &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[\exists A\in\mathcal{F}, A\cap T=\emptyset]\le m\Pr[A\cap T=\emptyset]&amp;lt;m\cdot\frac{1}{m}=1.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Thus, the probability that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is a blocking set&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[\forall A\in\mathcal{F}, A\cap T\neq\emptyset]&amp;gt;0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
There exists a blocking set of size &amp;lt;math&amp;gt;\tau=\left\lceil\frac{n\ln m}{k}\right\rceil&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The theorem also hints us to a randomized algorithm. In order to make the algorithm efficient, we relax the size of &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\tau=\frac{2n\ln m}{k}&amp;lt;/math&amp;gt;. Uniformly choose &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; elements from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; to form the set &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, by the above analysis, the probability that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is NOT a blocking set is at most&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
m\exp\left(-\frac{n\tau}{k}\right)=m\exp(-2\ln m)=\frac{1}{m}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Thus, a blocking set is found with high probability.&lt;br /&gt;
&lt;br /&gt;
=== Linearity of expectation ===&lt;br /&gt;
&lt;br /&gt;
;Maximum cut&lt;br /&gt;
&lt;br /&gt;
Given an undirected graph &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt;, a set &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; of edges of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; is called a &#039;&#039;&#039;cut&#039;&#039;&#039; if &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; is disconnected after removing the edges in &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;. We can represent a cut by &amp;lt;math&amp;gt;c(S,T)&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;(S,T)&amp;lt;/math&amp;gt; is a bipartition of the vertex set &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;c(S,T)=\{uv\in E\mid u\in S,v\in T\}&amp;lt;/math&amp;gt; is the set of edges crossing between &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We have seen how to compute min-cut: either by deterministic max-flow algorithm, or by Karger&#039;s randomized algorithm. On the other hand, max-cut is hard to compute, because it is &#039;&#039;&#039;NP-complete&#039;&#039;&#039;. Actually, the weighted version of max-cut is among the [http://en.wikipedia.org/wiki/Karp&#039;s_21_NP-complete_problems Karp&#039;s 21 NP-complete problems].&lt;br /&gt;
&lt;br /&gt;
We now show by the probabilistic method that a max-cut always has at least half the edges.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem|&lt;br /&gt;
:Given an undirected graph &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices and &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; edges, there is a cut of size at least &amp;lt;math&amp;gt;\frac{m}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| Enumerate the vertices in an arbitrary order. Partition the vertex set &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; into two disjoint sets &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; as follows.&lt;br /&gt;
:For each vertex &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;,&lt;br /&gt;
:* independently choose one of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; with equal probability, and let &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; join the chosen set.&lt;br /&gt;
&lt;br /&gt;
For each vertex &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;X_v\in\{S,T\}&amp;lt;/math&amp;gt; be the random variable which represents the set that &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; joins. For each edge &amp;lt;math&amp;gt;uv\in E&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;Y_{uv}&amp;lt;/math&amp;gt; be the 0-1 random variable which indicates whether &amp;lt;math&amp;gt;uv&amp;lt;/math&amp;gt; crosses between &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. Clearly,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[Y_{uv}=1]=\Pr[X_u\neq X_v]=\frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The size of &amp;lt;math&amp;gt;c(S,T)&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;Y=\sum_{uv\in E}Y_{uv}&amp;lt;/math&amp;gt;. By the linearity of expectation,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[Y]=\sum_{uv\in E}\mathbf{E}[Y_{uv}]=\sum_{uv\in E}\Pr[Y_{uv}=1]=\frac{m}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore, there exist a bipartition &amp;lt;math&amp;gt;(S,T)&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;|c(S,T)|\ge\frac{m}{2}&amp;lt;/math&amp;gt;, i.e. there exists a cut of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; which contains at least &amp;lt;math&amp;gt;\frac{m}{2}&amp;lt;/math&amp;gt; edges.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Maximum satisfiability&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a number of boolean variables &amp;lt;math&amp;gt;x_1,x_2,\ldots,\in\{\mathrm{true},\mathrm{false}\}&amp;lt;/math&amp;gt;. A &#039;&#039;&#039;literal&#039;&#039;&#039; is either a variable &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; itself or its negation &amp;lt;math&amp;gt;\neg x_i&amp;lt;/math&amp;gt;. A logic expression is a &#039;&#039;&#039;conjunctive normal form (CNF)&#039;&#039;&#039; if it is written as the conjunction(AND) of a set of &#039;&#039;&#039;clauses&#039;&#039;&#039;, where each clause is a disjunction(OR) of literals. For example:&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
(x_1\vee \neg x_2 \vee \neg x_3)\wedge (\neg x_1\vee \neg x_3)\wedge (x_1\vee x_2\vee x_4)\wedge (x_4\vee \neg x_3)\wedge (x_4\vee \neg x_1).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The satisfiability (SAT) problem ask whether the CNF is satisfiable, i.e. there exists an assignment of variables to the values of true and false so that all clauses are true. The maximum satisfiability (MAXSAT) is the optimization version of SAT, which ask for an assignment that the number of satisfied clauses is maximized.&lt;br /&gt;
&lt;br /&gt;
SAT is the first problem known to be &#039;&#039;&#039;NP-complete&#039;&#039;&#039; (the Cook-Levin theorem). MAXSAT is also &#039;&#039;&#039;NP-complete&#039;&#039;&#039;. We then see that there always exists a roughly good truth assignment which satisfies half the clauses.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem|&lt;br /&gt;
:For any set of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; clauses, there is a truth assignment that satisfies at least &amp;lt;math&amp;gt;\frac{m}{2}&amp;lt;/math&amp;gt; clauses.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| For each variable, independently assign a random value in &amp;lt;math&amp;gt;\{\mathrm{true},\mathrm{false}\}&amp;lt;/math&amp;gt; with equal probability. For the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;th clause, let &amp;lt;math&amp;gt;X_i&amp;lt;/math&amp;gt; be the random variable which indicates whether the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;th clause is satisfied. Suppose that there are &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; literals in the clause. The probability that the clause is satisfied is &lt;br /&gt;
:&amp;lt;math&amp;gt;\Pr[X_k=1]\ge(1-2^{-k})\ge\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;X=\sum_{i=1}^m X_i&amp;lt;/math&amp;gt; be the number of satisfied clauses. By the linearity of expectation,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[X]=\sum_{i=1}^{m}\mathbf{E}[X_i]\ge \frac{m}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore, there exists an assignment such that at least &amp;lt;math&amp;gt;\frac{m}{2}&amp;lt;/math&amp;gt; clauses are satisfied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Alterations ===&lt;br /&gt;
;Independent sets&lt;br /&gt;
An independent set of a graph is a set of vertices with no edges between them. The following theorem gives a lower bound on the size of the largest independent set.&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt; be a graph on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices with &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; edges. Then &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; has an independent set with at least &amp;lt;math&amp;gt;\frac{n^2}{4m}&amp;lt;/math&amp;gt; vertices.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| Let &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; be a set of vertices constructed as follows:&lt;br /&gt;
:For each vertex &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;:&lt;br /&gt;
:* &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is included in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; independently with probability &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;,&lt;br /&gt;
&amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; to be determined.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;X=|S|&amp;lt;/math&amp;gt;. It is obvious that &amp;lt;math&amp;gt;\mathbf{E}[X]=np&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each edge &amp;lt;math&amp;gt;e\in E&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;Y_{e}&amp;lt;/math&amp;gt; be the random variable which indicates whether both endpoints of &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; are in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[Y_{uv}]=\Pr[u\in S\wedge v\in S]=p^2.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Let &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; be the number of edges in the subgraph of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; induced by &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. It holds that &amp;lt;math&amp;gt;Y=\sum_{e\in E}Y_e&amp;lt;/math&amp;gt;. By linearity of expectation,&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{E}[Y]=\sum_{e\in E}\mathbf{E}[Y_e]=mp^2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that although &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is not necessary an independent set, it can be modified to one if for each edge &amp;lt;math&amp;gt;e&amp;lt;/math&amp;gt; of the induced subgraph &amp;lt;math&amp;gt;G(S)&amp;lt;/math&amp;gt;, we delete one of the endpoint of &amp;lt;math&amp;gt;e&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt; be the resulting set. It is obvious that &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt; is an independent set since there is no edge left in the induced subgraph &amp;lt;math&amp;gt;G(S^*)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Since there are &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; edges in &amp;lt;math&amp;gt;G(S)&amp;lt;/math&amp;gt;, there are at most &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; vertices in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; are deleted to make it become &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt;. Therefore, &amp;lt;math&amp;gt;|S^*|\ge X-Y&amp;lt;/math&amp;gt;. By linearity of expectation,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[|S^*|]\ge\mathbf{E}[X-Y]=\mathbf{E}[X]-\mathbf{E}[Y]=np-mp^2.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
The expectation is maximized when &amp;lt;math&amp;gt;p=\frac{n}{2m}&amp;lt;/math&amp;gt;, thus&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[|S^*|]\ge n\cdot\frac{n}{2m}-m\left(\frac{n}{2m}\right)^2=\frac{n^2}{4m}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
There exists an independent set which contains at least &amp;lt;math&amp;gt;\frac{n^2}{4m}&amp;lt;/math&amp;gt; vertices.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The proof actually propose a randomized algorithm for constructing large independent set:&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Algorithm|&lt;br /&gt;
Given a graph on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices with &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; edges, let &amp;lt;math&amp;gt;d=\frac{2m}{n}&amp;lt;/math&amp;gt; be the average degree.&lt;br /&gt;
#For each vertex &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is included in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; independently with probability &amp;lt;math&amp;gt;\frac{1}{d}&amp;lt;/math&amp;gt;.&lt;br /&gt;
#For each remaining edge in the induced subgraph &amp;lt;math&amp;gt;G(S)&amp;lt;/math&amp;gt;, remove one of the endpoints from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt; be the resulting set. We have shown that &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt; is an independent set and &amp;lt;math&amp;gt;\mathbf{E}[|S^*|]\ge\frac{n^2}{4m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The Lovász Local Lemma ==&lt;br /&gt;
&lt;br /&gt;
Consider a set of &amp;quot;bad&amp;quot; events &amp;lt;math&amp;gt;A_1,A_2,\ldots,A_n&amp;lt;/math&amp;gt;. Suppose that &amp;lt;math&amp;gt;\Pr[A_i]\le p&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;1\le i\le n&amp;lt;/math&amp;gt;. We want to show that there is a situation that none of the bad events occurs. Due to the probabilistic method, we need to prove that&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]&amp;gt;0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
;Case 1&amp;lt;nowiki&amp;gt;: mutually independent events.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
If all the bad events &amp;lt;math&amp;gt;A_1,A_2,\ldots,A_n&amp;lt;/math&amp;gt; are mutually independent, then&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]\ge(1-p)^n&amp;gt;0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
for any &amp;lt;math&amp;gt;p&amp;lt;1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Case 2&amp;lt;nowiki&amp;gt;: arbitrarily dependent events.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
On the other hand, if we put no assumption on the dependencies between the events, then by the union bound (which holds unconditionally),&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]=1-\Pr\left[\bigvee_{i=1}^n A_i\right]\ge 1-np,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
which is not an interesting bound for &amp;lt;math&amp;gt;p\ge\frac{1}{n}&amp;lt;/math&amp;gt;. If we make no further assumption on the dependencies between the events, this bound is tight.&lt;br /&gt;
&lt;br /&gt;
;Example&lt;br /&gt;
:Consider that a ball is uniformly thrown into one of the &amp;lt;math&amp;gt;(n+1)&amp;lt;/math&amp;gt; bins. Let the &amp;quot;bad&amp;quot; events &amp;lt;math&amp;gt;A_1,A_2,\ldots,A_n&amp;lt;/math&amp;gt; be defined as that &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt; represents that the ball falls into the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;th bin. The only good event is that the ball falls into the &amp;lt;math&amp;gt;(n+1)&amp;lt;/math&amp;gt;th bin. Clearly, &amp;lt;math&amp;gt;\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]=1-n\cdot\frac{1}{n+1}&amp;lt;/math&amp;gt;. Thus the above union bound is achieved.&lt;br /&gt;
&lt;br /&gt;
This example shows that dependencies between the events could cause troubles.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would like to know what is going on between the two extreme cases: mutually independent events, and arbitrarily dependent events. The Lovász local lemma provides such a tool.&lt;br /&gt;
&lt;br /&gt;
=== The local lemma ===&lt;br /&gt;
The local lemma is powerful tool for showing the possibility of rare event under limited dependencies. The structure of dependencies between a set of events is described by a &#039;&#039;&#039;dependency graph&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Definition|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;A_1,A_2,\ldots,A_n&amp;lt;/math&amp;gt; be a set of events. A graph &amp;lt;math&amp;gt;D=(V,E)&amp;lt;/math&amp;gt; on the set of vertices &amp;lt;math&amp;gt;V=\{1,2,\ldots,n\}&amp;lt;/math&amp;gt; is called a &#039;&#039;&#039;dependency graph&#039;&#039;&#039; for the events &amp;lt;math&amp;gt;A_1,\ldots,A_n&amp;lt;/math&amp;gt; if for each &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;1\le i\le n&amp;lt;/math&amp;gt;, the event &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt; is mutually independent of all the events &amp;lt;math&amp;gt;\{A_j\mid (i,j)\not\in E\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
;Example&lt;br /&gt;
:Let &amp;lt;math&amp;gt;X_1,X_2,\ldots,X_m&amp;lt;/math&amp;gt; be a set of &#039;&#039;mutually independent&#039;&#039; random variables. Each event &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt; is a predicate defined on a number of variables among &amp;lt;math&amp;gt;X_1,X_2,\ldots,X_m&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;v(A_i)&amp;lt;/math&amp;gt; be the unique smallest set of variables which determine &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt;. The dependency graph &amp;lt;math&amp;gt;D=(V,E)&amp;lt;/math&amp;gt; is defined by &lt;br /&gt;
:::&amp;lt;math&amp;gt;(i,j)\in E&amp;lt;/math&amp;gt; iff &amp;lt;math&amp;gt;v(A_i)\cap v(A_j)\neq \emptyset&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This construction gives a general framework for the probability spaces with limited dependencies and is central to the constructive proof of the Lovász local lemma. In this example, each event is a predicate of variables, and the events are dependent if they depend on some common events.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following lemma, known as the Lovász local lemma, first proved by Erdős and Lovász in 1975, is an extremely powerful tool, as it supplies a way for dealing with rare events.&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem (The local lemma)|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;A_1,A_2,\ldots,A_n&amp;lt;/math&amp;gt; be a set of events, and assume that the following hold:&lt;br /&gt;
:#for all &amp;lt;math&amp;gt;1\le i\le n&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\Pr[A_i]\le p&amp;lt;/math&amp;gt;;&lt;br /&gt;
:#the maximum degree of the dependency graph for the events &amp;lt;math&amp;gt;A_1,A_2,\ldots,A_n&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;, and &lt;br /&gt;
:::&amp;lt;math&amp;gt;ep(d+1)\le 1&amp;lt;/math&amp;gt;.&lt;br /&gt;
:Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>172.16.65.101</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Existence,_the_probabilistic_method&amp;diff=3011</id>
		<title>Combinatorics (Fall 2010)/Existence, the probabilistic method</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Existence,_the_probabilistic_method&amp;diff=3011"/>
		<updated>2010-09-13T04:40:41Z</updated>

		<summary type="html">&lt;p&gt;172.16.65.101: /* The local lemma */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Counting arguments ==&lt;br /&gt;
;Circuit complexity&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;&#039;boolean function&#039;&#039;&#039; is a function is the form &amp;lt;math&amp;gt;f:\{0,1\}^n\rightarrow \{0,1\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Formally, a boolean circuit is a directed acyclic graph. Nodes with indegree zero are input nodes, labeled &amp;lt;math&amp;gt;x_1, x_2, \ldots , x_n&amp;lt;/math&amp;gt;. A circuit has a unique node with outdegree zero, called the output node. Every other node is a gate. There are three types of gates: AND, OR (both with indegree two), and NOT (with indegree one).&lt;br /&gt;
&lt;br /&gt;
Computations in Turing machines can be simulated by circuits, and any boolean function in &#039;&#039;&#039;P&#039;&#039;&#039; can be computed by a circuit with polynomially many gates. Thus, if we can find a function in &#039;&#039;&#039;NP&#039;&#039;&#039; that cannot be computed by any circuit with polynomially many gates, then &#039;&#039;&#039;NP&#039;&#039;&#039;&amp;lt;math&amp;gt;\neq&amp;lt;/math&amp;gt;&#039;&#039;&#039;P&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The following theorem due to Shannon says that functions with exponentially large circuit complexity do exist.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem (Shannon 1949)|&lt;br /&gt;
:There is a boolean function &amp;lt;math&amp;gt;f:\{0,1\}^n\rightarrow \{0,1\}&amp;lt;/math&amp;gt; with circuit complexity greater than &amp;lt;math&amp;gt;\frac{2^n}{3n}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| &lt;br /&gt;
We first count the number of boolean functions &amp;lt;math&amp;gt;f:\{0,1\}^n\rightarrow \{0,1\}&amp;lt;/math&amp;gt;. There are &amp;lt;math&amp;gt;2^{2^n}&amp;lt;/math&amp;gt; boolean functions &amp;lt;math&amp;gt;f:\{0,1\}^n\rightarrow \{0,1\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then we count the number of boolean circuit with fixed number of gates.&lt;br /&gt;
Fix an integer &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, we count the number of circuits with &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; gates. By the [http://en.wikipedia.org/wiki/De_Morgan&#039;s_laws De Morgan&#039;s laws], we can assume that all NOTs are pushed back to the inputs. Each gate has one of the two types (AND or OR), and has two inputs. Each of the inputs to a gate is either a constant 0 or 1, an input variable &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt;, an inverted input variable &amp;lt;math&amp;gt;\neg x_i&amp;lt;/math&amp;gt;, or the output of another gate; thus, there are at most &amp;lt;math&amp;gt;2+2n+t-1&amp;lt;/math&amp;gt; possible gate inputs. It follows that the number of circuits with &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; gates is at most &amp;lt;math&amp;gt;2^t(t+2n+1)^{2t}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;t=2^n/3n&amp;lt;/math&amp;gt;, then&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{2^t(t+2n+1)^{2t}}{2^{2^n}}=o(1)&amp;lt;1,&amp;lt;/math&amp;gt;      thus, &amp;lt;math&amp;gt;2^t(t+2n+1)^{2t} &amp;lt; 2^{2^n}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each boolean circuit computes one boolean function. Therefore, there must exist a boolean function &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; which cannot be computed by any circuits with &amp;lt;math&amp;gt;2^n/3n&amp;lt;/math&amp;gt; gates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Note that by Shannon&#039;s theorem, not only there exists a boolean function with exponentially large circuit complexity, but &#039;&#039;almost all&#039;&#039; boolean functions have exponentially large circuit complexity.&lt;br /&gt;
&lt;br /&gt;
=== Double counting ===&lt;br /&gt;
;Intersecting families;&lt;br /&gt;
&lt;br /&gt;
An &amp;lt;math&amp;gt;\mathcal{F}\subseteq 2^S&amp;lt;/math&amp;gt; is an &#039;&#039;&#039;intersecting&#039;&#039;&#039; family if for any &amp;lt;math&amp;gt;A,B\in\mathcal{F}&amp;lt;/math&amp;gt; it holds that &amp;lt;math&amp;gt;A\cap B\neq\emptyset&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Suppose that &amp;lt;math&amp;gt;n\ge 2k&amp;lt;/math&amp;gt;. For &amp;lt;math&amp;gt;\mathcal{F}\subseteq{S\choose k}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;|S|=n&amp;lt;/math&amp;gt;, we can let all &amp;lt;math&amp;gt;A\in \mathcal{F}&amp;lt;/math&amp;gt; contain one common element &amp;lt;math&amp;gt;a\in S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;A-\{a\}&amp;lt;/math&amp;gt; enumerates all &amp;lt;math&amp;gt;{n-1\choose k-1}&amp;lt;/math&amp;gt; possible combinations of &amp;lt;math&amp;gt;(k-1)&amp;lt;/math&amp;gt; elements in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. This gives us an intersecting family of size  &amp;lt;math&amp;gt;|\mathcal{F}|={n-1\choose k-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The following theorem says that this is the largest possible cardinality an intersecting &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; can achieve. The theorem was first proved by Erdős, Ko, and Rado in 1938, but published 23 years later. It is a fundamental result in the area of extremal set theory, which studies the maximum (or minimum) possible cardinality of a set system satisfying certain structural assumption. In this example, the structural assumption is intersecting.&lt;br /&gt;
&lt;br /&gt;
Here we present a probabilistic proof by Katona.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem (Erdős-Ko-Rado 1961)|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;\mathcal{F}\subseteq{S\choose k}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;|S|=n&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n\ge 2k&amp;lt;/math&amp;gt;. If &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; is an intersecting family then &amp;lt;math&amp;gt;|\mathcal{F}|\le{n-1\choose k-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| (due to Katona 1972).&lt;br /&gt;
&lt;br /&gt;
Without loss of generality, let &amp;lt;math&amp;gt;S=[n]&amp;lt;/math&amp;gt;.&lt;br /&gt;
For &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;A_i=\{(i+j)\bmod n\mid j\in[k]\}&amp;lt;/math&amp;gt;. Then we make the following claim.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Claim 1:&#039;&#039;&#039; &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; can contain at most &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; many &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
The claim can be easily proved by observing that for any &amp;lt;math&amp;gt;i,j\in[n]&amp;lt;/math&amp;gt; that &amp;lt;math&amp;gt;i&amp;lt;j&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;A_j&amp;lt;/math&amp;gt; are disjoint if &amp;lt;math&amp;gt;j-i&amp;gt;k&amp;lt;/math&amp;gt;, thus in order to make &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; intersecting, all &amp;lt;math&amp;gt;A_i,A_j\in\mathcal{F}&amp;lt;/math&amp;gt; have &amp;lt;math&amp;gt;|i-j|\le k&amp;lt;/math&amp;gt;. This is violated once there are more than &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; many &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now we prove the Erdős-Ko-Rado theorem. Let a permutation &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[n]&amp;lt;/math&amp;gt; and an integer &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt; be chosen uniformly and independently at random. Let &lt;br /&gt;
:&amp;lt;math&amp;gt;R=\{\sigma((i+j)\bmod n)\mid j\in[k]\}, \quad\mbox{ or equivalently }R=\sigma(A_i)&amp;lt;/math&amp;gt;. &lt;br /&gt;
By Claim 1, for any fixed permutation &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, the family &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; can contain at most &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; of the sets &amp;lt;math&amp;gt;\sigma(A_i)&amp;lt;/math&amp;gt;, thus conditioning on any particular &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\Pr[R\in\mathcal{F}\mid \sigma]\le\frac{k}{n}&amp;lt;/math&amp;gt;. Hence &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[R\in\mathcal{F}]\le\frac{k}{n}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
On the other hand, by our construction, &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; is uniformly chosen from &amp;lt;math&amp;gt;{S\choose k}&amp;lt;/math&amp;gt;, thus&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[R\in\mathcal{F}]=\frac{|\mathcal{F}|}{{n\choose k}}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore,&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
|\mathcal{F}|\le\frac{k}{n}{n\choose k}={n-1\choose k-1}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== The Probabilistic Method ==&lt;br /&gt;
&lt;br /&gt;
Suppose we want prove the existence of mathematic objects with certain properties. One way to do so is to explicitly construct such an object. This kind of proofs can be interpreted as &#039;&#039;deterministic algorithms&#039;&#039; which find the object with desirable properties.&lt;br /&gt;
&lt;br /&gt;
The probabilistic method provides another way of proving the existence of objects: instead of explicitly constructing an object, we define a probability space of objects in which the probability is positive that a randomly selected object has the required property.&lt;br /&gt;
&lt;br /&gt;
The basic principle of the probabilistic method is very simple, and can be stated in intuitive ways:&lt;br /&gt;
*If an object chosen randomly from a universe satisfies a property with positive probability, then there must be an object in the universe that satisfies that property.&lt;br /&gt;
:For example, for a ball(the object) randomly chosen from a box(the universe) of balls, if the probability that the chosen ball is blue(the property) is &amp;gt;0, then there must be a blue ball in the box.&lt;br /&gt;
*Any random variable assumes at least one value that is no smaller than its expectation, and at least one value that is no greater than the expectation.&lt;br /&gt;
:For example, if we know the average height of the students in the class is &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;, then we know there is a students whose height is at least &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;, and there is a student whose height is at most &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Although the idea of  the probabilistic method is simple, it provides us a powerful tool for existential proof. In same cases, the proof itself is a &#039;&#039;randomized algorithm&#039;&#039;, and if we are lucky, the algorithm could be very efficient.&lt;br /&gt;
&lt;br /&gt;
=== Sampling ===&lt;br /&gt;
;Ramsey number&lt;br /&gt;
&lt;br /&gt;
Recall the Ramsey theorem which states that in a meeting of at least six people, there are either three people knowing each other or three people not knowing each other. In graph theoretical terms, this means that no matter how we color the edges of &amp;lt;math&amp;gt;K_6&amp;lt;/math&amp;gt; (the complete graph on six vertices), there must be a &#039;&#039;&#039;monochromatic&#039;&#039;&#039; &amp;lt;math&amp;gt;K_3&amp;lt;/math&amp;gt; (a triangle whose edges have the same color).&lt;br /&gt;
&lt;br /&gt;
Generally, the &#039;&#039;&#039;Ramsey number&#039;&#039;&#039; &amp;lt;math&amp;gt;R(k,\ell)&amp;lt;/math&amp;gt; is the smallest integer &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; such that in any two-coloring of the edges of a complete graph on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; by red and blue, either there is a red &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; or there is a blue &amp;lt;math&amp;gt;K_\ell&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Ramsey showed in 1929 that &amp;lt;math&amp;gt;R(k,\ell)&amp;lt;/math&amp;gt; is finite for any &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\ell&amp;lt;/math&amp;gt;. It is extremely hard to compute the exact value of &amp;lt;math&amp;gt;R(k,\ell)&amp;lt;/math&amp;gt;. Here we give a lower bound of &amp;lt;math&amp;gt;R(k,k)&amp;lt;/math&amp;gt; by the probabilistic method.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem (Erdős 1947)|&lt;br /&gt;
:If &amp;lt;math&amp;gt;{n\choose k}\cdot 2^{1-{k\choose 2}}&amp;lt;1&amp;lt;/math&amp;gt; then it is possible to color the edges of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; with two colors so that there is no monochromatic &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; subgraph.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| Consider a random two-coloring of edges of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; obtained as follows:&lt;br /&gt;
* For each edge of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt;, independently flip a fair coin to decide the color of the edge.&lt;br /&gt;
&lt;br /&gt;
For any fixed set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; vertices, let &amp;lt;math&amp;gt;\mathcal{E}_S&amp;lt;/math&amp;gt; be the event that the &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; subgraph induced by &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is monochromatic. There are &amp;lt;math&amp;gt;{k\choose 2}&amp;lt;/math&amp;gt; many edges in &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt;, therefore&lt;br /&gt;
:&amp;lt;math&amp;gt;\Pr[\mathcal{E}_S]=2\cdot 2^{-{k\choose 2}}=2^{1-{k\choose 2}}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since there are &amp;lt;math&amp;gt;{n\choose k}&amp;lt;/math&amp;gt; possible choices of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;, by the union bound&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[\exists S, \mathcal{E}_S]\le {n\choose k}\cdot\Pr[\mathcal{E}_S]={n\choose k}\cdot 2^{1-{k\choose 2}}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Due to the assumption, &amp;lt;math&amp;gt;{n\choose k}\cdot 2^{1-{k\choose 2}}&amp;lt;1&amp;lt;/math&amp;gt;, thus there exists a two coloring that none of &amp;lt;math&amp;gt;\mathcal{E}_S&amp;lt;/math&amp;gt; occurs, which means  there is no monochromatic &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; subgraph.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;k\ge 3&amp;lt;/math&amp;gt; and we take &amp;lt;math&amp;gt;n=\lfloor2^{k/2}\rfloor&amp;lt;/math&amp;gt;, then&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
{n\choose k}\cdot 2^{1-{k\choose 2}}&lt;br /&gt;
&amp;amp;&amp;lt;&lt;br /&gt;
\frac{n^k}{k!}\cdot\frac{2^{1+\frac{k}{2}}}{2^{k^2/2}}\\&lt;br /&gt;
&amp;amp;\le &lt;br /&gt;
\frac{2^{k^2/2}}{k!}\cdot\frac{2^{1+\frac{k}{2}}}{2^{k^2/2}}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\frac{2^{1+\frac{k}{2}}}{k!}\\&lt;br /&gt;
&amp;amp;&amp;lt;1.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
By the above theorem, there exists a two-coloring of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; that there is no monochromatic &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt;. Therefore, the Ramsey number &amp;lt;math&amp;gt;R(k,k)&amp;gt;\lfloor2^{k/2}\rfloor&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;k\ge 3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that for sufficiently large &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n= \lfloor 2^{k/2}\rfloor&amp;lt;/math&amp;gt;, then the probability that there exists a monochromatic &amp;lt;math&amp;gt;K_k&amp;lt;/math&amp;gt; is bounded by&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
{n\choose k}\cdot 2^{1-{k\choose 2}}&lt;br /&gt;
&amp;lt;&lt;br /&gt;
\frac{2^{1+\frac{k}{2}}}{k!}&lt;br /&gt;
\ll 1,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
which means that a random two-coloring of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; is very likely not to contain a monochromatic  &amp;lt;math&amp;gt;K_{2\log n}&amp;lt;/math&amp;gt;. This gives us a very simple randomized algorithm for finding a two-coloring of &amp;lt;math&amp;gt;K_n&amp;lt;/math&amp;gt; without monochromatic &amp;lt;math&amp;gt;K_{2\log n}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Blocking number&lt;br /&gt;
Let &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; be a set. Let &amp;lt;math&amp;gt;2^{S}=\{A\mid A\subseteq S\}&amp;lt;/math&amp;gt; be the power set of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;{S\choose k}=\{A\mid A\subseteq S\mbox{ and }|A|=k\}&amp;lt;/math&amp;gt; be the &#039;&#039;&#039;&amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-uniform&#039;&#039;&#039; of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
We call &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; a &#039;&#039;&#039;set family&#039;&#039;&#039; (or a &#039;&#039;&#039;set system&#039;&#039;&#039;)  with &#039;&#039;&#039;ground set&#039;&#039;&#039; &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; if &amp;lt;math&amp;gt;\mathcal{F}\subseteq 2^{S}&amp;lt;/math&amp;gt;. The members of &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; are subsets of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Given a set family &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; with ground set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;,&lt;br /&gt;
a set &amp;lt;math&amp;gt;T\subseteq S&amp;lt;/math&amp;gt; is a &#039;&#039;&#039;blocking set&#039;&#039;&#039; of &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; if all &amp;lt;math&amp;gt;A\in\mathcal{F}&amp;lt;/math&amp;gt; have &amp;lt;math&amp;gt;A\cap T\neq \emptyset&amp;lt;/math&amp;gt;, i.e. &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; intersects (blocks) all member set of &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem|&lt;br /&gt;
:Given a set family &amp;lt;math&amp;gt;\mathcal{F}\subseteq{S\choose k}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;m=|\mathcal{F}|&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n=|S|&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; has a blocking set of size &amp;lt;math&amp;gt;\left\lceil\frac{n\ln m}{k}\right\rceil&amp;lt;/math&amp;gt;. &lt;br /&gt;
}}&lt;br /&gt;
{{Proof| Let &amp;lt;math&amp;gt;\tau=\left\lceil\frac{n\ln m}{k}\right\rceil&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; be a set chosen uniformly at random from &amp;lt;math&amp;gt;{S\choose \tau}&amp;lt;/math&amp;gt;. We show that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is a blocking set of &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; with a probability &amp;gt;0.&lt;br /&gt;
&lt;br /&gt;
Fix any &amp;lt;math&amp;gt;A\in\mathcal{F}&amp;lt;/math&amp;gt;. Recall that &amp;lt;math&amp;gt;\mathcal{F}\subseteq{S\choose k}&amp;lt;/math&amp;gt;, thus &amp;lt;math&amp;gt;|A|=k&amp;lt;/math&amp;gt;. And&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Pr[A\cap T=\emptyset]&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\frac{\left|{S-A\choose \tau}\right|}{\left|{S\choose \tau}\right|}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\frac{{n-k\choose \tau}}{{n\choose\tau}}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\frac{(n-k)\cdot(n-k-1)\cdots(n-k-\tau+1)}{n\cdot(n-1)\cdots(n-\tau+1)}\\&lt;br /&gt;
&amp;amp;&amp;lt;&lt;br /&gt;
\left(1-\frac{k}{n}\right)^{\tau}\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\exp\left(-\frac{k\tau}{n}\right)\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\frac{1}{m}.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
By the union bound, the probability that there exists an &amp;lt;math&amp;gt;A\in\mathcal{F}&amp;lt;/math&amp;gt; that misses &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[\exists A\in\mathcal{F}, A\cap T=\emptyset]\le m\Pr[A\cap T=\emptyset]&amp;lt;m\cdot\frac{1}{m}=1.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Thus, the probability that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is a blocking set&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[\forall A\in\mathcal{F}, A\cap T\neq\emptyset]&amp;gt;0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
There exists a blocking set of size &amp;lt;math&amp;gt;\tau=\left\lceil\frac{n\ln m}{k}\right\rceil&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The theorem also hints us to a randomized algorithm. In order to make the algorithm efficient, we relax the size of &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\tau=\frac{2n\ln m}{k}&amp;lt;/math&amp;gt;. Uniformly choose &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; elements from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; to form the set &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, by the above analysis, the probability that &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is NOT a blocking set is at most&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
m\exp\left(-\frac{n\tau}{k}\right)=m\exp(-2\ln m)=\frac{1}{m}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Thus, a blocking set is found with high probability.&lt;br /&gt;
&lt;br /&gt;
=== Linearity of expectation ===&lt;br /&gt;
&lt;br /&gt;
;Maximum cut&lt;br /&gt;
&lt;br /&gt;
Given an undirected graph &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt;, a set &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; of edges of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; is called a &#039;&#039;&#039;cut&#039;&#039;&#039; if &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; is disconnected after removing the edges in &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;. We can represent a cut by &amp;lt;math&amp;gt;c(S,T)&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;(S,T)&amp;lt;/math&amp;gt; is a bipartition of the vertex set &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;c(S,T)=\{uv\in E\mid u\in S,v\in T\}&amp;lt;/math&amp;gt; is the set of edges crossing between &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We have seen how to compute min-cut: either by deterministic max-flow algorithm, or by Karger&#039;s randomized algorithm. On the other hand, max-cut is hard to compute, because it is &#039;&#039;&#039;NP-complete&#039;&#039;&#039;. Actually, the weighted version of max-cut is among the [http://en.wikipedia.org/wiki/Karp&#039;s_21_NP-complete_problems Karp&#039;s 21 NP-complete problems].&lt;br /&gt;
&lt;br /&gt;
We now show by the probabilistic method that a max-cut always has at least half the edges.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem|&lt;br /&gt;
:Given an undirected graph &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices and &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; edges, there is a cut of size at least &amp;lt;math&amp;gt;\frac{m}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| Enumerate the vertices in an arbitrary order. Partition the vertex set &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; into two disjoint sets &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; as follows.&lt;br /&gt;
:For each vertex &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;,&lt;br /&gt;
:* independently choose one of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; with equal probability, and let &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; join the chosen set.&lt;br /&gt;
&lt;br /&gt;
For each vertex &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;X_v\in\{S,T\}&amp;lt;/math&amp;gt; be the random variable which represents the set that &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; joins. For each edge &amp;lt;math&amp;gt;uv\in E&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;Y_{uv}&amp;lt;/math&amp;gt; be the 0-1 random variable which indicates whether &amp;lt;math&amp;gt;uv&amp;lt;/math&amp;gt; crosses between &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. Clearly,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[Y_{uv}=1]=\Pr[X_u\neq X_v]=\frac{1}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The size of &amp;lt;math&amp;gt;c(S,T)&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;Y=\sum_{uv\in E}Y_{uv}&amp;lt;/math&amp;gt;. By the linearity of expectation,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[Y]=\sum_{uv\in E}\mathbf{E}[Y_{uv}]=\sum_{uv\in E}\Pr[Y_{uv}=1]=\frac{m}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore, there exist a bipartition &amp;lt;math&amp;gt;(S,T)&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;|c(S,T)|\ge\frac{m}{2}&amp;lt;/math&amp;gt;, i.e. there exists a cut of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; which contains at least &amp;lt;math&amp;gt;\frac{m}{2}&amp;lt;/math&amp;gt; edges.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Maximum satisfiability&lt;br /&gt;
&lt;br /&gt;
Suppose that we have a number of boolean variables &amp;lt;math&amp;gt;x_1,x_2,\ldots,\in\{\mathrm{true},\mathrm{false}\}&amp;lt;/math&amp;gt;. A &#039;&#039;&#039;literal&#039;&#039;&#039; is either a variable &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; itself or its negation &amp;lt;math&amp;gt;\neg x_i&amp;lt;/math&amp;gt;. A logic expression is a &#039;&#039;&#039;conjunctive normal form (CNF)&#039;&#039;&#039; if it is written as the conjunction(AND) of a set of &#039;&#039;&#039;clauses&#039;&#039;&#039;, where each clause is a disjunction(OR) of literals. For example:&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
(x_1\vee \neg x_2 \vee \neg x_3)\wedge (\neg x_1\vee \neg x_3)\wedge (x_1\vee x_2\vee x_4)\wedge (x_4\vee \neg x_3)\wedge (x_4\vee \neg x_1).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The satisfiability (SAT) problem ask whether the CNF is satisfiable, i.e. there exists an assignment of variables to the values of true and false so that all clauses are true. The maximum satisfiability (MAXSAT) is the optimization version of SAT, which ask for an assignment that the number of satisfied clauses is maximized.&lt;br /&gt;
&lt;br /&gt;
SAT is the first problem known to be &#039;&#039;&#039;NP-complete&#039;&#039;&#039; (the Cook-Levin theorem). MAXSAT is also &#039;&#039;&#039;NP-complete&#039;&#039;&#039;. We then see that there always exists a roughly good truth assignment which satisfies half the clauses.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem|&lt;br /&gt;
:For any set of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; clauses, there is a truth assignment that satisfies at least &amp;lt;math&amp;gt;\frac{m}{2}&amp;lt;/math&amp;gt; clauses.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| For each variable, independently assign a random value in &amp;lt;math&amp;gt;\{\mathrm{true},\mathrm{false}\}&amp;lt;/math&amp;gt; with equal probability. For the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;th clause, let &amp;lt;math&amp;gt;X_i&amp;lt;/math&amp;gt; be the random variable which indicates whether the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;th clause is satisfied. Suppose that there are &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; literals in the clause. The probability that the clause is satisfied is &lt;br /&gt;
:&amp;lt;math&amp;gt;\Pr[X_k=1]\ge(1-2^{-k})\ge\frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;X=\sum_{i=1}^m X_i&amp;lt;/math&amp;gt; be the number of satisfied clauses. By the linearity of expectation,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[X]=\sum_{i=1}^{m}\mathbf{E}[X_i]\ge \frac{m}{2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore, there exists an assignment such that at least &amp;lt;math&amp;gt;\frac{m}{2}&amp;lt;/math&amp;gt; clauses are satisfied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Alterations ===&lt;br /&gt;
;Independent sets&lt;br /&gt;
An independent set of a graph is a set of vertices with no edges between them. The following theorem gives a lower bound on the size of the largest independent set.&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt; be a graph on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices with &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; edges. Then &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; has an independent set with at least &amp;lt;math&amp;gt;\frac{n^2}{4m}&amp;lt;/math&amp;gt; vertices.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof| Let &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; be a set of vertices constructed as follows:&lt;br /&gt;
:For each vertex &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;:&lt;br /&gt;
:* &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is included in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; independently with probability &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;,&lt;br /&gt;
&amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; to be determined.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;X=|S|&amp;lt;/math&amp;gt;. It is obvious that &amp;lt;math&amp;gt;\mathbf{E}[X]=np&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each edge &amp;lt;math&amp;gt;e\in E&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;Y_{e}&amp;lt;/math&amp;gt; be the random variable which indicates whether both endpoints of &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; are in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[Y_{uv}]=\Pr[u\in S\wedge v\in S]=p^2.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Let &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; be the number of edges in the subgraph of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; induced by &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. It holds that &amp;lt;math&amp;gt;Y=\sum_{e\in E}Y_e&amp;lt;/math&amp;gt;. By linearity of expectation,&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{E}[Y]=\sum_{e\in E}\mathbf{E}[Y_e]=mp^2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that although &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is not necessary an independent set, it can be modified to one if for each edge &amp;lt;math&amp;gt;e&amp;lt;/math&amp;gt; of the induced subgraph &amp;lt;math&amp;gt;G(S)&amp;lt;/math&amp;gt;, we delete one of the endpoint of &amp;lt;math&amp;gt;e&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt; be the resulting set. It is obvious that &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt; is an independent set since there is no edge left in the induced subgraph &amp;lt;math&amp;gt;G(S^*)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Since there are &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; edges in &amp;lt;math&amp;gt;G(S)&amp;lt;/math&amp;gt;, there are at most &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; vertices in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; are deleted to make it become &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt;. Therefore, &amp;lt;math&amp;gt;|S^*|\ge X-Y&amp;lt;/math&amp;gt;. By linearity of expectation,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[|S^*|]\ge\mathbf{E}[X-Y]=\mathbf{E}[X]-\mathbf{E}[Y]=np-mp^2.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
The expectation is maximized when &amp;lt;math&amp;gt;p=\frac{n}{2m}&amp;lt;/math&amp;gt;, thus&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[|S^*|]\ge n\cdot\frac{n}{2m}-m\left(\frac{n}{2m}\right)^2=\frac{n^2}{4m}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
There exists an independent set which contains at least &amp;lt;math&amp;gt;\frac{n^2}{4m}&amp;lt;/math&amp;gt; vertices.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The proof actually propose a randomized algorithm for constructing large independent set:&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Algorithm|&lt;br /&gt;
Given a graph on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; vertices with &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; edges, let &amp;lt;math&amp;gt;d=\frac{2m}{n}&amp;lt;/math&amp;gt; be the average degree.&lt;br /&gt;
#For each vertex &amp;lt;math&amp;gt;v\in V&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is included in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; independently with probability &amp;lt;math&amp;gt;\frac{1}{d}&amp;lt;/math&amp;gt;.&lt;br /&gt;
#For each remaining edge in the induced subgraph &amp;lt;math&amp;gt;G(S)&amp;lt;/math&amp;gt;, remove one of the endpoints from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt; be the resulting set. We have shown that &amp;lt;math&amp;gt;S^*&amp;lt;/math&amp;gt; is an independent set and &amp;lt;math&amp;gt;\mathbf{E}[|S^*|]\ge\frac{n^2}{4m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The Lovász Local Lemma ==&lt;br /&gt;
&lt;br /&gt;
Consider a set of &amp;quot;bad&amp;quot; events &amp;lt;math&amp;gt;A_1,A_2,\ldots,A_n&amp;lt;/math&amp;gt;. Suppose that &amp;lt;math&amp;gt;\Pr[A_i]\le p&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;1\le i\le n&amp;lt;/math&amp;gt;. We want to show that there is a situation that none of the bad events occurs. Due to the probabilistic method, we need to prove that&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]&amp;gt;0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
;Case 1&amp;lt;nowiki&amp;gt;: mutually independent events.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
If all the bad events &amp;lt;math&amp;gt;A_1,A_2,\ldots,A_n&amp;lt;/math&amp;gt; are mutually independent, then&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]\ge(1-p)^n&amp;gt;0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
for any &amp;lt;math&amp;gt;p&amp;lt;1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Case 2&amp;lt;nowiki&amp;gt;: arbitrarily dependent events.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
On the other hand, if we put no assumption on the dependencies between the events, then by the union bound (which holds unconditionally),&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]=1-\Pr\left[\bigvee_{i=1}^n A_i\right]\ge 1-np,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
which is not an interesting bound for &amp;lt;math&amp;gt;p\ge\frac{1}{n}&amp;lt;/math&amp;gt;. If we make no further assumption on the dependencies between the events, this bound is tight.&lt;br /&gt;
&lt;br /&gt;
;Example&lt;br /&gt;
:Consider that a ball is uniformly thrown into one of the &amp;lt;math&amp;gt;(n+1)&amp;lt;/math&amp;gt; bins. Let the &amp;quot;bad&amp;quot; events &amp;lt;math&amp;gt;A_1,A_2,\ldots,A_n&amp;lt;/math&amp;gt; be defined as that &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt; represents that the ball falls into the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;th bin. The only good event is that the ball falls into the &amp;lt;math&amp;gt;(n+1)&amp;lt;/math&amp;gt;th bin. Clearly, &amp;lt;math&amp;gt;\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]=1-n\cdot\frac{1}{n+1}&amp;lt;/math&amp;gt;. Thus the above union bound is achieved.&lt;br /&gt;
&lt;br /&gt;
This example shows that dependencies between the events could cause troubles.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would like to know what is going on between the two extreme cases: mutually independent events, and arbitrarily dependent events. The Lovász local lemma provides such a tool.&lt;br /&gt;
&lt;br /&gt;
=== The local lemma ===&lt;br /&gt;
The local lemma is powerful tool for showing the possibility of rare event under limited dependencies. The structure of dependencies between a set of events is described by a &#039;&#039;&#039;dependency graph&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Definition|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;A_1,A_2,\ldots,A_n&amp;lt;/math&amp;gt; be a set of events. A graph &amp;lt;math&amp;gt;D=(V,E)&amp;lt;/math&amp;gt; on the set of vertices &amp;lt;math&amp;gt;V=\{1,2,\ldots,n\}&amp;lt;/math&amp;gt; is called a &#039;&#039;&#039;dependency graph&#039;&#039;&#039; for the events &amp;lt;math&amp;gt;A_1,\ldots,A_n&amp;lt;/math&amp;gt; if for each &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;1\le i\le n&amp;lt;/math&amp;gt;, the event &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt; is mutually independent of all the events &amp;lt;math&amp;gt;\{A_j\mid (i,j)\not\in E\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
;Example&lt;br /&gt;
:Let &amp;lt;math&amp;gt;X_1,X_2,\ldots,X_m&amp;lt;/math&amp;gt; be a set of &#039;&#039;mutually independent&#039;&#039; random variables. Each event &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt; is a predicate defined on a number of variables among &amp;lt;math&amp;gt;X_1,X_2,\ldots,X_m&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;v(A_i)&amp;lt;/math&amp;gt; be the unique smallest set of variables which determine &amp;lt;math&amp;gt;A_i&amp;lt;/math&amp;gt;. The dependency graph &amp;lt;math&amp;gt;D=(V,E)&amp;lt;/math&amp;gt; is defined by &lt;br /&gt;
:::&amp;lt;math&amp;gt;(i,j)\in E&amp;lt;/math&amp;gt; iff &amp;lt;math&amp;gt;v(A_i)\cap v(A_j)\neq \emptyset&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This construction gives a general framework for the probability spaces with limited dependencies and is central to the constructive proof of the Lovász local lemma. In this example, each event is a predicate of variables, and the events are dependent if they depend on some common events.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following lemma, known as the Lovász local lemma, first proved by Erdős and Lovász in 1975, is an extremely powerful tool, as it supplies a way for dealing with rare events.&lt;br /&gt;
{{Theorem&lt;br /&gt;
|Theorem (The local lemma)|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;A_1,A_2,\ldots,A_n&amp;lt;/math&amp;gt; be a set of events, and assume that the following hold:&lt;br /&gt;
:#for all &amp;lt;math&amp;gt;1\le i\le n&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\Pr[A_i]\le p&amp;lt;/math&amp;gt;;&lt;br /&gt;
:#the maximum degree of the dependency graph for the events &amp;lt;math&amp;gt;A_1,A_2,\ldots,A_n&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;, and &lt;br /&gt;
:::&amp;lt;math&amp;gt;ep(d+1)\le 1&amp;lt;/math&amp;gt;.&lt;br /&gt;
:Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>172.16.65.101</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Approximate_counting,_linear_programming&amp;diff=2448</id>
		<title>Randomized Algorithms (Spring 2010)/Approximate counting, linear programming</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Approximate_counting,_linear_programming&amp;diff=2448"/>
		<updated>2010-05-24T08:49:25Z</updated>

		<summary type="html">&lt;p&gt;172.16.65.36: /* Approximate Counting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Counting Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Complexity model ===&lt;br /&gt;
&lt;br /&gt;
=== FPRAS ===&lt;br /&gt;
&lt;br /&gt;
== Approximate Counting ==&lt;br /&gt;
Let us consider the following abstract problem.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; be a finite set of known size, and let &amp;lt;math&amp;gt;G\subseteq U&amp;lt;/math&amp;gt;. We want to compute the size of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;, namely &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We assume two devices:&lt;br /&gt;
* A &#039;&#039;&#039;uniform sampler&#039;&#039;&#039; &amp;lt;math&amp;gt;\mathcal{U}&amp;lt;/math&amp;gt;, which uniformly and independently samples a member of &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; upon each calling.&lt;br /&gt;
* A &#039;&#039;&#039;membership oracle&#039;&#039;&#039; of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;, denoted &amp;lt;math&amp;gt;\mathcal{O}&amp;lt;/math&amp;gt;. Given as the input an &amp;lt;math&amp;gt;x\in U&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\mathcal{O}(x)&amp;lt;/math&amp;gt; indicates whether or not &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is a member of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Equipped by &amp;lt;math&amp;gt;\mathcal{U}&amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;\mathcal{O}&amp;lt;/math&amp;gt;, we can have the following Monte Carlo algorithm:&lt;br /&gt;
*Choose &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; independent samples from &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt;by the uniform sampler &amp;lt;math&amp;gt;\mathcal{U}&amp;lt;/math&amp;gt;, represented by the random variables &amp;lt;math&amp;gt;X_1,X_2,\ldots, X_N&amp;lt;/math&amp;gt;. &lt;br /&gt;
* Let &amp;lt;math&amp;gt;Y_i&amp;lt;/math&amp;gt; be the indicator random variable defined as &amp;lt;math&amp;gt;Y_i=\mathcal{O}(X_i)&amp;lt;/math&amp;gt;, namely, &amp;lt;math&amp;gt;Y_i&amp;lt;/math&amp;gt; indicates whether &amp;lt;math&amp;gt;X_i\in G&amp;lt;/math&amp;gt;.&lt;br /&gt;
* Define the estimator random variable&lt;br /&gt;
::&amp;lt;math&amp;gt;Z=\frac{|U|}{N}\sum_{i=1}^N Y_i.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is easy to see that &amp;lt;math&amp;gt;\mathbf{E}[Z]=|G|&amp;lt;/math&amp;gt; and we might hope that with high probability the value of &amp;lt;math&amp;gt;Z&amp;lt;/math&amp;gt; is close to &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt;. Formally, &amp;lt;math&amp;gt;Z&amp;lt;/math&amp;gt; is called an &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;-approximation of &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt; if&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
(1-\epsilon)|G|\le Z\le (1+\epsilon)|G|.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following theorem states that the probabilistic accuracy of the estimation depends on the number of samples and the ratio between &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;|U|&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Theorem (estimator theorem)&#039;&#039;&#039;&lt;br /&gt;
:Let &amp;lt;math&amp;gt;\alpha=\frac{|G|}{|U|}&amp;lt;/math&amp;gt;. Then the Monte Carlo method yields an &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;-approximation to &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt; with probability at least &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt; provided&lt;br /&gt;
::&amp;lt;math&amp;gt;N\ge\frac{4}{\epsilon \alpha}\ln\frac{2}{\delta}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Proof&#039;&#039;&#039;: Use the Chernoff bound.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\square&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A counting algorithm for the set &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; has to deal with the following three complications:&lt;br /&gt;
* Implement the membership oracle &amp;lt;math&amp;gt;\mathcal{O}&amp;lt;/math&amp;gt;. This is usually straightforward, or assumed by the model.&lt;br /&gt;
* Implement the uniform sampler &amp;lt;math&amp;gt;\mathcal{U}&amp;lt;/math&amp;gt;. As we have seen, this is usually approximated by random walks. How to design the random walk and bound its mixing rate is usually technical challenging, if possible at all.&lt;br /&gt;
* Deal with exponentially small &amp;lt;math&amp;gt;\alpha=\frac{|G|}{|U|}&amp;lt;/math&amp;gt;. This requires us to cleverly choose the universe &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt;. Sometimes this needs some nontrivial ideas.&lt;br /&gt;
&lt;br /&gt;
=== Counting DNFs ===&lt;br /&gt;
A disjunctive normal form (DNF) formular is a disjunction (OR) of clauses, where each clause is a conjunction (AND) of literals. For example:&lt;br /&gt;
:&amp;lt;math&amp;gt;(x_1\wedge \overline{x_2}\wedge x_3)\vee(x_2\wedge x_4)\vee(\overline{x_1}\wedge x_3\wedge x_4)&amp;lt;/math&amp;gt;.&lt;br /&gt;
Note the difference from the conjunctive normal forms (CNF).&lt;br /&gt;
&lt;br /&gt;
Given a DNF formular &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; as the input, the problem is to count the number of satisfying assignments of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;. This problem is &#039;&#039;&#039;#P-complete&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Naively applying the Monte Carlo method will not give a good answer. Suppose that there are &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; variables. Let &amp;lt;math&amp;gt;U=\{\mathrm{true},\mathrm{false}\}^n&amp;lt;/math&amp;gt; be the set of all truth assignments of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; variables. Let &amp;lt;math&amp;gt;G=\{x\in U\mid \phi(x)=\mathrm{true}\}&amp;lt;/math&amp;gt; be the set of satisfying assignments for &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;. The straightforward use of Monte Carlo method samples &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; assignments from &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; and check how many of them satisfy &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;. This algorithm fails when &amp;lt;math&amp;gt;|G|/|U|&amp;lt;/math&amp;gt; is exponentially small, namely, when exponentially small fraction of the assignments satisfy the input DNF formula. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;The union of sets problem&lt;br /&gt;
We reformulate the DNF counting problem in a more abstract framework, called the &#039;&#039;&#039;union of sets&#039;&#039;&#039; problem. &lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; be a finite universe. We are given &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; subsets &amp;lt;math&amp;gt;H_1,H_2,\ldots,H_m\subseteq V&amp;lt;/math&amp;gt;. The following assumptions hold:&lt;br /&gt;
*For all &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;|H_i|&amp;lt;/math&amp;gt; is computable in poly-time.&lt;br /&gt;
*It is possible to sample uniformly from each individual &amp;lt;math&amp;gt;H_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
*For any &amp;lt;math&amp;gt;x\in V&amp;lt;/math&amp;gt;, it can be determined in poly-time whether &amp;lt;math&amp;gt;x\in H_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The goal is to compute the size of &amp;lt;math&amp;gt;H=\bigcup_{i=1}^m H_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
DNF counting can be interpreted in this general framework as follows. Suppose that the DNF formula &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is defined on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; variables, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; contains &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; clauses &amp;lt;math&amp;gt;C_1,C_2,\ldots,C_m&amp;lt;/math&amp;gt;, where clause &amp;lt;math&amp;gt;C_i&amp;lt;/math&amp;gt; has &amp;lt;math&amp;gt;k_i&amp;lt;/math&amp;gt; literals. Without loss of generality, we assume that in each clause, each variable appears at most once.&lt;br /&gt;
* &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the set of all assignments.&lt;br /&gt;
*Each &amp;lt;math&amp;gt;H_i&amp;lt;/math&amp;gt; is the set of satisfying assignments for the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-th clause &amp;lt;math&amp;gt;C_i&amp;lt;/math&amp;gt; of the DNF formular &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;. Then the union of sets &amp;lt;math&amp;gt;H=\bigcup_i H_i&amp;lt;/math&amp;gt; gives the set of satisfying assignments for &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;.&lt;br /&gt;
* Each clause &amp;lt;math&amp;gt;C_i&amp;lt;/math&amp;gt; is a conjunction (AND) of literals. It is not hard to see that &amp;lt;math&amp;gt;|H_i|=2^{n-k_i}&amp;lt;/math&amp;gt;, which is efficiently computable.&lt;br /&gt;
* Sampling from an &amp;lt;math&amp;gt;H_i&amp;lt;/math&amp;gt; is simple: we just fix the assignments of the &amp;lt;math&amp;gt;k_i&amp;lt;/math&amp;gt; literals of that clause, and sample uniformly and independently the rest &amp;lt;math&amp;gt;(n-k_i)&amp;lt;/math&amp;gt; variable assignments.&lt;br /&gt;
* For each assignment &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;, it is easy to check whether it satisfies a clause &amp;lt;math&amp;gt;C_i&amp;lt;/math&amp;gt;, thus it is easy to determine whether &amp;lt;math&amp;gt;x\in H_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;The coverage algorithm&lt;br /&gt;
We now introduce the coverage algorithm for the union of sets problem.&lt;br /&gt;
&lt;br /&gt;
Consider the multiset &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; defined by&lt;br /&gt;
:&amp;lt;math&amp;gt;U=H_1\uplus H_2\uplus\cdots \uplus H_m&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;\uplus&amp;lt;/math&amp;gt; denotes the multiset union. It is more convenient to define &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; as the set&lt;br /&gt;
:&amp;lt;math&amp;gt;U=\{(x,i)\mid x\in H_i\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
For each &amp;lt;math&amp;gt;x\in H&amp;lt;/math&amp;gt;, there may be more than one instances of &amp;lt;math&amp;gt;(x,i)\in U&amp;lt;/math&amp;gt;. We can choose a unique representative among the multiple instances &amp;lt;math&amp;gt;(x,i)\in U&amp;lt;/math&amp;gt; for the same &amp;lt;math&amp;gt;x\in H&amp;lt;/math&amp;gt;, by choosing the &amp;lt;math&amp;gt;(x,i)&amp;lt;/math&amp;gt; with the minimum &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;, and form a set &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Formally, &amp;lt;math&amp;gt;G=\{(x,i)\in U\mid \forall (x,j)\in U, j\le i\}&amp;lt;/math&amp;gt;. Every &amp;lt;math&amp;gt;x\in H&amp;lt;/math&amp;gt; corresponds to a unique &amp;lt;math&amp;gt;(x,i)\in G&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is the smallest among &amp;lt;math&amp;gt;x\in H_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is obvious that &amp;lt;math&amp;gt;G\subseteq U&amp;lt;/math&amp;gt; and&lt;br /&gt;
:&amp;lt;math&amp;gt;|G|=|H|&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Therefore, estimation of &amp;lt;math&amp;gt;|H|&amp;lt;/math&amp;gt; is reduced to estimation of &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;G\subseteq U&amp;lt;/math&amp;gt;. Then &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt; can have an &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;-approximation with probability &amp;lt;math&amp;gt;(1-\delta)&amp;lt;/math&amp;gt; in poly-time, if we can uniformly sample from &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;|G|/|U|&amp;lt;/math&amp;gt; is suitably small.&lt;br /&gt;
&lt;br /&gt;
An uniform sample from &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; can be implemented as follows:&lt;br /&gt;
* generate an &amp;lt;math&amp;gt;i\in\{1,2,\ldots,m\}&amp;lt;/math&amp;gt; with probability &amp;lt;math&amp;gt;\frac{|H_i|}{\sum_{i=1}^m|H_i|}&amp;lt;/math&amp;gt;;&lt;br /&gt;
* uniformly sample an &amp;lt;math&amp;gt;x\in H_i&amp;lt;/math&amp;gt;, and return &amp;lt;math&amp;gt;(x,i)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is easy to see that this gives a uniform member of &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt;. The above sampling procedure is poly-time because each &amp;lt;math&amp;gt;|H_i|&amp;lt;/math&amp;gt; can be computed in poly-time, and sampling uniformly from each &amp;lt;math&amp;gt;H_i&amp;lt;/math&amp;gt; is poly-time.&lt;br /&gt;
&lt;br /&gt;
We now only need to lower bound the ratio&lt;br /&gt;
:&amp;lt;math&amp;gt;\alpha=\frac{|G|}{|U|}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We claim that &lt;br /&gt;
:&amp;lt;math&amp;gt;\alpha\ge\frac{1}{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
It is easy to see this, because each &amp;lt;math&amp;gt;x\in H&amp;lt;/math&amp;gt; has at most &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; instances of &amp;lt;math&amp;gt;(x,i)&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt;, and we already know that &amp;lt;math&amp;gt;|G|=|H|&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Due to the estimator theorem, this needs &amp;lt;math&amp;gt;\frac{4m}{\epsilon}\ln\frac{2}{\delta}&amp;lt;/math&amp;gt; uniform random samples from &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This gives the coverage algorithm for the abstract problem of the union of sets. The DNF counting is a special case of it.&lt;br /&gt;
&lt;br /&gt;
=== Permanents and perfect matchings ===&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U=\{u_1,u_2,\ldots,u_n\}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;V=\{v_1,v_2,\ldots,v_n\}&amp;lt;/math&amp;gt;. Consider a bipartite graph &amp;lt;math&amp;gt;G(U,V,E)&amp;lt;/math&amp;gt;. An &amp;lt;math&amp;gt;M\subseteq E&amp;lt;/math&amp;gt; is a &#039;&#039;&#039;perfect matching&#039;&#039;&#039; of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; if every vertex of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; has exactly one edge in &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; adjacent to it.&lt;br /&gt;
&lt;br /&gt;
Given a bipartite graph &amp;lt;math&amp;gt;G(U,V,E)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;|U|=|V|=n&amp;lt;/math&amp;gt;, we want to count the number of perfect matchings of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;. This problem can be reduced to computing the &#039;&#039;&#039;permanent&#039;&#039;&#039; of a square matrix.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Definition (permanent)&#039;&#039;&#039;&lt;br /&gt;
:Let &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; be an &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrix. The &#039;&#039;&#039;permanent&#039;&#039;&#039; of the matrix is defined as&lt;br /&gt;
::&amp;lt;math&amp;gt;\mathrm{per}(Q)=\sum_{\pi\in\mathbb{S}_n}\prod_{i=1}^n Q_{i,\pi(i)}&amp;lt;/math&amp;gt;,&lt;br /&gt;
:where &amp;lt;math&amp;gt;\mathbb{S}_n&amp;lt;/math&amp;gt; is the symmetric group of permutation of size &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If we multiply each term of the sum the sign of the permutation, then it gives us the determinant of the matrix, &lt;br /&gt;
:&amp;lt;math&amp;gt;\det(Q)=\sum_{\pi\in\mathbb{S}_n}\sgn(\pi)\prod_{i=1}^n Q_{i,\pi(i)}&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;\sgn(\pi)&amp;lt;/math&amp;gt;, the sign of a permutation, is either &amp;lt;math&amp;gt;-1&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;+1&amp;lt;/math&amp;gt;, according to whether the minimum number of pair-wise interchanges to achieve &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1,2,\ldots,n)&amp;lt;/math&amp;gt; is odd or even.&lt;br /&gt;
&lt;br /&gt;
Unlike the determinants, which are computable in poly-time, permanents are hard to compute, as permanents can be used to count the number of perfect matchings in a bipartite graph, which is &#039;&#039;&#039;#P-complete&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A bipartite graph &amp;lt;math&amp;gt;G(U,V,E)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;|U|=|V|=n&amp;lt;/math&amp;gt; can be represented by an &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrix &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; with 0-1 entries as follows:&lt;br /&gt;
* Each row of &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; corresponds to a vertex in &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; and each column of &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; corresponds to a vertex in &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt;.&lt;br /&gt;
::&amp;lt;math&amp;gt;Q_{ij}=\begin{cases}&lt;br /&gt;
1 &amp;amp; \mbox{if }i\sim j,\\&lt;br /&gt;
0 &amp;amp; \mbox{otherwise}.&lt;br /&gt;
\end{cases}&amp;lt;/math&amp;gt;&lt;br /&gt;
Note the subtle difference between the definition of &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; and the adjacency matrix. &lt;br /&gt;
&lt;br /&gt;
Each perfect matching corresponds to a permutation &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;(u,\pi(u))\in E&amp;lt;/math&amp;gt; for every &amp;lt;math&amp;gt;u\in U&amp;lt;/math&amp;gt;, which corresponds to a permutation &amp;lt;math&amp;gt;\pi\in\mathbb{S}_n&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\prod_{i=1}^n Q_{i,\pi(i)}=1&amp;lt;/math&amp;gt;. It is than easy to see that &amp;lt;math&amp;gt;\mathrm{per}(Q)&amp;lt;/math&amp;gt; gives the number of perfect matchings in the bipartite graph &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is known that counting the number of perfect matchings in a bipartite graph is &#039;&#039;&#039;#P-hard&#039;&#039;&#039;. Since this problem can be reduced to computing the permanent, thus the problem of computing the permanents is also &#039;&#039;&#039;#P-hard&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Now we show that with randomization, we can approximate the number of perfect matchings in a bipartite graph. In particular, we will give an FPRAS for counting the perfect matchings in a dense bipartite graph.&lt;br /&gt;
&lt;br /&gt;
==== The Jerrum-Sinclair algorithm ====&lt;br /&gt;
Fix a bipartite graph &amp;lt;math&amp;gt;G(U,V,E)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;|U|=|V|=n&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;\mathcal{M}_k&amp;lt;/math&amp;gt; be the set of matchings of size &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;m_k=|\mathcal{M}_k|&amp;lt;/math&amp;gt;. Thus, &amp;lt;math&amp;gt;\mathcal{M}_k&amp;lt;/math&amp;gt; is the set of perfect matchings in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;, and our goal is to compute &amp;lt;math&amp;gt;m_n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;r_k=\frac{m_k}{m_{k-1}}&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;1&amp;lt;k\le n&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
:&amp;lt;math&amp;gt;m_k=m_{k-1}r_k&amp;lt;/math&amp;gt;,&lt;br /&gt;
which gives us a recursion to compute the &amp;lt;math&amp;gt;m_n&amp;lt;/math&amp;gt;, as&lt;br /&gt;
:&amp;lt;math&amp;gt;m_n=m_{1}\frac{m_2}{m_1}\cdot\frac{m_3}{m_2}\cdots\frac{m_n}{m_{n-1}}=m_1\prod_{k=2}^n r_k&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;m_1=|\mathcal{M}_1|&amp;lt;/math&amp;gt; is the number of matchings of size 1 in the bipartite graph &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;, which is just the number of edges in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;. Therefore, &amp;lt;math&amp;gt;m_n&amp;lt;/math&amp;gt; can be computed once we know &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;1&amp;lt;k\le n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Each &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt; can be estimated by sampling uniformly from the set &amp;lt;math&amp;gt;\mathcal{M}_k\cup\mathcal{M}_{k-1}&amp;lt;/math&amp;gt;. The algorithm for estimating &amp;lt;math&amp;gt;m_n&amp;lt;/math&amp;gt; is outlined as:&lt;br /&gt;
# For each &amp;lt;math&amp;gt;1&amp;lt;k\le n&amp;lt;/math&amp;gt;, have an FPRAS for computing the &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt; by uniform sampling sufficiently many members from &amp;lt;math&amp;gt;\mathcal{M}_k\cup\mathcal{M}_{k-1}&amp;lt;/math&amp;gt; as&lt;br /&gt;
::*uniformly sample &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; matching from &amp;lt;math&amp;gt;\mathcal{M}_k\cup\mathcal{M}_{k-1}&amp;lt;/math&amp;gt;, for some polynomially large &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;;&lt;br /&gt;
::* assuming that there are &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; sampled matchings of size &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;, return &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r_k=\frac{X}{N-X}&amp;lt;/math&amp;gt;.&lt;br /&gt;
:2.  Compute &amp;lt;math&amp;gt;m_n&amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;m_n=m_1\prod_{k=2}^n r_k&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;m_1=|E|&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
There are several issues that we have to deal with in order to have a fully functional FPRAS for counting perfect matchings.&lt;br /&gt;
* By taking the product of &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt;&#039;s, the errors for individual &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt;&#039;s add up.&lt;br /&gt;
* In order to accurately estimate &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt; by sampling from &amp;lt;math&amp;gt;\mathcal{M}_k\cup\mathcal{M}_{k-1}&amp;lt;/math&amp;gt;, the ratio &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt; should be within the range &amp;lt;math&amp;gt;\left[\frac{1}{\alpha},\alpha\right]&amp;lt;/math&amp;gt; for some &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; within polynomial of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&lt;br /&gt;
* Implement the uniform sampling from &amp;lt;math&amp;gt;\mathcal{M}_k\cup\mathcal{M}_{k-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Estimator for each &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Accumulation of errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Near-uniform sampling from &amp;lt;math&amp;gt;\mathcal{M}_k\cup\mathcal{M}_{k-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
In the last lecture, we have shown that by random walk, we can sample a near-uniform member of &amp;lt;math&amp;gt;\mathcal{M}_n\cup\mathcal{M}_{n-1}&amp;lt;/math&amp;gt; in poly-time.&lt;br /&gt;
&lt;br /&gt;
=== Volume estimation  ===&lt;br /&gt;
We consider the problem of computing the volume of a given [http://en.wikipedia.org/wiki/Convex_body convex body] &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; dimensions. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;\Upsilon(K)\,&amp;lt;/math&amp;gt; to denote the volume of the convex body &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt;. Abstractly, the problem is that given as input a convex body &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; dimensions, return the &amp;lt;math&amp;gt;\Upsilon(K)\,&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We should be more specific about the input model. Since we allow an arbitrary convex body as input, it is not even clear how to describe the body. We assume that &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; is described by means of a &#039;&#039;&#039;membership oracle&#039;&#039;&#039; &amp;lt;math&amp;gt;\mathcal{O}&amp;lt;/math&amp;gt;, such that  for a &#039;&#039;&#039;query&#039;&#039;&#039; of an &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-dimensional point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\mathcal{O}(x)&amp;lt;/math&amp;gt; indicates whether &amp;lt;math&amp;gt;x\in K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-dimensional convex body defined by the intersection of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; half-spaces, which is the set of feasible solutions to a system of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; linear constraints, can be described as&lt;br /&gt;
:&amp;lt;math&amp;gt;A x\le \boldsymbol{b}&amp;lt;/math&amp;gt;,&lt;br /&gt;
for some &amp;lt;math&amp;gt;m\times n&amp;lt;/math&amp;gt; matrix &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt;-dimensional vector &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;. For a query of an &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;, the membership oracle &amp;lt;math&amp;gt;\mathcal{O}&amp;lt;/math&amp;gt; just check whether &amp;lt;math&amp;gt;Ax\le b&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For deterministic algorithms, there are negative news for this problem.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Theorem (Bárány-Füredi 1987)&#039;&#039;&#039;&lt;br /&gt;
:Suppose that a deterministic poly-time algorithm uses the membership oracle for a convex body &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; dimensions, and generates an upper bound &amp;lt;math&amp;gt;\Upsilon_u\,&amp;lt;/math&amp;gt; and a lower bound &amp;lt;math&amp;gt;\Upsilon_\ell\,&amp;lt;/math&amp;gt; on the volume &amp;lt;math&amp;gt;\Upsilon(K)\,&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt;. Then, there is a convex body &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; and a constant &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; such that&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{\Upsilon_u}{\Upsilon_\ell}\ge c\left(\frac{n}{\log n}\right)^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
That is said, with deterministic algorithms, we cannot even approximate the volume within a wildly loose range.&lt;br /&gt;
&lt;br /&gt;
Dyer-Frieze-Kannan come up with an idea of estimating the volume of &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; by sampling near-uniformly from convex sets. They reduce the problem of computing approximately the volume of convex bodies to this sampling problem and thus give the first FPRAS for the volume of convex bodies.&lt;br /&gt;
&lt;br /&gt;
For any convex body &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt;, it encloses some &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-dimensional ball and is also enclosed by another ball with larger radius. We assume that the convex body &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; encloses the unit ball around the origin, and is enclosed by a larger ball round the origin with polynomially large radius. Formally, we assume that&lt;br /&gt;
:&amp;lt;math&amp;gt;B(0,1)\subseteq K\subseteq B(0,n^c)&amp;lt;/math&amp;gt; for some constant &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;B(p,r)&amp;lt;/math&amp;gt; denotes a ball of radius &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; as center, i.e. &amp;lt;math&amp;gt;B(p,r)=\{x\mid \|x-p\|\le r \}&amp;lt;/math&amp;gt;. We can make this assumption because it is known that for any convex body &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt;, there exists a linear transformation &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; which can be found within poly-time such that &amp;lt;math&amp;gt;\tau K&amp;lt;/math&amp;gt; transforms the &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; to a convex body that satisfies the assumption, and preserves the ratio of the volumes of the balls to the convex body.&lt;br /&gt;
&lt;br /&gt;
The volumes of the balls are easy to compute. If only the ratio between the convex body and the ball which encloses it, is sufficiently large, then we can apply the Monte Carlo method to estimate &amp;lt;math&amp;gt;\Upsilon(K)\,&amp;lt;/math&amp;gt; by uniformly sampling from the ball.&lt;br /&gt;
&lt;br /&gt;
However, in high-dimension, the ratio between the volume of a convex body and the volume of ball which encloses it, can be exponentially small. This is caused by the so called the &amp;quot;[http://en.wikipedia.org/wiki/Curse_of_dimensionality curse of dimensionality]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Instead of having an outer ball and an inner ball, we define a sequence of balls:&lt;br /&gt;
:&amp;lt;math&amp;gt;B_0=B(0,\lambda^0), B_1=B(0,\lambda^1), B_2=B(0,\lambda^2),\ldots, B_m=B(0,\lambda^m)&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;\lambda=(1+\frac{1}{n})&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; is the smallest positive integer such that &amp;lt;math&amp;gt;\lambda^m\ge n^c&amp;lt;/math&amp;gt;. Therefore, the inner ball &amp;lt;math&amp;gt;B(0,1)=B_0&amp;lt;/math&amp;gt;, the outer ball &amp;lt;math&amp;gt;B(0,n^c)\subseteq B_m&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; is within polynomial of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;. In fact, &amp;lt;math&amp;gt;m\approx cn\ln n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This sequence of balls naturally defines a sequence of convex bodies by intersections as &amp;lt;math&amp;gt;K_i=B_i\cap K&amp;lt;/math&amp;gt;. It is obvious that&lt;br /&gt;
:&amp;lt;math&amp;gt;B(0,1)=K_0\subseteq K_1\subseteq K_2\subseteq\cdots\subseteq K_m=K&amp;lt;/math&amp;gt;.&lt;br /&gt;
Balls are convex, and since the intersection of convex bodies is still convex, the sequence of &amp;lt;math&amp;gt;K_i&amp;lt;/math&amp;gt; is a sequence of convex bodies.&lt;br /&gt;
&lt;br /&gt;
We have the telescopic product:&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\Upsilon(K_0)}{\Upsilon(K_1)}\cdot\frac{\Upsilon(K_1)}{\Upsilon(K_2)}\cdots\frac{\Upsilon(K_{m-1})}{\Upsilon(K_m)}=\frac{\Upsilon(K_0)}{\Upsilon(K_m)}=\frac{\Upsilon(B(0,1))}{\Upsilon(K)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore, the volume &amp;lt;math&amp;gt;\Upsilon(K)\,&amp;lt;/math&amp;gt; can be computed as &lt;br /&gt;
:&amp;lt;math&amp;gt;\Upsilon(K)=\Upsilon(B(0,1))\cdot\prod_{i=1}^{m}\frac{\Upsilon(K_{i})}{\Upsilon(K_{i-1})}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The volume of unite ball &amp;lt;math&amp;gt;\Upsilon(B(0,1))\,&amp;lt;/math&amp;gt; can be precisely computed in poly-time. Each &amp;lt;math&amp;gt;\frac{\Upsilon(K_{i})}{\Upsilon(K_{i-1})}&amp;lt;/math&amp;gt; is computed by near-uniform sampling from &amp;lt;math&amp;gt;K_{i}&amp;lt;/math&amp;gt;, which encloses &amp;lt;math&amp;gt;K_{i-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another observation is that the ratio &amp;lt;math&amp;gt;\frac{\Upsilon(K_{i})}{\Upsilon(K_{i-1})}&amp;lt;/math&amp;gt; is well-bounded. Recall that &amp;lt;math&amp;gt;K_i=B(0,\lambda^i)\cap K&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;\lambda=(1+\frac{1}{n})&amp;lt;/math&amp;gt;. It can be proved that in &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; dimensions, the volume of &amp;lt;math&amp;gt;K_i&amp;lt;/math&amp;gt; is at most &amp;lt;math&amp;gt;\lambda^n&amp;lt;/math&amp;gt; times the &amp;lt;math&amp;gt;K_{i-1}&amp;lt;/math&amp;gt;, thus the ratio &amp;lt;math&amp;gt;\frac{\Upsilon(K_{i})}{\Upsilon(K_{i-1})}&amp;lt;/math&amp;gt; is at most &amp;lt;math&amp;gt;\lambda^n=O(1)&amp;lt;/math&amp;gt;. By the estimator theorem, we can have an FPRAS for the ratio &amp;lt;math&amp;gt;\frac{\Upsilon(K_{i})}{\Upsilon(K_{i-1})}&amp;lt;/math&amp;gt; if we can uniformly sample from &amp;lt;math&amp;gt;K_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Uniformly sampling from an arbitrary convex body is replaced by near-uniform sampling achieved by random walks. In the original walk of Dyer-Frieze-Kannan, they consider the random walk over &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-dimensional discrete grid points enclosed by &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt;, and prove that the walk is rapid mixing. This gives us the first FPRAS for volume estimation which runs in &amp;lt;math&amp;gt;\tilde{O}(n^{23})&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\tilde{O}(\cdot)&amp;lt;/math&amp;gt; ignores the polylogarithmic factors.&lt;br /&gt;
&lt;br /&gt;
The time bound was later improved by a series of works, each introducing some new ideas.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
| || complexity || new ingredient(s)&lt;br /&gt;
|-&lt;br /&gt;
| Dyer-Frieze-Kannan 1991 || align=&amp;quot;center&amp;quot; | &amp;lt;math&amp;gt;n^{23}&amp;lt;/math&amp;gt; || everything&lt;br /&gt;
|-&lt;br /&gt;
| Lovász-Simonovits 1990 || align=&amp;quot;center&amp;quot; | &amp;lt;math&amp;gt;n^{16}&amp;lt;/math&amp;gt; || localization lemma&lt;br /&gt;
|-&lt;br /&gt;
| Applegate-Kannan 1990 || align=&amp;quot;center&amp;quot; | &amp;lt;math&amp;gt;n^{10}&amp;lt;/math&amp;gt; || logconcave sampling&lt;br /&gt;
|-&lt;br /&gt;
| Lovász 1990 || align=&amp;quot;center&amp;quot; | &amp;lt;math&amp;gt;n^{10}&amp;lt;/math&amp;gt; || ball walk&lt;br /&gt;
|-&lt;br /&gt;
| Dyer-Frieze 1991 || align=&amp;quot;center&amp;quot; | &amp;lt;math&amp;gt;n^8&amp;lt;/math&amp;gt; || better error analysis&lt;br /&gt;
|-&lt;br /&gt;
| Lovász-Simonovits 1993 || align=&amp;quot;center&amp;quot; | &amp;lt;math&amp;gt;n^7&amp;lt;/math&amp;gt; || many improvements&lt;br /&gt;
|-&lt;br /&gt;
| Kannan-Lovász-Simonovits 1997 || align=&amp;quot;center&amp;quot; | &amp;lt;math&amp;gt;n^5&amp;lt;/math&amp;gt; || isotropy, speedy walk&lt;br /&gt;
|-&lt;br /&gt;
| Lovász-Vempala 2003 || align=&amp;quot;center&amp;quot; | &amp;lt;math&amp;gt;n^4&amp;lt;/math&amp;gt; || simulated annealing, hit-and-run&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
(cited from &amp;quot;Geometric Random Walks: A Survey&amp;quot; by Santosh Vempala.)&lt;br /&gt;
&lt;br /&gt;
The current best upper bound is &amp;lt;math&amp;gt;\tilde{O}(n^4)&amp;lt;/math&amp;gt; due to Lovász and Vempala in 2003. It is conjectured that the optimal bound is &amp;lt;math&amp;gt;\Theta(n^3)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Linear Programming ==&lt;br /&gt;
&lt;br /&gt;
=== LP and convex polytopes ===&lt;br /&gt;
&lt;br /&gt;
=== The simplex algorithms ===&lt;br /&gt;
&lt;br /&gt;
=== An LP solver via random walks ===&lt;/div&gt;</summary>
		<author><name>172.16.65.36</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Approximate_counting,_linear_programming&amp;diff=2447</id>
		<title>Randomized Algorithms (Spring 2010)/Approximate counting, linear programming</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Approximate_counting,_linear_programming&amp;diff=2447"/>
		<updated>2010-05-24T08:49:07Z</updated>

		<summary type="html">&lt;p&gt;172.16.65.36: /* Approximate Counting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Counting Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Complexity model ===&lt;br /&gt;
&lt;br /&gt;
=== FPRAS ===&lt;br /&gt;
&lt;br /&gt;
== Approximate Counting ==&lt;br /&gt;
Let us consider the following abstract problem.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; be a finite set of known size, and let &amp;lt;math&amp;gt;G\subseteq U&amp;lt;/math&amp;gt;. We want to compute the size of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We assume two devices:&lt;br /&gt;
* A &#039;&#039;&#039;uniform sampler&#039;&#039;&#039; &amp;lt;math&amp;gt;\mathcal{U}&amp;lt;/math&amp;gt;, which uniformly and independently samples a member of &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; upon each calling.&lt;br /&gt;
* A &#039;&#039;&#039;membership oracle&#039;&#039;&#039; of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;, denoted &amp;lt;math&amp;gt;\mathcal{O}&amp;lt;/math&amp;gt;. Given as the input an &amp;lt;math&amp;gt;x\in U&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\mathcal{O}(x)&amp;lt;/math&amp;gt; indicates whether or not &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is a member of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Equipped by &amp;lt;math&amp;gt;\mathcal{U}&amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;\mathcal{O}&amp;lt;/math&amp;gt;, we can have the following Monte Carlo algorithm:&lt;br /&gt;
*Choose &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; independent samples from &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt;by the uniform sampler &amp;lt;math&amp;gt;\mathcal{U}&amp;lt;/math&amp;gt;, represented by the random variables &amp;lt;math&amp;gt;X_1,X_2,\ldots, X_N&amp;lt;/math&amp;gt;. &lt;br /&gt;
* Let &amp;lt;math&amp;gt;Y_i&amp;lt;/math&amp;gt; be the indicator random variable defined as &amp;lt;math&amp;gt;Y_i=\mathcal{O}(X_i)&amp;lt;/math&amp;gt;, namely, &amp;lt;math&amp;gt;Y_i&amp;lt;/math&amp;gt; indicates whether &amp;lt;math&amp;gt;X_i\in G&amp;lt;/math&amp;gt;.&lt;br /&gt;
* Define the estimator random variable&lt;br /&gt;
::&amp;lt;math&amp;gt;Z=\frac{|U|}{N}\sum_{i=1}^N Y_i.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is easy to see that &amp;lt;math&amp;gt;\mathbf{E}[Z]=|G|&amp;lt;/math&amp;gt; and we might hope that with high probability the value of &amp;lt;math&amp;gt;Z&amp;lt;/math&amp;gt; is close to &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt;. Formally, &amp;lt;math&amp;gt;Z&amp;lt;/math&amp;gt; is called an &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;-approximation of &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt; if&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
(1-\epsilon)|G|\le Z\le (1+\epsilon)|G|.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following theorem states that the probabilistic accuracy of the estimation depends on the number of samples and the ratio between &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;|U|&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Theorem (estimator theorem)&#039;&#039;&#039;&lt;br /&gt;
:Let &amp;lt;math&amp;gt;\alpha=\frac{|G|}{|U|}&amp;lt;/math&amp;gt;. Then the Monte Carlo method yields an &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;-approximation to &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt; with probability at least &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt; provided&lt;br /&gt;
::&amp;lt;math&amp;gt;N\ge\frac{4}{\epsilon \alpha}\ln\frac{2}{\delta}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Proof&#039;&#039;&#039;: Use the Chernoff bound.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\square&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A counting algorithm for the set &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; has to deal with the following three complications:&lt;br /&gt;
* Implement the membership oracle &amp;lt;math&amp;gt;\mathcal{O}&amp;lt;/math&amp;gt;. This is usually straightforward, or assumed by the model.&lt;br /&gt;
* Implement the uniform sampler &amp;lt;math&amp;gt;\mathcal{U}&amp;lt;/math&amp;gt;. As we have seen, this is usually approximated by random walks. How to design the random walk and bound its mixing rate is usually technical challenging, if possible at all.&lt;br /&gt;
* Deal with exponentially small &amp;lt;math&amp;gt;\alpha=\frac{|G|}{|U|}&amp;lt;/math&amp;gt;. This requires us to cleverly choose the universe &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt;. Sometimes this needs some nontrivial ideas.&lt;br /&gt;
&lt;br /&gt;
=== Counting DNFs ===&lt;br /&gt;
A disjunctive normal form (DNF) formular is a disjunction (OR) of clauses, where each clause is a conjunction (AND) of literals. For example:&lt;br /&gt;
:&amp;lt;math&amp;gt;(x_1\wedge \overline{x_2}\wedge x_3)\vee(x_2\wedge x_4)\vee(\overline{x_1}\wedge x_3\wedge x_4)&amp;lt;/math&amp;gt;.&lt;br /&gt;
Note the difference from the conjunctive normal forms (CNF).&lt;br /&gt;
&lt;br /&gt;
Given a DNF formular &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; as the input, the problem is to count the number of satisfying assignments of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;. This problem is &#039;&#039;&#039;#P-complete&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Naively applying the Monte Carlo method will not give a good answer. Suppose that there are &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; variables. Let &amp;lt;math&amp;gt;U=\{\mathrm{true},\mathrm{false}\}^n&amp;lt;/math&amp;gt; be the set of all truth assignments of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; variables. Let &amp;lt;math&amp;gt;G=\{x\in U\mid \phi(x)=\mathrm{true}\}&amp;lt;/math&amp;gt; be the set of satisfying assignments for &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;. The straightforward use of Monte Carlo method samples &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; assignments from &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; and check how many of them satisfy &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;. This algorithm fails when &amp;lt;math&amp;gt;|G|/|U|&amp;lt;/math&amp;gt; is exponentially small, namely, when exponentially small fraction of the assignments satisfy the input DNF formula. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;The union of sets problem&lt;br /&gt;
We reformulate the DNF counting problem in a more abstract framework, called the &#039;&#039;&#039;union of sets&#039;&#039;&#039; problem. &lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; be a finite universe. We are given &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; subsets &amp;lt;math&amp;gt;H_1,H_2,\ldots,H_m\subseteq V&amp;lt;/math&amp;gt;. The following assumptions hold:&lt;br /&gt;
*For all &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;|H_i|&amp;lt;/math&amp;gt; is computable in poly-time.&lt;br /&gt;
*It is possible to sample uniformly from each individual &amp;lt;math&amp;gt;H_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
*For any &amp;lt;math&amp;gt;x\in V&amp;lt;/math&amp;gt;, it can be determined in poly-time whether &amp;lt;math&amp;gt;x\in H_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The goal is to compute the size of &amp;lt;math&amp;gt;H=\bigcup_{i=1}^m H_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
DNF counting can be interpreted in this general framework as follows. Suppose that the DNF formula &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is defined on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; variables, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; contains &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; clauses &amp;lt;math&amp;gt;C_1,C_2,\ldots,C_m&amp;lt;/math&amp;gt;, where clause &amp;lt;math&amp;gt;C_i&amp;lt;/math&amp;gt; has &amp;lt;math&amp;gt;k_i&amp;lt;/math&amp;gt; literals. Without loss of generality, we assume that in each clause, each variable appears at most once.&lt;br /&gt;
* &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the set of all assignments.&lt;br /&gt;
*Each &amp;lt;math&amp;gt;H_i&amp;lt;/math&amp;gt; is the set of satisfying assignments for the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-th clause &amp;lt;math&amp;gt;C_i&amp;lt;/math&amp;gt; of the DNF formular &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;. Then the union of sets &amp;lt;math&amp;gt;H=\bigcup_i H_i&amp;lt;/math&amp;gt; gives the set of satisfying assignments for &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;.&lt;br /&gt;
* Each clause &amp;lt;math&amp;gt;C_i&amp;lt;/math&amp;gt; is a conjunction (AND) of literals. It is not hard to see that &amp;lt;math&amp;gt;|H_i|=2^{n-k_i}&amp;lt;/math&amp;gt;, which is efficiently computable.&lt;br /&gt;
* Sampling from an &amp;lt;math&amp;gt;H_i&amp;lt;/math&amp;gt; is simple: we just fix the assignments of the &amp;lt;math&amp;gt;k_i&amp;lt;/math&amp;gt; literals of that clause, and sample uniformly and independently the rest &amp;lt;math&amp;gt;(n-k_i)&amp;lt;/math&amp;gt; variable assignments.&lt;br /&gt;
* For each assignment &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;, it is easy to check whether it satisfies a clause &amp;lt;math&amp;gt;C_i&amp;lt;/math&amp;gt;, thus it is easy to determine whether &amp;lt;math&amp;gt;x\in H_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;The coverage algorithm&lt;br /&gt;
We now introduce the coverage algorithm for the union of sets problem.&lt;br /&gt;
&lt;br /&gt;
Consider the multiset &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; defined by&lt;br /&gt;
:&amp;lt;math&amp;gt;U=H_1\uplus H_2\uplus\cdots \uplus H_m&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;\uplus&amp;lt;/math&amp;gt; denotes the multiset union. It is more convenient to define &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; as the set&lt;br /&gt;
:&amp;lt;math&amp;gt;U=\{(x,i)\mid x\in H_i\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
For each &amp;lt;math&amp;gt;x\in H&amp;lt;/math&amp;gt;, there may be more than one instances of &amp;lt;math&amp;gt;(x,i)\in U&amp;lt;/math&amp;gt;. We can choose a unique representative among the multiple instances &amp;lt;math&amp;gt;(x,i)\in U&amp;lt;/math&amp;gt; for the same &amp;lt;math&amp;gt;x\in H&amp;lt;/math&amp;gt;, by choosing the &amp;lt;math&amp;gt;(x,i)&amp;lt;/math&amp;gt; with the minimum &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;, and form a set &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Formally, &amp;lt;math&amp;gt;G=\{(x,i)\in U\mid \forall (x,j)\in U, j\le i\}&amp;lt;/math&amp;gt;. Every &amp;lt;math&amp;gt;x\in H&amp;lt;/math&amp;gt; corresponds to a unique &amp;lt;math&amp;gt;(x,i)\in G&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is the smallest among &amp;lt;math&amp;gt;x\in H_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is obvious that &amp;lt;math&amp;gt;G\subseteq U&amp;lt;/math&amp;gt; and&lt;br /&gt;
:&amp;lt;math&amp;gt;|G|=|H|&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Therefore, estimation of &amp;lt;math&amp;gt;|H|&amp;lt;/math&amp;gt; is reduced to estimation of &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;G\subseteq U&amp;lt;/math&amp;gt;. Then &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt; can have an &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;-approximation with probability &amp;lt;math&amp;gt;(1-\delta)&amp;lt;/math&amp;gt; in poly-time, if we can uniformly sample from &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;|G|/|U|&amp;lt;/math&amp;gt; is suitably small.&lt;br /&gt;
&lt;br /&gt;
An uniform sample from &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; can be implemented as follows:&lt;br /&gt;
* generate an &amp;lt;math&amp;gt;i\in\{1,2,\ldots,m\}&amp;lt;/math&amp;gt; with probability &amp;lt;math&amp;gt;\frac{|H_i|}{\sum_{i=1}^m|H_i|}&amp;lt;/math&amp;gt;;&lt;br /&gt;
* uniformly sample an &amp;lt;math&amp;gt;x\in H_i&amp;lt;/math&amp;gt;, and return &amp;lt;math&amp;gt;(x,i)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is easy to see that this gives a uniform member of &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt;. The above sampling procedure is poly-time because each &amp;lt;math&amp;gt;|H_i|&amp;lt;/math&amp;gt; can be computed in poly-time, and sampling uniformly from each &amp;lt;math&amp;gt;H_i&amp;lt;/math&amp;gt; is poly-time.&lt;br /&gt;
&lt;br /&gt;
We now only need to lower bound the ratio&lt;br /&gt;
:&amp;lt;math&amp;gt;\alpha=\frac{|G|}{|U|}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We claim that &lt;br /&gt;
:&amp;lt;math&amp;gt;\alpha\ge\frac{1}{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
It is easy to see this, because each &amp;lt;math&amp;gt;x\in H&amp;lt;/math&amp;gt; has at most &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; instances of &amp;lt;math&amp;gt;(x,i)&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt;, and we already know that &amp;lt;math&amp;gt;|G|=|H|&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Due to the estimator theorem, this needs &amp;lt;math&amp;gt;\frac{4m}{\epsilon}\ln\frac{2}{\delta}&amp;lt;/math&amp;gt; uniform random samples from &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This gives the coverage algorithm for the abstract problem of the union of sets. The DNF counting is a special case of it.&lt;br /&gt;
&lt;br /&gt;
=== Permanents and perfect matchings ===&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U=\{u_1,u_2,\ldots,u_n\}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;V=\{v_1,v_2,\ldots,v_n\}&amp;lt;/math&amp;gt;. Consider a bipartite graph &amp;lt;math&amp;gt;G(U,V,E)&amp;lt;/math&amp;gt;. An &amp;lt;math&amp;gt;M\subseteq E&amp;lt;/math&amp;gt; is a &#039;&#039;&#039;perfect matching&#039;&#039;&#039; of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; if every vertex of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; has exactly one edge in &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; adjacent to it.&lt;br /&gt;
&lt;br /&gt;
Given a bipartite graph &amp;lt;math&amp;gt;G(U,V,E)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;|U|=|V|=n&amp;lt;/math&amp;gt;, we want to count the number of perfect matchings of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;. This problem can be reduced to computing the &#039;&#039;&#039;permanent&#039;&#039;&#039; of a square matrix.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Definition (permanent)&#039;&#039;&#039;&lt;br /&gt;
:Let &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; be an &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrix. The &#039;&#039;&#039;permanent&#039;&#039;&#039; of the matrix is defined as&lt;br /&gt;
::&amp;lt;math&amp;gt;\mathrm{per}(Q)=\sum_{\pi\in\mathbb{S}_n}\prod_{i=1}^n Q_{i,\pi(i)}&amp;lt;/math&amp;gt;,&lt;br /&gt;
:where &amp;lt;math&amp;gt;\mathbb{S}_n&amp;lt;/math&amp;gt; is the symmetric group of permutation of size &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If we multiply each term of the sum the sign of the permutation, then it gives us the determinant of the matrix, &lt;br /&gt;
:&amp;lt;math&amp;gt;\det(Q)=\sum_{\pi\in\mathbb{S}_n}\sgn(\pi)\prod_{i=1}^n Q_{i,\pi(i)}&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;\sgn(\pi)&amp;lt;/math&amp;gt;, the sign of a permutation, is either &amp;lt;math&amp;gt;-1&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;+1&amp;lt;/math&amp;gt;, according to whether the minimum number of pair-wise interchanges to achieve &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1,2,\ldots,n)&amp;lt;/math&amp;gt; is odd or even.&lt;br /&gt;
&lt;br /&gt;
Unlike the determinants, which are computable in poly-time, permanents are hard to compute, as permanents can be used to count the number of perfect matchings in a bipartite graph, which is &#039;&#039;&#039;#P-complete&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A bipartite graph &amp;lt;math&amp;gt;G(U,V,E)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;|U|=|V|=n&amp;lt;/math&amp;gt; can be represented by an &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrix &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; with 0-1 entries as follows:&lt;br /&gt;
* Each row of &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; corresponds to a vertex in &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; and each column of &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; corresponds to a vertex in &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt;.&lt;br /&gt;
::&amp;lt;math&amp;gt;Q_{ij}=\begin{cases}&lt;br /&gt;
1 &amp;amp; \mbox{if }i\sim j,\\&lt;br /&gt;
0 &amp;amp; \mbox{otherwise}.&lt;br /&gt;
\end{cases}&amp;lt;/math&amp;gt;&lt;br /&gt;
Note the subtle difference between the definition of &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; and the adjacency matrix. &lt;br /&gt;
&lt;br /&gt;
Each perfect matching corresponds to a permutation &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;(u,\pi(u))\in E&amp;lt;/math&amp;gt; for every &amp;lt;math&amp;gt;u\in U&amp;lt;/math&amp;gt;, which corresponds to a permutation &amp;lt;math&amp;gt;\pi\in\mathbb{S}_n&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\prod_{i=1}^n Q_{i,\pi(i)}=1&amp;lt;/math&amp;gt;. It is than easy to see that &amp;lt;math&amp;gt;\mathrm{per}(Q)&amp;lt;/math&amp;gt; gives the number of perfect matchings in the bipartite graph &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is known that counting the number of perfect matchings in a bipartite graph is &#039;&#039;&#039;#P-hard&#039;&#039;&#039;. Since this problem can be reduced to computing the permanent, thus the problem of computing the permanents is also &#039;&#039;&#039;#P-hard&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Now we show that with randomization, we can approximate the number of perfect matchings in a bipartite graph. In particular, we will give an FPRAS for counting the perfect matchings in a dense bipartite graph.&lt;br /&gt;
&lt;br /&gt;
==== The Jerrum-Sinclair algorithm ====&lt;br /&gt;
Fix a bipartite graph &amp;lt;math&amp;gt;G(U,V,E)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;|U|=|V|=n&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;\mathcal{M}_k&amp;lt;/math&amp;gt; be the set of matchings of size &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;m_k=|\mathcal{M}_k|&amp;lt;/math&amp;gt;. Thus, &amp;lt;math&amp;gt;\mathcal{M}_k&amp;lt;/math&amp;gt; is the set of perfect matchings in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;, and our goal is to compute &amp;lt;math&amp;gt;m_n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;r_k=\frac{m_k}{m_{k-1}}&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;1&amp;lt;k\le n&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
:&amp;lt;math&amp;gt;m_k=m_{k-1}r_k&amp;lt;/math&amp;gt;,&lt;br /&gt;
which gives us a recursion to compute the &amp;lt;math&amp;gt;m_n&amp;lt;/math&amp;gt;, as&lt;br /&gt;
:&amp;lt;math&amp;gt;m_n=m_{1}\frac{m_2}{m_1}\cdot\frac{m_3}{m_2}\cdots\frac{m_n}{m_{n-1}}=m_1\prod_{k=2}^n r_k&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;m_1=|\mathcal{M}_1|&amp;lt;/math&amp;gt; is the number of matchings of size 1 in the bipartite graph &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;, which is just the number of edges in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;. Therefore, &amp;lt;math&amp;gt;m_n&amp;lt;/math&amp;gt; can be computed once we know &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;1&amp;lt;k\le n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Each &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt; can be estimated by sampling uniformly from the set &amp;lt;math&amp;gt;\mathcal{M}_k\cup\mathcal{M}_{k-1}&amp;lt;/math&amp;gt;. The algorithm for estimating &amp;lt;math&amp;gt;m_n&amp;lt;/math&amp;gt; is outlined as:&lt;br /&gt;
# For each &amp;lt;math&amp;gt;1&amp;lt;k\le n&amp;lt;/math&amp;gt;, have an FPRAS for computing the &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt; by uniform sampling sufficiently many members from &amp;lt;math&amp;gt;\mathcal{M}_k\cup\mathcal{M}_{k-1}&amp;lt;/math&amp;gt; as&lt;br /&gt;
::*uniformly sample &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; matching from &amp;lt;math&amp;gt;\mathcal{M}_k\cup\mathcal{M}_{k-1}&amp;lt;/math&amp;gt;, for some polynomially large &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;;&lt;br /&gt;
::* assuming that there are &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; sampled matchings of size &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;, return &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r_k=\frac{X}{N-X}&amp;lt;/math&amp;gt;.&lt;br /&gt;
:2.  Compute &amp;lt;math&amp;gt;m_n&amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;m_n=m_1\prod_{k=2}^n r_k&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;m_1=|E|&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
There are several issues that we have to deal with in order to have a fully functional FPRAS for counting perfect matchings.&lt;br /&gt;
* By taking the product of &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt;&#039;s, the errors for individual &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt;&#039;s add up.&lt;br /&gt;
* In order to accurately estimate &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt; by sampling from &amp;lt;math&amp;gt;\mathcal{M}_k\cup\mathcal{M}_{k-1}&amp;lt;/math&amp;gt;, the ratio &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt; should be within the range &amp;lt;math&amp;gt;\left[\frac{1}{\alpha},\alpha\right]&amp;lt;/math&amp;gt; for some &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; within polynomial of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&lt;br /&gt;
* Implement the uniform sampling from &amp;lt;math&amp;gt;\mathcal{M}_k\cup\mathcal{M}_{k-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Estimator for each &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Accumulation of errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Near-uniform sampling from &amp;lt;math&amp;gt;\mathcal{M}_k\cup\mathcal{M}_{k-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
In the last lecture, we have shown that by random walk, we can sample a near-uniform member of &amp;lt;math&amp;gt;\mathcal{M}_n\cup\mathcal{M}_{n-1}&amp;lt;/math&amp;gt; in poly-time.&lt;br /&gt;
&lt;br /&gt;
=== Volume estimation  ===&lt;br /&gt;
We consider the problem of computing the volume of a given [http://en.wikipedia.org/wiki/Convex_body convex body] &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; dimensions. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;\Upsilon(K)\,&amp;lt;/math&amp;gt; to denote the volume of the convex body &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt;. Abstractly, the problem is that given as input a convex body &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; dimensions, return the &amp;lt;math&amp;gt;\Upsilon(K)\,&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We should be more specific about the input model. Since we allow an arbitrary convex body as input, it is not even clear how to describe the body. We assume that &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; is described by means of a &#039;&#039;&#039;membership oracle&#039;&#039;&#039; &amp;lt;math&amp;gt;\mathcal{O}&amp;lt;/math&amp;gt;, such that  for a &#039;&#039;&#039;query&#039;&#039;&#039; of an &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-dimensional point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\mathcal{O}(x)&amp;lt;/math&amp;gt; indicates whether &amp;lt;math&amp;gt;x\in K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example, the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-dimensional convex body defined by the intersection of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; half-spaces, which is the set of feasible solutions to a system of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; linear constraints, can be described as&lt;br /&gt;
:&amp;lt;math&amp;gt;A x\le \boldsymbol{b}&amp;lt;/math&amp;gt;,&lt;br /&gt;
for some &amp;lt;math&amp;gt;m\times n&amp;lt;/math&amp;gt; matrix &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt;-dimensional vector &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;. For a query of an &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;, the membership oracle &amp;lt;math&amp;gt;\mathcal{O}&amp;lt;/math&amp;gt; just check whether &amp;lt;math&amp;gt;Ax\le b&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For deterministic algorithms, there are negative news for this problem.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Theorem (Bárány-Füredi 1987)&#039;&#039;&#039;&lt;br /&gt;
:Suppose that a deterministic poly-time algorithm uses the membership oracle for a convex body &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; dimensions, and generates an upper bound &amp;lt;math&amp;gt;\Upsilon_u\,&amp;lt;/math&amp;gt; and a lower bound &amp;lt;math&amp;gt;\Upsilon_\ell\,&amp;lt;/math&amp;gt; on the volume &amp;lt;math&amp;gt;\Upsilon(K)\,&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt;. Then, there is a convex body &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; and a constant &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; such that&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{\Upsilon_u}{\Upsilon_\ell}\ge c\left(\frac{n}{\log n}\right)^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
That is said, with deterministic algorithms, we cannot even approximate the volume within a wildly loose range.&lt;br /&gt;
&lt;br /&gt;
Dyer-Frieze-Kannan come up with an idea of estimating the volume of &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; by sampling near-uniformly from convex sets. They reduce the problem of computing approximately the volume of convex bodies to this sampling problem and thus give the first FPRAS for the volume of convex bodies.&lt;br /&gt;
&lt;br /&gt;
For any convex body &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt;, it encloses some &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-dimensional ball and is also enclosed by another ball with larger radius. We assume that the convex body &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; encloses the unit ball around the origin, and is enclosed by a larger ball round the origin with polynomially large radius. Formally, we assume that&lt;br /&gt;
:&amp;lt;math&amp;gt;B(0,1)\subseteq K\subseteq B(0,n^c)&amp;lt;/math&amp;gt; for some constant &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;B(p,r)&amp;lt;/math&amp;gt; denotes a ball of radius &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; as center, i.e. &amp;lt;math&amp;gt;B(p,r)=\{x\mid \|x-p\|\le r \}&amp;lt;/math&amp;gt;. We can make this assumption because it is known that for any convex body &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt;, there exists a linear transformation &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; which can be found within poly-time such that &amp;lt;math&amp;gt;\tau K&amp;lt;/math&amp;gt; transforms the &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; to a convex body that satisfies the assumption, and preserves the ratio of the volumes of the balls to the convex body.&lt;br /&gt;
&lt;br /&gt;
The volumes of the balls are easy to compute. If only the ratio between the convex body and the ball which encloses it, is sufficiently large, then we can apply the Monte Carlo method to estimate &amp;lt;math&amp;gt;\Upsilon(K)\,&amp;lt;/math&amp;gt; by uniformly sampling from the ball.&lt;br /&gt;
&lt;br /&gt;
However, in high-dimension, the ratio between the volume of a convex body and the volume of ball which encloses it, can be exponentially small. This is caused by the so called the &amp;quot;[http://en.wikipedia.org/wiki/Curse_of_dimensionality curse of dimensionality]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Instead of having an outer ball and an inner ball, we define a sequence of balls:&lt;br /&gt;
:&amp;lt;math&amp;gt;B_0=B(0,\lambda^0), B_1=B(0,\lambda^1), B_2=B(0,\lambda^2),\ldots, B_m=B(0,\lambda^m)&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;\lambda=(1+\frac{1}{n})&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; is the smallest positive integer such that &amp;lt;math&amp;gt;\lambda^m\ge n^c&amp;lt;/math&amp;gt;. Therefore, the inner ball &amp;lt;math&amp;gt;B(0,1)=B_0&amp;lt;/math&amp;gt;, the outer ball &amp;lt;math&amp;gt;B(0,n^c)\subseteq B_m&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; is within polynomial of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;. In fact, &amp;lt;math&amp;gt;m\approx cn\ln n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This sequence of balls naturally defines a sequence of convex bodies by intersections as &amp;lt;math&amp;gt;K_i=B_i\cap K&amp;lt;/math&amp;gt;. It is obvious that&lt;br /&gt;
:&amp;lt;math&amp;gt;B(0,1)=K_0\subseteq K_1\subseteq K_2\subseteq\cdots\subseteq K_m=K&amp;lt;/math&amp;gt;.&lt;br /&gt;
Balls are convex, and since the intersection of convex bodies is still convex, the sequence of &amp;lt;math&amp;gt;K_i&amp;lt;/math&amp;gt; is a sequence of convex bodies.&lt;br /&gt;
&lt;br /&gt;
We have the telescopic product:&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\Upsilon(K_0)}{\Upsilon(K_1)}\cdot\frac{\Upsilon(K_1)}{\Upsilon(K_2)}\cdots\frac{\Upsilon(K_{m-1})}{\Upsilon(K_m)}=\frac{\Upsilon(K_0)}{\Upsilon(K_m)}=\frac{\Upsilon(B(0,1))}{\Upsilon(K)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore, the volume &amp;lt;math&amp;gt;\Upsilon(K)\,&amp;lt;/math&amp;gt; can be computed as &lt;br /&gt;
:&amp;lt;math&amp;gt;\Upsilon(K)=\Upsilon(B(0,1))\cdot\prod_{i=1}^{m}\frac{\Upsilon(K_{i})}{\Upsilon(K_{i-1})}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The volume of unite ball &amp;lt;math&amp;gt;\Upsilon(B(0,1))\,&amp;lt;/math&amp;gt; can be precisely computed in poly-time. Each &amp;lt;math&amp;gt;\frac{\Upsilon(K_{i})}{\Upsilon(K_{i-1})}&amp;lt;/math&amp;gt; is computed by near-uniform sampling from &amp;lt;math&amp;gt;K_{i}&amp;lt;/math&amp;gt;, which encloses &amp;lt;math&amp;gt;K_{i-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Another observation is that the ratio &amp;lt;math&amp;gt;\frac{\Upsilon(K_{i})}{\Upsilon(K_{i-1})}&amp;lt;/math&amp;gt; is well-bounded. Recall that &amp;lt;math&amp;gt;K_i=B(0,\lambda^i)\cap K&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;\lambda=(1+\frac{1}{n})&amp;lt;/math&amp;gt;. It can be proved that in &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; dimensions, the volume of &amp;lt;math&amp;gt;K_i&amp;lt;/math&amp;gt; is at most &amp;lt;math&amp;gt;\lambda^n&amp;lt;/math&amp;gt; times the &amp;lt;math&amp;gt;K_{i-1}&amp;lt;/math&amp;gt;, thus the ratio &amp;lt;math&amp;gt;\frac{\Upsilon(K_{i})}{\Upsilon(K_{i-1})}&amp;lt;/math&amp;gt; is at most &amp;lt;math&amp;gt;\lambda^n=O(1)&amp;lt;/math&amp;gt;. By the estimator theorem, we can have an FPRAS for the ratio &amp;lt;math&amp;gt;\frac{\Upsilon(K_{i})}{\Upsilon(K_{i-1})}&amp;lt;/math&amp;gt; if we can uniformly sample from &amp;lt;math&amp;gt;K_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Uniformly sampling from an arbitrary convex body is replaced by near-uniform sampling achieved by random walks. In the original walk of Dyer-Frieze-Kannan, they consider the random walk over &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-dimensional discrete grid points enclosed by &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt;, and prove that the walk is rapid mixing. This gives us the first FPRAS for volume estimation which runs in &amp;lt;math&amp;gt;\tilde{O}(n^{23})&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\tilde{O}(\cdot)&amp;lt;/math&amp;gt; ignores the polylogarithmic factors.&lt;br /&gt;
&lt;br /&gt;
The time bound was later improved by a series of works, each introducing some new ideas.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
| || complexity || new ingredient(s)&lt;br /&gt;
|-&lt;br /&gt;
| Dyer-Frieze-Kannan 1991 || align=&amp;quot;center&amp;quot; | &amp;lt;math&amp;gt;n^{23}&amp;lt;/math&amp;gt; || everything&lt;br /&gt;
|-&lt;br /&gt;
| Lovász-Simonovits 1990 || align=&amp;quot;center&amp;quot; | &amp;lt;math&amp;gt;n^{16}&amp;lt;/math&amp;gt; || localization lemma&lt;br /&gt;
|-&lt;br /&gt;
| Applegate-Kannan 1990 || align=&amp;quot;center&amp;quot; | &amp;lt;math&amp;gt;n^{10}&amp;lt;/math&amp;gt; || logconcave sampling&lt;br /&gt;
|-&lt;br /&gt;
| Lovász 1990 || align=&amp;quot;center&amp;quot; | &amp;lt;math&amp;gt;n^{10}&amp;lt;/math&amp;gt; || ball walk&lt;br /&gt;
|-&lt;br /&gt;
| Dyer-Frieze 1991 || align=&amp;quot;center&amp;quot; | &amp;lt;math&amp;gt;n^8&amp;lt;/math&amp;gt; || better error analysis&lt;br /&gt;
|-&lt;br /&gt;
| Lovász-Simonovits 1993 || align=&amp;quot;center&amp;quot; | &amp;lt;math&amp;gt;n^7&amp;lt;/math&amp;gt; || many improvements&lt;br /&gt;
|-&lt;br /&gt;
| Kannan-Lovász-Simonovits 1997 || align=&amp;quot;center&amp;quot; | &amp;lt;math&amp;gt;n^5&amp;lt;/math&amp;gt; || isotropy, speedy walk&lt;br /&gt;
|-&lt;br /&gt;
| Lovász-Vempala 2003 || align=&amp;quot;center&amp;quot; | &amp;lt;math&amp;gt;n^4&amp;lt;/math&amp;gt; || simulated annealing, hit-and-run&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
(cited from &amp;quot;Geometric Random Walks: A Survey&amp;quot; by Santosh Vempala.)&lt;br /&gt;
&lt;br /&gt;
The current best upper bound is &amp;lt;math&amp;gt;\tilde{O}(n^4)&amp;lt;/math&amp;gt; due to Lovász and Vempala in 2003. It is conjectured that the optimal bound is &amp;lt;math&amp;gt;\Theta(n^3)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Linear Programming ==&lt;br /&gt;
&lt;br /&gt;
=== LP and convex polytopes ===&lt;br /&gt;
&lt;br /&gt;
=== The simplex algorithms ===&lt;br /&gt;
&lt;br /&gt;
=== An LP solver via random walks ===&lt;/div&gt;</summary>
		<author><name>172.16.65.36</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Approximate_counting,_linear_programming&amp;diff=2437</id>
		<title>Randomized Algorithms (Spring 2010)/Approximate counting, linear programming</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Approximate_counting,_linear_programming&amp;diff=2437"/>
		<updated>2010-05-23T14:48:40Z</updated>

		<summary type="html">&lt;p&gt;172.16.65.36: /* The Jerrum-Sinclair algorithm */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Counting Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Complexity model ===&lt;br /&gt;
&lt;br /&gt;
=== FPRAS ===&lt;br /&gt;
&lt;br /&gt;
== Approximate Counting ==&lt;br /&gt;
Let us consider the following formal problem.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; be a finite set of known size, and let &amp;lt;math&amp;gt;G\subseteq U&amp;lt;/math&amp;gt;. We want to compute the size of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We assume two devices:&lt;br /&gt;
* A &#039;&#039;&#039;uniform sampler&#039;&#039;&#039; &amp;lt;math&amp;gt;\mathcal{U}&amp;lt;/math&amp;gt;, which uniformly and independently samples a member of &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; upon each calling.&lt;br /&gt;
* A &#039;&#039;&#039;membership oracle&#039;&#039;&#039; of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;, denoted &amp;lt;math&amp;gt;\mathcal{O}&amp;lt;/math&amp;gt;. Given as the input an &amp;lt;math&amp;gt;x\in U&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\mathcal{O}(x)&amp;lt;/math&amp;gt; indicates whether or not &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is a member of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Equipped by &amp;lt;math&amp;gt;\mathcal{U}&amp;lt;/math&amp;gt; and  &amp;lt;math&amp;gt;\mathcal{O}&amp;lt;/math&amp;gt;, we can have the following Monte Carlo algorithm:&lt;br /&gt;
*Choose &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; independent samples from &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt;by the uniform sampler &amp;lt;math&amp;gt;\mathcal{U}&amp;lt;/math&amp;gt;, represented by the random variables &amp;lt;math&amp;gt;X_1,X_2,\ldots, X_N&amp;lt;/math&amp;gt;. &lt;br /&gt;
* Let &amp;lt;math&amp;gt;Y_i&amp;lt;/math&amp;gt; be the indicator random variable defined as &amp;lt;math&amp;gt;Y_i=\mathcal{O}(X_i)&amp;lt;/math&amp;gt;, namely, &amp;lt;math&amp;gt;Y_i&amp;lt;/math&amp;gt; indicates whether &amp;lt;math&amp;gt;X_i\in G&amp;lt;/math&amp;gt;.&lt;br /&gt;
* Define the estimator random variable&lt;br /&gt;
::&amp;lt;math&amp;gt;Z=\frac{|U|}{N}\sum_{i=1}^N Y_i.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is easy to see that &amp;lt;math&amp;gt;\mathbf{E}[Z]=|G|&amp;lt;/math&amp;gt; and we might hope that with high probability the value of &amp;lt;math&amp;gt;Z&amp;lt;/math&amp;gt; is close to &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt;. Formally, &amp;lt;math&amp;gt;Z&amp;lt;/math&amp;gt; is called an &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;-approximation of &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt; if&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
(1-\epsilon)|G|\le Z\le (1+\epsilon)|G|.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following theorem states that the probabilistic accuracy of the estimation depends on the number of samples and the ratio between &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;|U|&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Theorem (estimator theorem)&#039;&#039;&#039;&lt;br /&gt;
:Let &amp;lt;math&amp;gt;\alpha=\frac{|G|}{|U|}&amp;lt;/math&amp;gt;. Then the Monte Carlo method yields an &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;-approximation to &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt; with probability at least &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt; provided&lt;br /&gt;
::&amp;lt;math&amp;gt;N\ge\frac{4}{\epsilon \alpha}\ln\frac{2}{\delta}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Proof&#039;&#039;&#039;: Use the Chernoff bound.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\square&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A counting algorithm for the set &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; has to deal with the following three complications:&lt;br /&gt;
* Implement the membership oracle &amp;lt;math&amp;gt;\mathcal{O}&amp;lt;/math&amp;gt;. This is usually straightforward, or assumed by the model.&lt;br /&gt;
* Implement the uniform sampler &amp;lt;math&amp;gt;\mathcal{U}&amp;lt;/math&amp;gt;. As we have seen, this is usually approximated by random walks. How to design the random walk and bound its mixing rate is usually technical challenging, if possible at all.&lt;br /&gt;
* Deal with exponentially small &amp;lt;math&amp;gt;\alpha=\frac{|G|}{|U|}&amp;lt;/math&amp;gt;. This requires us to cleverly choose the universe &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt;. Sometimes this needs some nontrivial ideas.&lt;br /&gt;
&lt;br /&gt;
=== Counting DNFs ===&lt;br /&gt;
A disjunctive normal form (DNF) formular is a disjunction (OR) of clauses, where each clause is a conjunction (AND) of literals. For example:&lt;br /&gt;
:&amp;lt;math&amp;gt;(x_1\wedge \overline{x_2}\wedge x_3)\vee(x_2\wedge x_4)\vee(\overline{x_1}\wedge x_3\wedge x_4)&amp;lt;/math&amp;gt;.&lt;br /&gt;
Note the difference from the conjunctive normal forms (CNF).&lt;br /&gt;
&lt;br /&gt;
Given a DNF formular &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; as the input, the problem is to count the number of satisfying assignments of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;. This problem is &#039;&#039;&#039;#P-complete&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Naively applying the Monte Carlo method will not give a good answer. Suppose that there are &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; variables. Let &amp;lt;math&amp;gt;U=\{\mathrm{true},\mathrm{false}\}^n&amp;lt;/math&amp;gt; be the set of all truth assignments of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; variables. Let &amp;lt;math&amp;gt;G=\{x\in U\mid \phi(x)=\mathrm{true}\}&amp;lt;/math&amp;gt; be the set of satisfying assignments for &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;. The straightforward use of Monte Carlo method samples &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; assignments from &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; and check how many of them satisfy &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;. This algorithm fails when &amp;lt;math&amp;gt;|G|/|U|&amp;lt;/math&amp;gt; is exponentially small, namely, when exponentially small fraction of the assignments satisfy the input DNF formula. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;The union of sets problem&lt;br /&gt;
We reformulate the DNF counting problem in a more abstract framework, called the &#039;&#039;&#039;union of sets&#039;&#039;&#039; problem. &lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; be a finite universe. We are given &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; subsets &amp;lt;math&amp;gt;H_1,H_2,\ldots,H_m\subseteq V&amp;lt;/math&amp;gt;. The following assumptions hold:&lt;br /&gt;
*For all &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;|H_i|&amp;lt;/math&amp;gt; is computable in poly-time.&lt;br /&gt;
*It is possible to sample uniformly from each individual &amp;lt;math&amp;gt;H_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
*For any &amp;lt;math&amp;gt;x\in V&amp;lt;/math&amp;gt;, it can be determined in poly-time whether &amp;lt;math&amp;gt;x\in H_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The goal is to compute the size of &amp;lt;math&amp;gt;H=\bigcup_{i=1}^m H_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
DNF counting can be interpreted in this general framework as follows. Suppose that the DNF formula &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is defined on &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; variables, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; contains &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; clauses &amp;lt;math&amp;gt;C_1,C_2,\ldots,C_m&amp;lt;/math&amp;gt;, where clause &amp;lt;math&amp;gt;C_i&amp;lt;/math&amp;gt; has &amp;lt;math&amp;gt;k_i&amp;lt;/math&amp;gt; literals. Without loss of generality, we assume that in each clause, each variable appears at most once.&lt;br /&gt;
* &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the set of all assignments.&lt;br /&gt;
*Each &amp;lt;math&amp;gt;H_i&amp;lt;/math&amp;gt; is the set of satisfying assignments for the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-th clause &amp;lt;math&amp;gt;C_i&amp;lt;/math&amp;gt; of the DNF formular &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;. Then the union of sets &amp;lt;math&amp;gt;H=\bigcup_i H_i&amp;lt;/math&amp;gt; gives the set of satisfying assignments for &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;.&lt;br /&gt;
* Each clause &amp;lt;math&amp;gt;C_i&amp;lt;/math&amp;gt; is a conjunction (AND) of literals. It is not hard to see that &amp;lt;math&amp;gt;|H_i|=2^{n-k_i}&amp;lt;/math&amp;gt;, which is efficiently computable.&lt;br /&gt;
* Sampling from an &amp;lt;math&amp;gt;H_i&amp;lt;/math&amp;gt; is simple: we just fix the assignments of the &amp;lt;math&amp;gt;k_i&amp;lt;/math&amp;gt; literals of that clause, and sample uniformly and independently the rest &amp;lt;math&amp;gt;(n-k_i)&amp;lt;/math&amp;gt; variable assignments.&lt;br /&gt;
* For each assignment &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;, it is easy to check whether it satisfies a clause &amp;lt;math&amp;gt;C_i&amp;lt;/math&amp;gt;, thus it is easy to determine whether &amp;lt;math&amp;gt;x\in H_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;The coverage algorithm&lt;br /&gt;
We now introduce the coverage algorithm for the union of sets problem.&lt;br /&gt;
&lt;br /&gt;
Consider the multiset &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; defined by&lt;br /&gt;
:&amp;lt;math&amp;gt;U=H_1\uplus H_2\uplus\cdots \uplus H_m&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;\uplus&amp;lt;/math&amp;gt; denotes the multiset union. It is more convenient to define &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; as the set&lt;br /&gt;
:&amp;lt;math&amp;gt;U=\{(x,i)\mid x\in H_i\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
For each &amp;lt;math&amp;gt;x\in H&amp;lt;/math&amp;gt;, there may be more than one instances of &amp;lt;math&amp;gt;(x,i)\in U&amp;lt;/math&amp;gt;. We can choose a unique representative among the multiple instances &amp;lt;math&amp;gt;(x,i)\in U&amp;lt;/math&amp;gt; for the same &amp;lt;math&amp;gt;x\in H&amp;lt;/math&amp;gt;, by choosing the &amp;lt;math&amp;gt;(x,i)&amp;lt;/math&amp;gt; with the minimum &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;, and form a set &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Formally, &amp;lt;math&amp;gt;G=\{(x,i)\in U\mid \forall (x,j)\in U, j\le i\}&amp;lt;/math&amp;gt;. Every &amp;lt;math&amp;gt;x\in H&amp;lt;/math&amp;gt; corresponds to a unique &amp;lt;math&amp;gt;(x,i)\in G&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is the smallest among &amp;lt;math&amp;gt;x\in H_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is obvious that &amp;lt;math&amp;gt;G\subseteq U&amp;lt;/math&amp;gt; and&lt;br /&gt;
:&amp;lt;math&amp;gt;|G|=|H|&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Therefore, estimation of &amp;lt;math&amp;gt;|H|&amp;lt;/math&amp;gt; is reduced to estimation of &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;G\subseteq U&amp;lt;/math&amp;gt;. Then &amp;lt;math&amp;gt;|G|&amp;lt;/math&amp;gt; can have an &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;-approximation with probability &amp;lt;math&amp;gt;(1-\delta)&amp;lt;/math&amp;gt; in poly-time, if we can uniformly sample from &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;|G|/|U|&amp;lt;/math&amp;gt; is suitably small.&lt;br /&gt;
&lt;br /&gt;
An uniform sample from &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; can be implemented as follows:&lt;br /&gt;
* generate an &amp;lt;math&amp;gt;i\in\{1,2,\ldots,m\}&amp;lt;/math&amp;gt; with probability &amp;lt;math&amp;gt;\frac{|H_i|}{\sum_{i=1}^m|H_i|}&amp;lt;/math&amp;gt;;&lt;br /&gt;
* uniformly sample an &amp;lt;math&amp;gt;x\in H_i&amp;lt;/math&amp;gt;, and return &amp;lt;math&amp;gt;(x,i)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is easy to see that this gives a uniform member of &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt;. The above sampling procedure is poly-time because each &amp;lt;math&amp;gt;|H_i|&amp;lt;/math&amp;gt; can be computed in poly-time, and sampling uniformly from each &amp;lt;math&amp;gt;H_i&amp;lt;/math&amp;gt; is poly-time.&lt;br /&gt;
&lt;br /&gt;
We now only need to lower bound the ratio&lt;br /&gt;
:&amp;lt;math&amp;gt;\alpha=\frac{|G|}{|U|}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We claim that &lt;br /&gt;
:&amp;lt;math&amp;gt;\alpha\ge\frac{1}{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
It is easy to see this, because each &amp;lt;math&amp;gt;x\in H&amp;lt;/math&amp;gt; has at most &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; instances of &amp;lt;math&amp;gt;(x,i)&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt;, and we already know that &amp;lt;math&amp;gt;|G|=|H|&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Due to the estimator theorem, this needs &amp;lt;math&amp;gt;\frac{4m}{\epsilon}\ln\frac{2}{\delta}&amp;lt;/math&amp;gt; uniform random samples from &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This gives the coverage algorithm for the abstract problem of the union of sets. The DNF counting is a special case of it.&lt;br /&gt;
&lt;br /&gt;
=== Permanents and perfect matchings ===&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U=\{u_1,u_2,\ldots,u_n\}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;V=\{v_1,v_2,\ldots,v_n\}&amp;lt;/math&amp;gt;. Consider a bipartite graph &amp;lt;math&amp;gt;G(U,V,E)&amp;lt;/math&amp;gt;. An &amp;lt;math&amp;gt;M\subseteq E&amp;lt;/math&amp;gt; is a &#039;&#039;&#039;perfect matching&#039;&#039;&#039; of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; if every vertex of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt; has exactly one edge in &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; adjacent to it.&lt;br /&gt;
&lt;br /&gt;
Given a bipartite graph &amp;lt;math&amp;gt;G(U,V,E)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;|U|=|V|=n&amp;lt;/math&amp;gt;, we want to count the number of perfect matchings of &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;. This problem can be reduced to computing the &#039;&#039;&#039;permanent&#039;&#039;&#039; of a square matrix.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Definition (permanent)&#039;&#039;&#039;&lt;br /&gt;
:Let &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; be an &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrix. The &#039;&#039;&#039;permanent&#039;&#039;&#039; of the matrix is defined as&lt;br /&gt;
::&amp;lt;math&amp;gt;\mathrm{per}(Q)=\sum_{\pi\in\mathbb{S}_n}\prod_{i=1}^n Q_{i,\pi(i)}&amp;lt;/math&amp;gt;,&lt;br /&gt;
:where &amp;lt;math&amp;gt;\mathbb{S}_n&amp;lt;/math&amp;gt; is the symmetric group of permutation of size &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If we multiply each term of the sum the sign of the permutation, then it gives us the determinant of the matrix, &lt;br /&gt;
:&amp;lt;math&amp;gt;\det(Q)=\sum_{\pi\in\mathbb{S}_n}\sgn(\pi)\prod_{i=1}^n Q_{i,\pi(i)}&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;\sgn(\pi)&amp;lt;/math&amp;gt;, the sign of a permutation, is either &amp;lt;math&amp;gt;-1&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;+1&amp;lt;/math&amp;gt;, according to whether the minimum number of pair-wise interchanges to achieve &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1,2,\ldots,n)&amp;lt;/math&amp;gt; is odd or even.&lt;br /&gt;
&lt;br /&gt;
A bipartite graph &amp;lt;math&amp;gt;G(U,V,E)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;|U|=|V|=n&amp;lt;/math&amp;gt; can be represented by an &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrix &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; with 0-1 entries as follows:&lt;br /&gt;
* Each row of &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; corresponds to a vertex in &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; and each column of &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; corresponds to a vertex in &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt;.&lt;br /&gt;
::&amp;lt;math&amp;gt;Q_{ij}=\begin{cases}&lt;br /&gt;
1 &amp;amp; \mbox{if }i\sim j,\\&lt;br /&gt;
0 &amp;amp; \mbox{otherwise}.&lt;br /&gt;
\end{cases}&amp;lt;/math&amp;gt;&lt;br /&gt;
Note the subtle difference between the definition of &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; and the adjacency matrix. &lt;br /&gt;
&lt;br /&gt;
Each perfect matching corresponds to a permutation &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;(u,\pi(u))\in E&amp;lt;/math&amp;gt; for every &amp;lt;math&amp;gt;u\in U&amp;lt;/math&amp;gt;, which corresponds to a permutation &amp;lt;math&amp;gt;\pi\in\mathbb{S}_n&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\prod_{i=1}^n Q_{i,\pi(i)}=1&amp;lt;/math&amp;gt;. It is than easy to see that &amp;lt;math&amp;gt;\mathrm{per}(Q)&amp;lt;/math&amp;gt; gives the number of perfect matchings in the bipartite graph &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is known that counting the number of perfect matchings in a bipartite graph is &#039;&#039;&#039;#P-hard&#039;&#039;&#039;. Since this problem can be reduced to computing the permanent, thus the problem of computing the permanents is also &#039;&#039;&#039;#P-hard&#039;&#039;&#039;. This is quite different from the case of determinants, since the determinants can be computed in poly-time.&lt;br /&gt;
&lt;br /&gt;
Now we show that with randomization, we can approximate the number of perfect matchings in a bipartite graph. In particular, we will give an FPRAS for counting the perfect matchings in a bipartite graph.&lt;br /&gt;
&lt;br /&gt;
==== The Jerrum-Sinclair algorithm ====&lt;br /&gt;
Fix a bipartite graph &amp;lt;math&amp;gt;G(U,V,E)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;|U|=|V|=n&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;\mathcal{M}_k&amp;lt;/math&amp;gt; be the set of matchings of size &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;m_k=|\mathcal{M}_k|&amp;lt;/math&amp;gt;. Thus, &amp;lt;math&amp;gt;\mathcal{M}_k&amp;lt;/math&amp;gt; is the set of perfect matchings in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;, and our goal is to compute &amp;lt;math&amp;gt;m_n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;r_k=\frac{m_k}{m_{k-1}}&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;1&amp;lt;k\le n&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
:&amp;lt;math&amp;gt;m_k=m_{k-1}r_k&amp;lt;/math&amp;gt;,&lt;br /&gt;
which gives us a recursion to compute the &amp;lt;math&amp;gt;m_n&amp;lt;/math&amp;gt;, as&lt;br /&gt;
:&amp;lt;math&amp;gt;m_n=m_{1}\frac{m_2}{m_1}\cdot\frac{m_3}{m_2}\cdots\frac{m_n}{m_{n-1}}=m_1\prod_{k=2}^n r_k&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;m_1=|\mathcal{M}_1|&amp;lt;/math&amp;gt; is the number of matchings of size 1 in the bipartite graph &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;, which is just the number of edges in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;. Therefore, &amp;lt;math&amp;gt;m_n&amp;lt;/math&amp;gt; can be computed once we know &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;1&amp;lt;k\le n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Each &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt; can be estimated by sampling uniformly from the set &amp;lt;math&amp;gt;\mathcal{M}_k\cup\mathcal{M}_{k-1}&amp;lt;/math&amp;gt;. The algorithm for estimating &amp;lt;math&amp;gt;m_n&amp;lt;/math&amp;gt; is outlined as:&lt;br /&gt;
# For each &amp;lt;math&amp;gt;1&amp;lt;k\le n&amp;lt;/math&amp;gt;, have an FPRAS for computing the &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt; by uniform sampling sufficiently many members from &amp;lt;math&amp;gt;\mathcal{M}_k\cup\mathcal{M}_{k-1}&amp;lt;/math&amp;gt; as&lt;br /&gt;
::*uniformly sample &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; matching from &amp;lt;math&amp;gt;\mathcal{M}_k\cup\mathcal{M}_{k-1}&amp;lt;/math&amp;gt;, for some polynomially large &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;;&lt;br /&gt;
::* assuming that there are &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; sampled matchings of size &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;, return &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r_k=\frac{X}{N-X}&amp;lt;/math&amp;gt;.&lt;br /&gt;
:2.  Compute &amp;lt;math&amp;gt;m_n&amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;m_n=m_1\prod_{k=2}^n r_k&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;m_1=|E|&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
There are several issues that we have to deal with in order to have a fully functional FPRAS for counting perfect matchings.&lt;br /&gt;
* By taking the product of &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt;&#039;s, the errors for individual &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt;&#039;s add up.&lt;br /&gt;
* In order to accurately estimate &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt; by sampling from &amp;lt;math&amp;gt;\mathcal{M}_k\cup\mathcal{M}_{k-1}&amp;lt;/math&amp;gt;, the ratio &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt; should be within the range &amp;lt;math&amp;gt;\left[\frac{1}{\alpha},\alpha\right]&amp;lt;/math&amp;gt; for some &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; within polynomial of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&lt;br /&gt;
* Implement the uniform sampling from &amp;lt;math&amp;gt;\mathcal{M}_k\cup\mathcal{M}_{k-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Estimator for each &amp;lt;math&amp;gt;r_k&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Accumulation of errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Near-uniform sampling from &amp;lt;math&amp;gt;\mathcal{M}_k\cup\mathcal{M}_{k-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
In the last lecture, we have shown that by random walk, we can sample a near-uniform member of &amp;lt;math&amp;gt;\mathcal{M}_n\cup\mathcal{M}_{n-1}&amp;lt;/math&amp;gt; in poly-time.&lt;br /&gt;
&lt;br /&gt;
=== Volume estimation  ===&lt;br /&gt;
&lt;br /&gt;
== Linear Programming ==&lt;br /&gt;
&lt;br /&gt;
=== LP and convex polytopes ===&lt;br /&gt;
&lt;br /&gt;
=== The simplex algorithms ===&lt;br /&gt;
&lt;br /&gt;
=== An LP solver via random walks ===&lt;/div&gt;</summary>
		<author><name>172.16.65.36</name></author>
	</entry>
</feed>