<?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.21.7.100</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.21.7.100"/>
	<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Special:Contributions/172.21.7.100"/>
	<updated>2026-05-01T18:12:57Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/More_on_Chernoff_bounds&amp;diff=1380</id>
		<title>Randomized Algorithms (Spring 2010)/More on Chernoff bounds</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/More_on_Chernoff_bounds&amp;diff=1380"/>
		<updated>2010-02-24T14:39:50Z</updated>

		<summary type="html">&lt;p&gt;172.21.7.100: /* Routing in a hypercube */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Permutation Routing ==&lt;br /&gt;
The problem raises from parallel computing. Consider that we have &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; processors, connected by a communication network. The processors communicate with each other by sending and receiving &#039;&#039;&#039;packets&#039;&#039;&#039; through the network. We consider the following packet routing problem:&lt;br /&gt;
* Every processor is sending a packet to a unique destination. Therefore for &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt; the set of processors, the destinations are given by a &#039;&#039;&#039;permutation&#039;&#039;&#039; &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt;, such that for every processor &amp;lt;math&amp;gt;i\in[N]&amp;lt;/math&amp;gt;, the processor &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is sending a packet to processor &amp;lt;math&amp;gt;\pi(i)&amp;lt;/math&amp;gt;.&lt;br /&gt;
* The communication is &#039;&#039;&#039;synchronized&#039;&#039;&#039;, such that for each &#039;&#039;&#039;round&#039;&#039;&#039;, every link (an edge of the graph) can forward at most one packet.&lt;br /&gt;
&lt;br /&gt;
With a complete graph as the network. For any permutation &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt;, all packets can be routed to their destinations in parallel with one round of communication. However, such an ideal connectivity is usually not available in reality, either because they are too expensive, or because they are physically impossible. We are interested in the case the graph is &#039;&#039;&#039;sparse&#039;&#039;&#039;, such that the number of edges is significantly smaller than the complete graph, yet the distance between any pair of vertices is small, so that the packets can be efficiently routed between pairs of vertices.&lt;br /&gt;
&lt;br /&gt;
The hypercube is one of the graphs with these desirable properties.&lt;br /&gt;
&lt;br /&gt;
=== Routing in a hypercube ===&lt;br /&gt;
A [http://en.wikipedia.org/wiki/Hypercube hypercube], sometimes called a Boolean cube, a Hamming cube, or just cube, is defined over &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; nodes, for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; a power of 2. We assume that &amp;lt;math&amp;gt;N=2^d&amp;lt;/math&amp;gt;. A hypercube of &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; dimensions, or a &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;-cube, is an undirected graph with the vertex set &amp;lt;math&amp;gt;\{0,1\}^d&amp;lt;/math&amp;gt;, such that for any &amp;lt;math&amp;gt;u,v\in\{0,1\}^d&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; are adjacent if and only if &amp;lt;math&amp;gt;h(u,v)=1&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;h(u,v)&amp;lt;/math&amp;gt; is the [http://en.wikipedia.org/wiki/Hamming_distance Hamming distance] between &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;-cube is a &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;-degree regular graph over &amp;lt;math&amp;gt;N=2^d&amp;lt;/math&amp;gt; vertices. For any pair &amp;lt;math&amp;gt;(u,v)&amp;lt;/math&amp;gt; of vertices, the distance between &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is at most &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;. (How do we know this? Since it takes at most &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; steps to fix any binary string of length &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; bit-by-bit to any other.) This directly gives us the following very natural routing algorithm.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Bit-Fixing Routing Algorithm:&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|For each packet:&lt;br /&gt;
#Let &amp;lt;math&amp;gt;u, v\in\{0,1\}^d&amp;lt;/math&amp;gt; be the origin and destination of the packet respectively.&lt;br /&gt;
#For &amp;lt;math&amp;gt;i=1&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;, do:&lt;br /&gt;
::if &amp;lt;math&amp;gt;u_i\neq v_i&amp;lt;/math&amp;gt; then traverse the edge &amp;lt;math&amp;gt;(v_1,\ldots,v_{i-1},u_i,\ldots,u_d)\rightarrow (v_1,\ldots,v_{i-1},v_i,u_{i+1}\ldots,u_d)&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This algorithm is blessed with a desirable property: it depends only on the origin, the destination, and the current node. We call the algorithms with this property &#039;&#039;&#039;oblivious&#039;&#039;&#039; routing algorithms. Compared to the routing algorithms which are adaptive to the path that the packet traversed, oblivious routing is more simple thus can be implemented by smaller routing table (or simple devices called &#039;&#039;&#039;switches&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
When routing all &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; packet in parallel, it is possible that more than one packets want to use the same edge at the same time. We assume that a queue is associated to each edge. With some &amp;quot;queuing policy&amp;quot;, which specifies the schedule of delivering the packets in the queue.&lt;br /&gt;
&lt;br /&gt;
== Johnson-Lindenstrauss Theorem ==&lt;/div&gt;</summary>
		<author><name>172.21.7.100</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/More_on_Chernoff_bounds&amp;diff=1379</id>
		<title>Randomized Algorithms (Spring 2010)/More on Chernoff bounds</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/More_on_Chernoff_bounds&amp;diff=1379"/>
		<updated>2010-02-24T14:23:46Z</updated>

		<summary type="html">&lt;p&gt;172.21.7.100: /* Routing in a hypercube */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Permutation Routing ==&lt;br /&gt;
The problem raises from parallel computing. Consider that we have &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; processors, connected by a communication network. The processors communicate with each other by sending and receiving &#039;&#039;&#039;packets&#039;&#039;&#039; through the network. We consider the following packet routing problem:&lt;br /&gt;
* Every processor is sending a packet to a unique destination. Therefore for &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt; the set of processors, the destinations are given by a &#039;&#039;&#039;permutation&#039;&#039;&#039; &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt;, such that for every processor &amp;lt;math&amp;gt;i\in[N]&amp;lt;/math&amp;gt;, the processor &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is sending a packet to processor &amp;lt;math&amp;gt;\pi(i)&amp;lt;/math&amp;gt;.&lt;br /&gt;
* The communication is &#039;&#039;&#039;synchronized&#039;&#039;&#039;, such that for each &#039;&#039;&#039;round&#039;&#039;&#039;, every link (an edge of the graph) can forward at most one packet.&lt;br /&gt;
&lt;br /&gt;
With a complete graph as the network. For any permutation &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt;, all packets can be routed to their destinations in parallel with one round of communication. However, such an ideal connectivity is usually not available in reality, either because they are too expensive, or because they are physically impossible. We are interested in the case the graph is &#039;&#039;&#039;sparse&#039;&#039;&#039;, such that the number of edges is significantly smaller than the complete graph, yet the distance between any pair of vertices is small, so that the packets can be efficiently routed between pairs of vertices.&lt;br /&gt;
&lt;br /&gt;
The hypercube is one of the graphs with these desirable properties.&lt;br /&gt;
&lt;br /&gt;
=== Routing in a hypercube ===&lt;br /&gt;
A [http://en.wikipedia.org/wiki/Hypercube hypercube], sometimes called a Boolean cube, a Hamming cube, or just cube, is defined over &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; nodes, for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; a power of 2. We assume that &amp;lt;math&amp;gt;N=2^d&amp;lt;/math&amp;gt;. A hypercube of &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; dimensions, or a &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;-cube, is an undirected graph with the vertex set &amp;lt;math&amp;gt;\{0,1\}^d&amp;lt;/math&amp;gt;, such that for any &amp;lt;math&amp;gt;u,v\in\{0,1\}^d&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; are adjacent if and only if &amp;lt;math&amp;gt;h(u,v)=1&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;h(u,v)&amp;lt;/math&amp;gt; is the [http://en.wikipedia.org/wiki/Hamming_distance Hamming distance] between &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;-cube is a &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;-degree regular graph over &amp;lt;math&amp;gt;N=2^d&amp;lt;/math&amp;gt; vertices. For any pair &amp;lt;math&amp;gt;(u,v)&amp;lt;/math&amp;gt; of vertices, the distance between &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is at most &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;. (How do we know this? Since it takes at most &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; steps to fix any binary string of length &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; bit-by-bit to any other.) This directly gives us the following very natural routing algorithm.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Bit-Fixing Algorithm:&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|For each packet:&lt;br /&gt;
#Let &amp;lt;math&amp;gt;u, v\in\{0,1\}^d&amp;lt;/math&amp;gt; be the origin and destination of the packet respectively.&lt;br /&gt;
#For &amp;lt;math&amp;gt;i=1&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;, do:&lt;br /&gt;
::if &amp;lt;math&amp;gt;u_i\neq v_i&amp;lt;/math&amp;gt; then traverse the edge &amp;lt;math&amp;gt;(v_1,\ldots,v_{i-1},u_i,\ldots,u_d)\rightarrow (v_1,\ldots,v_{i-1},v_i,u_{i+1}\ldots,u_d)&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This algorithm is blessed with a very good property: it depends only on the origin, the destination, and the current node. We call the algorithms with this property &#039;&#039;&#039;oblivious&#039;&#039;&#039; routing algorithms. Compared to the routing algorithms which are adaptive to the path that the packet traversed, oblivious routing is more simple thus can be implemented by smaller routing table (or simple devices called &#039;&#039;&#039;switches&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
== Johnson-Lindenstrauss Theorem ==&lt;/div&gt;</summary>
		<author><name>172.21.7.100</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/More_on_Chernoff_bounds&amp;diff=1378</id>
		<title>Randomized Algorithms (Spring 2010)/More on Chernoff bounds</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/More_on_Chernoff_bounds&amp;diff=1378"/>
		<updated>2010-02-24T14:21:35Z</updated>

		<summary type="html">&lt;p&gt;172.21.7.100: /* Routing in a hypercube */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Permutation Routing ==&lt;br /&gt;
The problem raises from parallel computing. Consider that we have &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; processors, connected by a communication network. The processors communicate with each other by sending and receiving &#039;&#039;&#039;packets&#039;&#039;&#039; through the network. We consider the following packet routing problem:&lt;br /&gt;
* Every processor is sending a packet to a unique destination. Therefore for &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt; the set of processors, the destinations are given by a &#039;&#039;&#039;permutation&#039;&#039;&#039; &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt;, such that for every processor &amp;lt;math&amp;gt;i\in[N]&amp;lt;/math&amp;gt;, the processor &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is sending a packet to processor &amp;lt;math&amp;gt;\pi(i)&amp;lt;/math&amp;gt;.&lt;br /&gt;
* The communication is &#039;&#039;&#039;synchronized&#039;&#039;&#039;, such that for each &#039;&#039;&#039;round&#039;&#039;&#039;, every link (an edge of the graph) can forward at most one packet.&lt;br /&gt;
&lt;br /&gt;
With a complete graph as the network. For any permutation &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt;, all packets can be routed to their destinations in parallel with one round of communication. However, such an ideal connectivity is usually not available in reality, either because they are too expensive, or because they are physically impossible. We are interested in the case the graph is &#039;&#039;&#039;sparse&#039;&#039;&#039;, such that the number of edges is significantly smaller than the complete graph, yet the distance between any pair of vertices is small, so that the packets can be efficiently routed between pairs of vertices.&lt;br /&gt;
&lt;br /&gt;
The hypercube is one of the graphs with these desirable properties.&lt;br /&gt;
&lt;br /&gt;
=== Routing in a hypercube ===&lt;br /&gt;
A [http://en.wikipedia.org/wiki/Hypercube hypercube], sometimes called a Boolean cube, a Hamming cube, or just cube, is defined over &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; nodes, for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; a power of 2. We assume that &amp;lt;math&amp;gt;N=2^d&amp;lt;/math&amp;gt;. A hypercube of &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; dimensions, or a &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;-cube, is an undirected graph with the vertex set &amp;lt;math&amp;gt;\{0,1\}^d&amp;lt;/math&amp;gt;, such that for any &amp;lt;math&amp;gt;u,v\in\{0,1\}^d&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; are adjacent if and only if &amp;lt;math&amp;gt;h(u,v)=1&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;h(u,v)&amp;lt;/math&amp;gt; is the [http://en.wikipedia.org/wiki/Hamming_distance Hamming distance] between &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;-cube is a &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;-degree regular graph over &amp;lt;math&amp;gt;N=2^d&amp;lt;/math&amp;gt; vertices. For any pair &amp;lt;math&amp;gt;(u,v)&amp;lt;/math&amp;gt; of vertices, the distance between &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is at most &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;. (How do we know this? Since it takes at most &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; bits to fix any binary string of length &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; any other.) This directly gives us the following very natural routing algorithm.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Bit-Fixing Algorithm:&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|For each packet:&lt;br /&gt;
#Let &amp;lt;math&amp;gt;u, v\in\{0,1\}^d&amp;lt;/math&amp;gt; be the origin and destination of the packet respectively.&lt;br /&gt;
#For &amp;lt;math&amp;gt;i=1&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;, do:&lt;br /&gt;
::if &amp;lt;math&amp;gt;u_i\neq v_i&amp;lt;/math&amp;gt; then traverse the edge &amp;lt;math&amp;gt;(v_1,\ldots,v_{i-1},u_i,\ldots,u_d)\rightarrow (v_1,\ldots,v_{i-1},v_i,u_{i+1}\ldots,u_d)&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This algorithm is blessed with a very good property: it depends only on the origin, the destination, and the current node. We call the algorithms with this property &#039;&#039;&#039;oblivious&#039;&#039;&#039; routing algorithms. Compared to the routing algorithms which are adaptive to the path that the packet traversed, oblivious routing is more simple thus can be implemented by smaller routing table (or simple devices called &#039;&#039;&#039;switches&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
== Johnson-Lindenstrauss Theorem ==&lt;/div&gt;</summary>
		<author><name>172.21.7.100</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/More_on_Chernoff_bounds&amp;diff=1377</id>
		<title>Randomized Algorithms (Spring 2010)/More on Chernoff bounds</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/More_on_Chernoff_bounds&amp;diff=1377"/>
		<updated>2010-02-24T14:19:15Z</updated>

		<summary type="html">&lt;p&gt;172.21.7.100: /* Routing in a hypercube */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Permutation Routing ==&lt;br /&gt;
The problem raises from parallel computing. Consider that we have &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; processors, connected by a communication network. The processors communicate with each other by sending and receiving &#039;&#039;&#039;packets&#039;&#039;&#039; through the network. We consider the following packet routing problem:&lt;br /&gt;
* Every processor is sending a packet to a unique destination. Therefore for &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt; the set of processors, the destinations are given by a &#039;&#039;&#039;permutation&#039;&#039;&#039; &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt;, such that for every processor &amp;lt;math&amp;gt;i\in[N]&amp;lt;/math&amp;gt;, the processor &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is sending a packet to processor &amp;lt;math&amp;gt;\pi(i)&amp;lt;/math&amp;gt;.&lt;br /&gt;
* The communication is &#039;&#039;&#039;synchronized&#039;&#039;&#039;, such that for each &#039;&#039;&#039;round&#039;&#039;&#039;, every link (an edge of the graph) can forward at most one packet.&lt;br /&gt;
&lt;br /&gt;
With a complete graph as the network. For any permutation &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt;, all packets can be routed to their destinations in parallel with one round of communication. However, such an ideal connectivity is usually not available in reality, either because they are too expensive, or because they are physically impossible. We are interested in the case the graph is &#039;&#039;&#039;sparse&#039;&#039;&#039;, such that the number of edges is significantly smaller than the complete graph, yet the distance between any pair of vertices is small, so that the packets can be efficiently routed between pairs of vertices.&lt;br /&gt;
&lt;br /&gt;
The hypercube is one of the graphs with these desirable properties.&lt;br /&gt;
&lt;br /&gt;
=== Routing in a hypercube ===&lt;br /&gt;
A [http://en.wikipedia.org/wiki/Hypercube hypercube], sometimes called a Boolean cube, a Hamming cube, or just cube, is defined over &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; nodes, for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; a power of 2. We assume that &amp;lt;math&amp;gt;N=2^d&amp;lt;/math&amp;gt;. A hypercube of &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; dimensions, or a &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;-cube, is an undirected graph with the vertex set &amp;lt;math&amp;gt;\{0,1\}^d&amp;lt;/math&amp;gt;, such that for any &amp;lt;math&amp;gt;u,v\in\{0,1\}^d&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; are adjacent if and only if &amp;lt;math&amp;gt;h(u,v)=1&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;h(u,v)&amp;lt;/math&amp;gt; is the [http://en.wikipedia.org/wiki/Hamming_distance Hamming distance] between &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;-cube is a &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;-degree regular graph over &amp;lt;math&amp;gt;N=2^d&amp;lt;/math&amp;gt; vertices. For any pair &amp;lt;math&amp;gt;(u,v)&amp;lt;/math&amp;gt; of vertices, the distance between &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is at most &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;. (How do we know this? Since it takes at most &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; bits to fix any binary string of length &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; any other.) This directly gives us the following very natural routing algorithm.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Bit-Fixing Algorithm:&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|For each packet:&lt;br /&gt;
#Let &amp;lt;math&amp;gt;u, v\in\{0,1\}^d&amp;lt;/math&amp;gt; be the origin and destination of the packet respectively.&lt;br /&gt;
#For &amp;lt;math&amp;gt;i=1&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;, do:&lt;br /&gt;
::if &amp;lt;math&amp;gt;u_i\neq v_i&amp;lt;/math&amp;gt; then traverse the edge &amp;lt;math&amp;gt;(v_1,\ldots,v_{i-1},u_i,\ldots,u_d)\rightarrow (v_1,\ldots,v_{i-1},v_i,u_{i+1}\ldots,u_d)&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This algorithm is blessed with a very good property: it depends only on the origin, the destination, and the current node. We call the algorithms with this property &#039;&#039;&#039;oblivious&#039;&#039;&#039; routing algorithms. Compared to the routing algorithms which are adaptive to the path that the packet traversed, oblivious routing is more simple thus can be implemented by smaller routing table (or simple devices called &#039;&#039;&#039;switches&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
== Johnson-Lindenstrauss Theorem ==&lt;/div&gt;</summary>
		<author><name>172.21.7.100</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/More_on_Chernoff_bounds&amp;diff=1376</id>
		<title>Randomized Algorithms (Spring 2010)/More on Chernoff bounds</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/More_on_Chernoff_bounds&amp;diff=1376"/>
		<updated>2010-02-24T14:18:49Z</updated>

		<summary type="html">&lt;p&gt;172.21.7.100: /* Routing in a hypercube */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Permutation Routing ==&lt;br /&gt;
The problem raises from parallel computing. Consider that we have &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; processors, connected by a communication network. The processors communicate with each other by sending and receiving &#039;&#039;&#039;packets&#039;&#039;&#039; through the network. We consider the following packet routing problem:&lt;br /&gt;
* Every processor is sending a packet to a unique destination. Therefore for &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt; the set of processors, the destinations are given by a &#039;&#039;&#039;permutation&#039;&#039;&#039; &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt;, such that for every processor &amp;lt;math&amp;gt;i\in[N]&amp;lt;/math&amp;gt;, the processor &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is sending a packet to processor &amp;lt;math&amp;gt;\pi(i)&amp;lt;/math&amp;gt;.&lt;br /&gt;
* The communication is &#039;&#039;&#039;synchronized&#039;&#039;&#039;, such that for each &#039;&#039;&#039;round&#039;&#039;&#039;, every link (an edge of the graph) can forward at most one packet.&lt;br /&gt;
&lt;br /&gt;
With a complete graph as the network. For any permutation &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt;, all packets can be routed to their destinations in parallel with one round of communication. However, such an ideal connectivity is usually not available in reality, either because they are too expensive, or because they are physically impossible. We are interested in the case the graph is &#039;&#039;&#039;sparse&#039;&#039;&#039;, such that the number of edges is significantly smaller than the complete graph, yet the distance between any pair of vertices is small, so that the packets can be efficiently routed between pairs of vertices.&lt;br /&gt;
&lt;br /&gt;
The hypercube is one of the graphs with these desirable properties.&lt;br /&gt;
&lt;br /&gt;
=== Routing in a hypercube ===&lt;br /&gt;
A [http://en.wikipedia.org/wiki/Hypercube hypercube], sometimes called a Boolean cube, a Hamming cube, or just cube, is defined over &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; nodes, for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; a power of 2. We assume that &amp;lt;math&amp;gt;N=2^d&amp;lt;/math&amp;gt;. A hypercube of &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; dimensions, or a &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;-cube, is an undirected graph with the vertex set &amp;lt;math&amp;gt;\{0,1\}^d&amp;lt;/math&amp;gt;, such that for any &amp;lt;math&amp;gt;u,v\in\{0,1\}^d&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; are adjacent if and only if &amp;lt;math&amp;gt;h(u,v)=1&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;h(u,v)&amp;lt;/math&amp;gt; is the [http://en.wikipedia.org/wiki/Hamming_distance Hamming distance] between &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;-cube is a &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;-degree regular graph over &amp;lt;math&amp;gt;N=2^d&amp;lt;/math&amp;gt; vertices. For any pair &amp;lt;math&amp;gt;(u,v)&amp;lt;/math&amp;gt; of vertices, the distance between &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is at most &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;. (How do we know this? Since it takes at most &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; bits to fix any binary string of length &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; any other.) This directly gives us the following very natural routing algorithm.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Bit-Fixing Algorithm:&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|For each packet:&lt;br /&gt;
#Let &amp;lt;math&amp;gt;u, v\in\{0,1\}^d&amp;lt;/math&amp;gt; be the origin and destination of the packet respectively.&lt;br /&gt;
#For &amp;lt;math&amp;gt;i=1&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;, do:&lt;br /&gt;
::if &amp;lt;math&amp;gt;u_i\neq v_i&amp;lt;/math&amp;gt; then traverse the edge &amp;lt;math&amp;gt;(v_1,\ldots,v_{i-1},u_i,\ldots,u_d)\rightarrow (v_1,\ldots,v_{i-1},v_i,u_{i+1}\ldots,u_d)&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This algorithm is blessed with a very good property: it depends only on the origin, the destination, and the current node. We call the algorithms with this property &#039;&#039;&#039;oblivious&#039;&#039;&#039; routing algorithms. Compared the routing algorithms which are adaptive to the path that the packet traversed, oblivious routing is more simple thus can be implemented by smaller routing table (or simple devices called &#039;&#039;&#039;switches&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
== Johnson-Lindenstrauss Theorem ==&lt;/div&gt;</summary>
		<author><name>172.21.7.100</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/More_on_Chernoff_bounds&amp;diff=1375</id>
		<title>Randomized Algorithms (Spring 2010)/More on Chernoff bounds</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/More_on_Chernoff_bounds&amp;diff=1375"/>
		<updated>2010-02-24T14:09:06Z</updated>

		<summary type="html">&lt;p&gt;172.21.7.100: /* Routing in a hypercube */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Permutation Routing ==&lt;br /&gt;
The problem raises from parallel computing. Consider that we have &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; processors, connected by a communication network. The processors communicate with each other by sending and receiving &#039;&#039;&#039;packets&#039;&#039;&#039; through the network. We consider the following packet routing problem:&lt;br /&gt;
* Every processor is sending a packet to a unique destination. Therefore for &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt; the set of processors, the destinations are given by a &#039;&#039;&#039;permutation&#039;&#039;&#039; &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt;, such that for every processor &amp;lt;math&amp;gt;i\in[N]&amp;lt;/math&amp;gt;, the processor &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is sending a packet to processor &amp;lt;math&amp;gt;\pi(i)&amp;lt;/math&amp;gt;.&lt;br /&gt;
* The communication is &#039;&#039;&#039;synchronized&#039;&#039;&#039;, such that for each &#039;&#039;&#039;round&#039;&#039;&#039;, every link (an edge of the graph) can forward at most one packet.&lt;br /&gt;
&lt;br /&gt;
With a complete graph as the network. For any permutation &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt;, all packets can be routed to their destinations in parallel with one round of communication. However, such an ideal connectivity is usually not available in reality, either because they are too expensive, or because they are physically impossible. We are interested in the case the graph is &#039;&#039;&#039;sparse&#039;&#039;&#039;, such that the number of edges is significantly smaller than the complete graph, yet the distance between any pair of vertices is small, so that the packets can be efficiently routed between pairs of vertices.&lt;br /&gt;
&lt;br /&gt;
The hypercube is one of the graphs with these desirable properties.&lt;br /&gt;
&lt;br /&gt;
=== Routing in a hypercube ===&lt;br /&gt;
A [http://en.wikipedia.org/wiki/Hypercube hypercube], sometimes called a Boolean cube, a Hamming cube, or just cube, is defined over &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; nodes, for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; a power of 2. We assume that &amp;lt;math&amp;gt;N=2^d&amp;lt;/math&amp;gt;. A hypercube of &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; dimensions, or a &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;-cube, is an undirected graph with the vertex set &amp;lt;math&amp;gt;\{0,1\}^d&amp;lt;/math&amp;gt;, such that for any &amp;lt;math&amp;gt;u,v\in\{0,1\}^d&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; are adjacent if and only if &amp;lt;math&amp;gt;h(u,v)=1&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;h(u,v)&amp;lt;/math&amp;gt; is the [http://en.wikipedia.org/wiki/Hamming_distance Hamming distance] between &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;-cube is a &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;-degree regular graph over &amp;lt;math&amp;gt;N=2^d&amp;lt;/math&amp;gt; vertices. For any pair &amp;lt;math&amp;gt;(u,v)&amp;lt;/math&amp;gt; of vertices, the distance between &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is at most &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;. (How do we know this? Since it takes at most &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; bits to fix any binary string of length &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; any other.) This directly gives us the following simple routing algorithm.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Bit-Fixing Algorithm:&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|For each packet:&lt;br /&gt;
#Let &amp;lt;math&amp;gt;u, v\in\{0,1\}^d&amp;lt;/math&amp;gt; be the origin and destination of the packet respectively.&lt;br /&gt;
#For &amp;lt;math&amp;gt;i=1&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;, do:&lt;br /&gt;
::if &amp;lt;math&amp;gt;u_i\neq v_i&amp;lt;/math&amp;gt; then traverse the edge &amp;lt;math&amp;gt;(v_1,\ldots,v_{i-1},u_i,\ldots,u_d)\rightarrow (v_1,\ldots,v_{i-1},v_i,u_{i+1}\ldots,u_d)&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Johnson-Lindenstrauss Theorem ==&lt;/div&gt;</summary>
		<author><name>172.21.7.100</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/More_on_Chernoff_bounds&amp;diff=1374</id>
		<title>Randomized Algorithms (Spring 2010)/More on Chernoff bounds</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/More_on_Chernoff_bounds&amp;diff=1374"/>
		<updated>2010-02-24T13:49:50Z</updated>

		<summary type="html">&lt;p&gt;172.21.7.100: /* Routing in a hypercube */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Permutation Routing ==&lt;br /&gt;
The problem raises from parallel computing. Consider that we have &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; processors, connected by a communication network. The processors communicate with each other by sending and receiving &#039;&#039;&#039;packets&#039;&#039;&#039; through the network. We consider the following packet routing problem:&lt;br /&gt;
* Every processor is sending a packet to a unique destination. Therefore for &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt; the set of processors, the destinations are given by a &#039;&#039;&#039;permutation&#039;&#039;&#039; &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt;, such that for every processor &amp;lt;math&amp;gt;i\in[N]&amp;lt;/math&amp;gt;, the processor &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is sending a packet to processor &amp;lt;math&amp;gt;\pi(i)&amp;lt;/math&amp;gt;.&lt;br /&gt;
* The communication is &#039;&#039;&#039;synchronized&#039;&#039;&#039;, such that for each &#039;&#039;&#039;round&#039;&#039;&#039;, every link (an edge of the graph) can forward at most one packet.&lt;br /&gt;
&lt;br /&gt;
With a complete graph as the network. For any permutation &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt;, all packets can be routed to their destinations in parallel with one round of communication. However, such an ideal connectivity is usually not available in reality, either because they are too expensive, or because they are physically impossible. We are interested in the case the graph is &#039;&#039;&#039;sparse&#039;&#039;&#039;, such that the number of edges is significantly smaller than the complete graph, yet the distance between any pair of vertices is small, so that the packets can be efficiently routed between pairs of vertices.&lt;br /&gt;
&lt;br /&gt;
The hypercube is one of the graphs with these desirable properties.&lt;br /&gt;
&lt;br /&gt;
=== Routing in a hypercube ===&lt;br /&gt;
A [http://en.wikipedia.org/wiki/Hypercube hypercube], sometimes called a Boolean cube, a Hamming cube, or just cube, is defined over &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; nodes, for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; a power of 2. We assume that &amp;lt;math&amp;gt;N=2^d&amp;lt;/math&amp;gt;. A hypercube of &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; dimensions, or a &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;-cube, is an undirected graph with the vertex set &amp;lt;math&amp;gt;\{0,1\}^d&amp;lt;/math&amp;gt;, such that for any &amp;lt;math&amp;gt;u,v\in\{0,1\}^d&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; are adjacent if and only if &amp;lt;math&amp;gt;h(u,v)=1&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;h(u,v)&amp;lt;/math&amp;gt; is the [http://en.wikipedia.org/wiki/Hamming_distance Hamming distance] between &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Johnson-Lindenstrauss Theorem ==&lt;/div&gt;</summary>
		<author><name>172.21.7.100</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/More_on_Chernoff_bounds&amp;diff=1373</id>
		<title>Randomized Algorithms (Spring 2010)/More on Chernoff bounds</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/More_on_Chernoff_bounds&amp;diff=1373"/>
		<updated>2010-02-24T13:39:22Z</updated>

		<summary type="html">&lt;p&gt;172.21.7.100: /* Permutation Routing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Permutation Routing ==&lt;br /&gt;
The problem raises from parallel computing. Consider that we have &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; processors, connected by a communication network. The processors communicate with each other by sending and receiving &#039;&#039;&#039;packets&#039;&#039;&#039; through the network. We consider the following packet routing problem:&lt;br /&gt;
* Every processor is sending a packet to a unique destination. Therefore for &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt; the set of processors, the destinations are given by a &#039;&#039;&#039;permutation&#039;&#039;&#039; &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt;, such that for every processor &amp;lt;math&amp;gt;i\in[N]&amp;lt;/math&amp;gt;, the processor &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is sending a packet to processor &amp;lt;math&amp;gt;\pi(i)&amp;lt;/math&amp;gt;.&lt;br /&gt;
* The communication is &#039;&#039;&#039;synchronized&#039;&#039;&#039;, such that for each &#039;&#039;&#039;round&#039;&#039;&#039;, every link (an edge of the graph) can forward at most one packet.&lt;br /&gt;
&lt;br /&gt;
With a complete graph as the network. For any permutation &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;[N]&amp;lt;/math&amp;gt;, all packets can be routed to their destinations in parallel with one round of communication. However, such an ideal connectivity is usually not available in reality, either because they are too expensive, or because they are physically impossible. We are interested in the case the graph is &#039;&#039;&#039;sparse&#039;&#039;&#039;, such that the number of edges is significantly smaller than the complete graph, yet the distance between any pair of vertices is small, so that the packets can be efficiently routed between pairs of vertices.&lt;br /&gt;
&lt;br /&gt;
The hypercube is one of the graphs with these desirable properties.&lt;br /&gt;
&lt;br /&gt;
=== Routing in a hypercube ===&lt;br /&gt;
&lt;br /&gt;
== Johnson-Lindenstrauss Theorem ==&lt;/div&gt;</summary>
		<author><name>172.21.7.100</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Tail_inequalities&amp;diff=1330</id>
		<title>Randomized Algorithms (Spring 2010)/Tail inequalities</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Tail_inequalities&amp;diff=1330"/>
		<updated>2010-02-24T11:25:36Z</updated>

		<summary type="html">&lt;p&gt;172.21.7.100: /* Set balancing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Select the Median ==&lt;br /&gt;
&lt;br /&gt;
The [http://en.wikipedia.org/wiki/Selection_algorithm selection problem] is the problem of finding the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;th smallest element in a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. A typical case of selection problem is finding the &#039;&#039;&#039;median&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Definition&#039;&#039;&#039;&lt;br /&gt;
:The median of a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is the &amp;lt;math&amp;gt;(\lceil n/2\rceil)&amp;lt;/math&amp;gt;th element in the sorted order of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The median can be found in &amp;lt;math&amp;gt;O(n\log n)&amp;lt;/math&amp;gt; time by sorting. There is a linear-time deterministic algorithm, [http://en.wikipedia.org/wiki/Selection_algorithm#Linear_general_selection_algorithm_-_.22Median_of_Medians_algorithm.22 &amp;quot;median of medians&amp;quot; algorithm], which is quite sophisticated. Here we introduce a much simpler randomized algorithm which also runs in linear time.&lt;br /&gt;
&lt;br /&gt;
=== Randomized median algorithm ===&lt;br /&gt;
The idea of this algorithm is random sampling. For a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;m\in S&amp;lt;/math&amp;gt; denote the median. We observe that if we can find two elements &amp;lt;math&amp;gt;d,u\in S&amp;lt;/math&amp;gt; satisfying the following properties:&lt;br /&gt;
# The median is between &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; in the sorted order, i.e. &amp;lt;math&amp;gt;d\le m\le u&amp;lt;/math&amp;gt;;&lt;br /&gt;
# The total number of elements between &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; is small, specially for &amp;lt;math&amp;gt;C=\{x\in S\mid d\le x\le u\}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;|C|=o(n/\log n)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Provided &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; with these two properties, within linear time, we can compute the ranks of &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;, construct &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;, and sort &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;. Therefore, the median &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; can be picked from &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; in linear time.&lt;br /&gt;
&lt;br /&gt;
So how can we select such elements &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;? Certainly sorting &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; would give us the elements, but isn&#039;t that exactly what we want to avoid in the first place?&lt;br /&gt;
&lt;br /&gt;
Observe that &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; are only asked to roughly satisfy some constraints. This hints us maybe we can construct a &#039;&#039;sketch&#039;&#039; of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; which is small enough to sort cheaply and roughly represents &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;, and then pick &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; from this sketch. We construct the sketch by randomly sampling a relatively small number of elements from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Then the strategy of algorithm is outlined by:&lt;br /&gt;
* Sample a set &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; of elements from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. &lt;br /&gt;
* Sort &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; and choose &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; somewhere around the median of &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt;.&lt;br /&gt;
* If &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; have the desirable properties, we can compute the median in linear time, or otherwise the algorithm fails.&lt;br /&gt;
&lt;br /&gt;
The parameters to be fixed are: the size of &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; (small enough to sort in linear time and large enough to contain sufficient information of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;); and the order of &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; (not too close to have &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; between them, and not too far away to have &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; sortable in linear time).&lt;br /&gt;
&lt;br /&gt;
We choose the size of &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;n^{3/4}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; are within &amp;lt;math&amp;gt;\sqrt{n}&amp;lt;/math&amp;gt; range around the median of &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Randomized Median Algorithm:&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Input:&#039;&#039;&#039; a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; elements over totally ordered domain.&lt;br /&gt;
# Pick a multi-set &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;\left\lceil n^{3/4}\right\rceil&amp;lt;/math&amp;gt; elements in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;, chosen independently and uniformly at random with replacement, and sort &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt;.&lt;br /&gt;
# Let &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; be the &amp;lt;math&amp;gt;\left\lfloor\frac{1}{2}n^{3/4}-\sqrt{n}\right\rfloor&amp;lt;/math&amp;gt;-th smallest element in &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; be the &amp;lt;math&amp;gt;\left\lceil\frac{1}{2}n^{3/4}+\sqrt{n}\right\rceil&amp;lt;/math&amp;gt;-th smallest element in &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt;.&lt;br /&gt;
# Construct &amp;lt;math&amp;gt;C=\{x\in S\mid d\le x\le u\}&amp;lt;/math&amp;gt; and compute the ranks &amp;lt;math&amp;gt;r_d=|\{x\in S\mid x&amp;lt;d\}|&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;r_u=|\{x\in S\mid x&amp;lt;u\}|&amp;lt;/math&amp;gt;.&lt;br /&gt;
# If &amp;lt;math&amp;gt;r_d&amp;gt;\frac{n}{2}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;r_u&amp;lt;\frac{n}{2}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;|C|&amp;gt;4n^{3/4}&amp;lt;/math&amp;gt; then return FAIL.&lt;br /&gt;
# Sort &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; and return the &amp;lt;math&amp;gt;\left(\left\lfloor\frac{n}{2}\right\rfloor-r_d+1\right)&amp;lt;/math&amp;gt;th element in the sorted order of &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Sample with replacement&amp;quot; (有放回采样) means that after sampling an element, we put the element back to the set. In this way, each sampled element is independently and identically distributed (&#039;&#039;i.i.d&#039;&#039;) (独立同分布). In the above algorithm, this is for our convenience of analysis.&lt;br /&gt;
&lt;br /&gt;
=== Analysis ===&lt;br /&gt;
The algorithm always terminates in linear time because each line of the algorithm costs at most linear time. The last three line guarantees that the algorithm returns the correct median if it does not fail.&lt;br /&gt;
&lt;br /&gt;
We then only need to bound the probability that the algorithm returns a FAIL. Let &amp;lt;math&amp;gt;m\in S&amp;lt;/math&amp;gt; be the median of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. By Line 4, we know that the algorithm returns a FAIL if and only if at least one of the following events occurs:&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathcal{E}_1: Y=|\{x\in R\mid x\le m\}|&amp;lt;\frac{1}{2}n^{3/4}-\sqrt{n}&amp;lt;/math&amp;gt;;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathcal{E}_2: Z=|\{x\in R\mid x\ge m\}|&amp;lt;\frac{1}{2}n^{3/4}-\sqrt{n}&amp;lt;/math&amp;gt;;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathcal{E}_3: |C|&amp;gt;4n^{3/4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathcal{E}_3&amp;lt;/math&amp;gt; directly follows the third condition in Line 4. &amp;lt;math&amp;gt;\mathcal{E}_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathcal{E}_2&amp;lt;/math&amp;gt; are a bit tricky. The first condition in Line 4 is that &amp;lt;math&amp;gt;r_d&amp;gt;\frac{n}{2}&amp;lt;/math&amp;gt;, which looks not exactly the same as &amp;lt;math&amp;gt;\mathcal{E}_1&amp;lt;/math&amp;gt;, but both &amp;lt;math&amp;gt;\mathcal{E}_1&amp;lt;/math&amp;gt; and that &amp;lt;math&amp;gt;r_d&amp;gt;\frac{n}{2}&amp;lt;/math&amp;gt; are equivalent to the same event: the &amp;lt;math&amp;gt;\left\lfloor\frac{1}{2}n^{3/4}-\sqrt{n}\right\rfloor&amp;lt;/math&amp;gt;-th smallest element in &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; is greater than &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt;, thus they are actually equivalent. Similarly, &amp;lt;math&amp;gt;\mathcal{E}_2&amp;lt;/math&amp;gt; is equivalent to the second condition of Line 4.&lt;br /&gt;
&lt;br /&gt;
We now bound the probabilities of these events one by one.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Lemma 1&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;\Pr[\mathcal{E}_1]\le \frac{1}{4}n^{-1/4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Proof:&#039;&#039;&#039; Let &amp;lt;math&amp;gt;X_i&amp;lt;/math&amp;gt; be the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;th sampled element in Line 1 of the algorithm. Let &amp;lt;math&amp;gt;Y_i&amp;lt;/math&amp;gt; be a indicator random variable such that &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
Y_i=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
1 &amp;amp; \mbox{if }X_i\le m,\\&lt;br /&gt;
0 &amp;amp; \mbox{otherwise.}&lt;br /&gt;
\end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
It is obvious that &amp;lt;math&amp;gt;Y=\sum_{i=1}^{n^{3/4}}Y_i&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; is as defined in &amp;lt;math&amp;gt;\mathcal{E}_1&amp;lt;/math&amp;gt;. For every &amp;lt;math&amp;gt;X_i&amp;lt;/math&amp;gt;, there are &amp;lt;math&amp;gt;\left\lceil\frac{n}{2}\right\rceil&amp;lt;/math&amp;gt; elements in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; that are less than or equal to the median. The probability that &amp;lt;math&amp;gt;Y_i=1&amp;lt;/math&amp;gt; is&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
p=\Pr[Y_i=1]=\Pr[X_i\le m]=\frac{1}{n}\left\lceil\frac{n}{2}\right\rceil,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
which is within the range of &amp;lt;math&amp;gt;\left[\frac{1}{2},\frac{1}{2}+\frac{1}{2n}\right]&amp;lt;/math&amp;gt;. Thus&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[Y]=n^{3/4}p\ge \frac{1}{2}n^{3/4}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The event &amp;lt;math&amp;gt;\mathcal{E}_1&amp;lt;/math&amp;gt; is defined as that &amp;lt;math&amp;gt;Y&amp;lt;\frac{1}{2}n^{3/4}-\sqrt{n}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that &amp;lt;math&amp;gt;Y_i&amp;lt;/math&amp;gt;&#039;s are Bernoulli trials, and &amp;lt;math&amp;gt;Y&amp;lt;/math&amp;gt; is the sum of &amp;lt;math&amp;gt;n^{3/4}&amp;lt;/math&amp;gt; Bernoulli trials, which follows binomial distribution with parameters &amp;lt;math&amp;gt;n^{3/4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;. Thus, the variance is &lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{Var}[Y]=n^{3/4}p(1-p)\le \frac{1}{4}n^{3/4}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applying Chebyshev&#039;s inequality,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Pr[\mathcal{E}_1]&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\Pr\left[Y&amp;lt;\frac{1}{2}n^{3/4}-\sqrt{n}\right]\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\Pr\left[|Y-\mathbf{E}[Y]|&amp;gt;\sqrt{n}\right]\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\frac{\mathbf{Var}[Y]}{n}\\&lt;br /&gt;
&amp;amp;\le\frac{1}{4}n^{-1/4}.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\square&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By a similar analysis, we can obtain the following bound for the event &amp;lt;math&amp;gt;\mathcal{E}_2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Lemma 2&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;\Pr[\mathcal{E}_2]\le \frac{1}{4}n^{-1/4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
We now bound the probability of the event &amp;lt;math&amp;gt;\mathcal{E}_3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Lemma 3&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;\Pr[\mathcal{E}_3]\le \frac{1}{2}n^{-1/4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Proof:&#039;&#039;&#039; The event &amp;lt;math&amp;gt;\mathcal{E}_3&amp;lt;/math&amp;gt; is defined as that &amp;lt;math&amp;gt;|C|&amp;gt;4 n^{3/4}&amp;lt;/math&amp;gt;, which by the Pigeonhole Principle, implies that at leas one of the following must be true:&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathcal{E}_3&#039;&amp;lt;/math&amp;gt;: at least &amp;lt;math&amp;gt;2n^{3/4}&amp;lt;/math&amp;gt; elements of &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; is greater than &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt;;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathcal{E}_3&#039;&#039;&amp;lt;/math&amp;gt;: at least &amp;lt;math&amp;gt;2n^{3/4}&amp;lt;/math&amp;gt; elements of &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; is smaller than &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We bound the probability that &amp;lt;math&amp;gt;\mathcal{E}_3&#039;&amp;lt;/math&amp;gt; occurs; the second will have the same bound by symmetry.&lt;br /&gt;
&lt;br /&gt;
Recall that &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; is the region in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt;. If there are at least &amp;lt;math&amp;gt;2n^{3/4}&amp;lt;/math&amp;gt; elements of &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; greater than the median &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;, then the rank of &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; in the sorted order of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; must be at least &amp;lt;math&amp;gt;\frac{1}{2}n+2n^{3/4}&amp;lt;/math&amp;gt; and thus &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; has at least &amp;lt;math&amp;gt;\frac{1}{2}n^{3/4}-\sqrt{n}&amp;lt;/math&amp;gt; samples among the &amp;lt;math&amp;gt;\frac{1}{2}n-2n^{3/4}&amp;lt;/math&amp;gt; largest elements in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;X_i\in\{0,1\}&amp;lt;/math&amp;gt; indicate whether the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;th sample is among the &amp;lt;math&amp;gt;\frac{1}{2}n-2n^{3/4}&amp;lt;/math&amp;gt; largest elements in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;X=\sum_{i=1}^{n^{3/4}}X_i&amp;lt;/math&amp;gt; be the number of samples in &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; among the &amp;lt;math&amp;gt;\frac{1}{2}n-2n^{3/4}&amp;lt;/math&amp;gt; largest elements in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
It holds that&lt;br /&gt;
:&amp;lt;math&amp;gt;p=\Pr[X_i=1]=\frac{\frac{1}{2}n-2n^{3/4}}{n}=\frac{1}{2}-2n^{-1/4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is a binomial random variable with &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{E}[X]=n^{3/4}p=\frac{1}{2}n^{3/4}-2\sqrt{n},&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
and &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{Var}[X]=n^{3/4}p(1-p)=\frac{1}{4}n^{3/4}-4n^{1/4}&amp;lt;\frac{1}{4}n^{3/4}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Applying Chebyshev&#039;s inequality,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Pr[\mathcal{E}_3&#039;]&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\Pr\left[X\ge\frac{1}{2}n^{3/4}-\sqrt{n}\right]\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\Pr\left[|X-\mathbf{E}[X]|\ge\sqrt{n}\right]\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\frac{\mathbf{Var}[X]}{n}\\&lt;br /&gt;
&amp;amp;\le\frac{1}{4}n^{-1/4}.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Symmetrically, we have that &amp;lt;math&amp;gt;\Pr[\mathcal{E}_3&#039;&#039;]\le\frac{1}{4}n^{-1/4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Applying the union bound&lt;br /&gt;
:&amp;lt;math&amp;gt;\Pr[\mathcal{E}_3]\le \Pr[\mathcal{E}_3&#039;]+\Pr[\mathcal{E}_3&#039;&#039;]\le\frac{1}{2}n^{-1/4}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\square&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combining the three bounds. Applying the union bound to them, the probability that the algorithm returns a FAIL is at most &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[\mathcal{E}_1]+\Pr[\mathcal{E}_2]+\Pr[\mathcal{E}_3]\le n^{-1/4}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the algorithm always terminates in linear time and returns the correct median with high probability.&lt;br /&gt;
&lt;br /&gt;
== Chernoff Bound ==&lt;br /&gt;
Suppose that we have a fair coin. If we toss it once, then the outcome is completely unpredictable. But if we toss it, say for 1000 times, then the number of HEADs is very likely to be around 500. This striking phenomenon, illustrated in the right figure, is called the &#039;&#039;&#039;concentration&#039;&#039;&#039;. The Chernoff bound captures the concentration of independent trials.&lt;br /&gt;
&lt;br /&gt;
[[File:Coinflip.png|border|450px|right]]&lt;br /&gt;
&lt;br /&gt;
The Chernoff bound is also a tail bound for the sum of independent random variables which may give us &#039;&#039;exponentially&#039;&#039; sharp bounds.&lt;br /&gt;
&lt;br /&gt;
Before proving the Chernoff bound, we should talk about the moment generating functions.&lt;br /&gt;
&lt;br /&gt;
=== Moment generating functions ===&lt;br /&gt;
The more we know about the moments of a random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt;, the more information we would have about &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt;. There is a so-called &#039;&#039;&#039;moment generating function&#039;&#039;&#039;, which &amp;quot;packs&amp;quot; all the information about the moments of &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; into one function.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Definition:&#039;&#039;&#039;&lt;br /&gt;
:The moment generating function of a random variable &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; is defined as &amp;lt;math&amp;gt;\mathbf{E}\left[\mathrm{e}^{\lambda X}\right]&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;\lambda&amp;lt;/math&amp;gt; is the parameter of the function.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
By Taylor&#039;s expansion and the linearity of expectations,&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
\mathbf{E}\left[\mathrm{e}^{\lambda X}\right]&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\mathbf{E}\left[\sum_{k=0}^\infty\frac{\lambda^k}{k!}X^k\right]\\&lt;br /&gt;
&amp;amp;=\sum_{k=0}^\infty\frac{\lambda^k}{k!}\mathbf{E}\left[X^k\right]&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The moment generating function &amp;lt;math&amp;gt;\mathbf{E}\left[\mathrm{e}^{\lambda X}\right]&amp;lt;/math&amp;gt; is a function of &amp;lt;math&amp;gt;\lambda&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== The Chernoff bound ===&lt;br /&gt;
The Chernoff bounds are tail inequalities with exponential decays for the sum of independent trials.&lt;br /&gt;
The bounds are obtained by applying Markov&#039;s inequality to the moment generating function of the sum of independent trials, with some  appropriate choice of the parameter &amp;lt;math&amp;gt;\lambda&amp;lt;/math&amp;gt;.&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Chernoff bound (the upper tail):&#039;&#039;&#039;&lt;br /&gt;
:Let  &amp;lt;math&amp;gt;X=\sum_{i=1}^n X_i&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;X_1, X_2, \ldots, X_n&amp;lt;/math&amp;gt; are independent Poisson trials. Let &amp;lt;math&amp;gt;\mu=\mathbf{E}[X]&amp;lt;/math&amp;gt;. &lt;br /&gt;
:Then for any &amp;lt;math&amp;gt;\delta&amp;gt;0&amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[X\ge (1+\delta)\mu]\le\left(\frac{e^{\delta}}{(1+\delta)^{(1+\delta)}}\right)^{\mu}.&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Proof:&#039;&#039;&#039; For any &amp;lt;math&amp;gt;\lambda&amp;gt;0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;X\ge (1+\delta)\mu&amp;lt;/math&amp;gt; is equivalent to that &amp;lt;math&amp;gt;e^{\lambda X}\ge e^{\lambda (1+\delta)\mu}&amp;lt;/math&amp;gt;, thus&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
\Pr[X\ge (1+\delta)\mu] &lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\Pr\left[e^{\lambda X}\ge e^{\lambda (1+\delta)\mu}\right]\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\frac{\mathbf{E}\left[e^{\lambda X}\right]}{e^{\lambda (1+\delta)\mu}},&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt; &lt;br /&gt;
where the last step follows by Markov&#039;s inequality.&lt;br /&gt;
&lt;br /&gt;
Computing the moment generating function &amp;lt;math&amp;gt;\mathbf{E}[e^{\lambda X}]&amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
\mathbf{E}\left[e^{\lambda X}\right]&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\mathbf{E}\left[e^{\lambda \sum_{i=1}^n X_i}\right]\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\mathbf{E}\left[\prod_{i=1}^n e^{\lambda X_i}\right]\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\prod_{i=1}^n \mathbf{E}\left[e^{\lambda X_i}\right].&lt;br /&gt;
&amp;amp; (\mbox{for independent random variables})&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;p_i=\Pr[X_i=1]&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;i=1,2,\ldots,n&amp;lt;/math&amp;gt;. Then,&lt;br /&gt;
:&amp;lt;math&amp;gt;\mu=\mathbf{E}[X]=\mathbf{E}\left[\sum_{i=1}^n X_i\right]=\sum_{i=1}^n\mathbf{E}[X_i]=\sum_{i=1}^n p_i&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We bound the moment generating function for each individual &amp;lt;math&amp;gt;X_i&amp;lt;/math&amp;gt; as follows.&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
\mathbf{E}\left[e^{\lambda X_i}\right]&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
p_i\cdot e^{\lambda\cdot 1}+(1-p_i)\cdot e^{\lambda\cdot 0}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
1+p_i(e^\lambda -1)\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
e^{p_i(e^\lambda-1)},&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
where in the last step we apply the Taylor&#039;s expansion so that &amp;lt;math&amp;gt;e^y\ge 1+y&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;y=p_i(e^\lambda-1)\ge 0&amp;lt;/math&amp;gt;. (By doing this, we can transform the product to the sum of &amp;lt;math&amp;gt;p_i&amp;lt;/math&amp;gt;, which is &amp;lt;math&amp;gt;\mu&amp;lt;/math&amp;gt;.) &lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
\mathbf{E}\left[e^{\lambda X}\right]&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\prod_{i=1}^n \mathbf{E}\left[e^{\lambda X_i}\right]\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\prod_{i=1}^n e^{p_i(e^\lambda-1)}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\exp\left(\sum_{i=1}^n p_i(e^{\lambda}-1)\right)\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
e^{(e^\lambda-1)\mu}.&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
Thus, we have shown that for any &amp;lt;math&amp;gt;\lambda&amp;gt;0&amp;lt;/math&amp;gt;,&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
\Pr[X\ge (1+\delta)\mu] &lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\frac{\mathbf{E}\left[e^{\lambda X}\right]}{e^{\lambda (1+\delta)\mu}}\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\frac{e^{(e^\lambda-1)\mu}}{e^{\lambda (1+\delta)\mu}}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\left(\frac{e^{(e^\lambda-1)}}{e^{\lambda (1+\delta)}}\right)^\mu&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;.&lt;br /&gt;
For any &amp;lt;math&amp;gt;\delta&amp;gt;0&amp;lt;/math&amp;gt;, we can let &amp;lt;math&amp;gt;\lambda=\ln(1+\delta)&amp;gt;0&amp;lt;/math&amp;gt; to get&lt;br /&gt;
:&amp;lt;math&amp;gt;\Pr[X\ge (1+\delta)\mu]\le\left(\frac{e^{\delta}}{(1+\delta)^{(1+\delta)}}\right)^{\mu}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\square&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The idea of the proof is actually quite clear: we apply Markov&#039;s inequality to &amp;lt;math&amp;gt;e^{\lambda X}&amp;lt;/math&amp;gt; and for the rest, we just estimate the moment generating function &amp;lt;math&amp;gt;\mathbf{E}[e^{\lambda X}]&amp;lt;/math&amp;gt;. To make the bound as tight as possible, we minimized the &amp;lt;math&amp;gt;\frac{e^{(e^\lambda-1)}}{e^{\lambda (1+\delta)}}&amp;lt;/math&amp;gt; by setting &amp;lt;math&amp;gt;\lambda=\ln(1+\delta)&amp;lt;/math&amp;gt;, which can be justified by taking derivatives of &amp;lt;math&amp;gt;\frac{e^{(e^\lambda-1)}}{e^{\lambda (1+\delta)}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
We then proceed to the lower tail, the probability that the random variable deviates below the mean value:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Chernoff bound (the lower tail):&#039;&#039;&#039;&lt;br /&gt;
:Let  &amp;lt;math&amp;gt;X=\sum_{i=1}^n X_i&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;X_1, X_2, \ldots, X_n&amp;lt;/math&amp;gt; are independent Poisson trials. Let &amp;lt;math&amp;gt;\mu=\mathbf{E}[X]&amp;lt;/math&amp;gt;. &lt;br /&gt;
:Then for any &amp;lt;math&amp;gt;0&amp;lt;\delta&amp;lt;1&amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[X\le (1-\delta)\mu]\le\left(\frac{e^{-\delta}}{(1-\delta)^{(1-\delta)}}\right)^{\mu}.&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Proof:&#039;&#039;&#039; For any &amp;lt;math&amp;gt;\lambda&amp;lt;0&amp;lt;/math&amp;gt;, by the same analysis as in the upper tail version,&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
\Pr[X\le (1-\delta)\mu] &lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\Pr\left[e^{\lambda X}\ge e^{\lambda (1-\delta)\mu}\right]\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\frac{\mathbf{E}\left[e^{\lambda X}\right]}{e^{\lambda (1-\delta)\mu}}\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\left(\frac{e^{(e^\lambda-1)}}{e^{\lambda (1-\delta)}}\right)^\mu.&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt; &lt;br /&gt;
For any &amp;lt;math&amp;gt;0&amp;lt;\delta&amp;lt;1&amp;lt;/math&amp;gt;, we can let &amp;lt;math&amp;gt;\lambda=\ln(1-\delta)&amp;lt;0&amp;lt;/math&amp;gt; to get&lt;br /&gt;
:&amp;lt;math&amp;gt;\Pr[X\ge (1-\delta)\mu]\le\left(\frac{e^{-\delta}}{(1-\delta)^{(1-\delta)}}\right)^{\mu}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\square&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Some useful special forms of the bounds can be derived directly from the above general forms of the bounds. We now know better why we say that the bounds are exponentially sharp.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Useful forms of the Chernoff bound&#039;&#039;&#039;&lt;br /&gt;
:Let  &amp;lt;math&amp;gt;X=\sum_{i=1}^n X_i&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;X_1, X_2, \ldots, X_n&amp;lt;/math&amp;gt; are independent Poisson trials. Let &amp;lt;math&amp;gt;\mu=\mathbf{E}[X]&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
:1. for &amp;lt;math&amp;gt;0&amp;lt;\delta\le 1&amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[X\ge (1+\delta)\mu]&amp;lt;\exp\left(-\frac{\mu\delta^2}{3}\right);&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[X\le (1-\delta)\mu]&amp;lt;\exp\left(-\frac{\mu\delta^2}{2}\right);&amp;lt;/math&amp;gt;&lt;br /&gt;
:2. for &amp;lt;math&amp;gt;t\ge 2e\mu&amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[X\ge t]\le 2^{-t}.&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Proof:&#039;&#039;&#039; To obtain the bounds in (1), we need to show that for &amp;lt;math&amp;gt;0&amp;lt;\delta&amp;lt; 1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\frac{e^{\delta}}{(1+\delta)^{(1+\delta)}}\le e^{-\delta^2/3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{e^{-\delta}}{(1-\delta)^{(1-\delta)}}\le e^{-\delta^2/2}&amp;lt;/math&amp;gt;. We can verify both inequalities by standard analysis techniques.&lt;br /&gt;
&lt;br /&gt;
To obtain the bound in (2), let &amp;lt;math&amp;gt;t=(1+\delta)\mu&amp;lt;/math&amp;gt;. Then &amp;lt;math&amp;gt;\delta=t/\mu-1\ge 2e-1&amp;lt;/math&amp;gt;. Hence,&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
\Pr[X\ge(1+\delta)\mu]&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\left(\frac{e^\delta}{(1+\delta)^{(1+\delta)}}\right)^\mu\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\left(\frac{e}{1+\delta}\right)^{(1+\delta)\mu}\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\left(\frac{e}{2e}\right)^{2e\mu}\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
2^{-t}&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\square&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Applications of Chernoff Bounds ==&lt;br /&gt;
We now introduce some applications of Chernoff bounds in randomized algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Balls into bins ===&lt;br /&gt;
Throwing &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; balls uniformly and independently to &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; bins, what is the maximum load of all bins? In the last class, by using a counting argument, we proved that for the case that &amp;lt;math&amp;gt;m=n&amp;lt;/math&amp;gt;, the maximum load is &amp;lt;math&amp;gt;O(\ln n\ln\ln n)&amp;lt;/math&amp;gt; with high probability. Now we show that when there are more balls, the loads are more balanced.&lt;br /&gt;
&lt;br /&gt;
For any &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;j\in[m]&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;X_{ij}&amp;lt;/math&amp;gt; be the indicator variable for the event that ball &amp;lt;math&amp;gt;j&amp;lt;/math&amp;gt; is thrown to bin &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. Obviously&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{E}[X_{ij}]=\Pr[\mbox{ball }j\mbox{ is thrown to bin }i]=\frac{1}{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
Let &amp;lt;math&amp;gt;Y_i=\sum_{j\in[m]}X_{ij}&amp;lt;/math&amp;gt; be the load of bin &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let us consider the case when &amp;lt;math&amp;gt;m=6n\ln n&amp;lt;/math&amp;gt;. Then the expected load of bin &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is&lt;br /&gt;
:&amp;lt;math&amp;gt;\mu=\mathbf{E}[Y_i]=\mathbf{E}\left[\sum_{j\in[m]}X_{ij}\right]=\sum_{j\in[m]}\mathbf{E}[X_{ij}]=m/n=6\ln n&amp;lt;/math&amp;gt;. &lt;br /&gt;
Note that &amp;lt;math&amp;gt;Y_i&amp;lt;/math&amp;gt; is a sum of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; mutually independent indicator variable. Applying Chernoff bound, for any particular bin &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;,&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\Pr[Y_i&amp;gt;12\ln n] =\Pr[Y_i&amp;gt;(1+1)\mu]\le e^{-\frac{\mu}{3}} = e^{-2\ln n}= \frac{1}{n^2}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Applying the union bound, the probability that there exists a bin with load &amp;lt;math&amp;gt;&amp;gt;12\ln n&amp;lt;/math&amp;gt; is&lt;br /&gt;
:&amp;lt;math&amp;gt;n\cdot \Pr[Y_1&amp;gt;12\ln n]\le \frac{1}{n}&amp;lt;/math&amp;gt;.&lt;br /&gt;
Therefore, with probability at least &amp;lt;math&amp;gt;1-\frac{1}{n}&amp;lt;/math&amp;gt;, the maximum load is within &amp;lt;math&amp;gt;12\ln n=O(m/n)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set balancing ===&lt;br /&gt;
Supposed that we have an &amp;lt;math&amp;gt;n\times m&amp;lt;/math&amp;gt; matrix &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; with 0-1 entries. We are looking for a &amp;lt;math&amp;gt;b\in\{-1,+1\}^m&amp;lt;/math&amp;gt; that minimizes &amp;lt;math&amp;gt;\|Ab\|_\infty&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Recall that &amp;lt;math&amp;gt;\|\cdot\|_\infty&amp;lt;/math&amp;gt; is the infinity norm (also called &amp;lt;math&amp;gt;L_\infty&amp;lt;/math&amp;gt; norm) of a vector, and for the vector &amp;lt;math&amp;gt;c=Ab&amp;lt;/math&amp;gt;, &lt;br /&gt;
:&amp;lt;math&amp;gt;\|Ab\|_\infty=\max_{i=1,2,\ldots,n}|c_i|&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can also describe this problem as an optimization:&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
\mbox{minimize }&lt;br /&gt;
&amp;amp;\quad&lt;br /&gt;
\|Ab\|_\infty\\&lt;br /&gt;
\mbox{subject to: }&lt;br /&gt;
&amp;amp;\quad&lt;br /&gt;
b\in\{-1,+1\}^m.&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This problem is called set balancing for a reason.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|The problem arises in designing statistical experiments. Suppose that we have &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; &#039;&#039;&#039;subjects&#039;&#039;&#039;, each of which may have up to &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; &#039;&#039;&#039;features&#039;&#039;&#039;. This gives us an &amp;lt;math&amp;gt;n\times m&amp;lt;/math&amp;gt; matrix &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{c}&lt;br /&gt;
\mbox{feature 1:}\\&lt;br /&gt;
\mbox{feature 2:}\\&lt;br /&gt;
\vdots\\&lt;br /&gt;
\mbox{feature n:}\\&lt;br /&gt;
\end{array}&lt;br /&gt;
\left[&lt;br /&gt;
\begin{array}{cccc}&lt;br /&gt;
a_{11} &amp;amp; a_{12} &amp;amp; \cdots &amp;amp; a_{1m}\\&lt;br /&gt;
a_{21} &amp;amp; a_{22} &amp;amp; \cdots &amp;amp; a_{2m}\\&lt;br /&gt;
\vdots &amp;amp; \vdots &amp;amp; \ddots &amp;amp; \vdots\\&lt;br /&gt;
a_{n1} &amp;amp; a_{n2} &amp;amp; \cdots &amp;amp; a_{nm}\\&lt;br /&gt;
\end{array}&lt;br /&gt;
\right],&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
where each column represents a subject and each row represent a feature. An entry &amp;lt;math&amp;gt;a_{ij}\in\{0,1\}&amp;lt;/math&amp;gt; indicates whether subject &amp;lt;math&amp;gt;j&amp;lt;/math&amp;gt; has feature &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By multiplying a vector &amp;lt;math&amp;gt;b\in\{-1,+1\}^m&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\left[&lt;br /&gt;
\begin{array}{cccc}&lt;br /&gt;
a_{11} &amp;amp; a_{12} &amp;amp; \cdots &amp;amp; a_{1m}\\&lt;br /&gt;
a_{21} &amp;amp; a_{22} &amp;amp; \cdots &amp;amp; a_{2m}\\&lt;br /&gt;
\vdots &amp;amp; \vdots &amp;amp; \ddots &amp;amp; \vdots\\&lt;br /&gt;
a_{n1} &amp;amp; a_{n2} &amp;amp; \cdots &amp;amp; a_{nm}\\&lt;br /&gt;
\end{array}&lt;br /&gt;
\right]&lt;br /&gt;
\left[&lt;br /&gt;
\begin{array}{c}&lt;br /&gt;
b_{1}\\&lt;br /&gt;
b_{2}\\&lt;br /&gt;
\vdots\\&lt;br /&gt;
b_{m}\\&lt;br /&gt;
\end{array}&lt;br /&gt;
\right]&lt;br /&gt;
=&lt;br /&gt;
\left[&lt;br /&gt;
\begin{array}{c}&lt;br /&gt;
c_{1}\\&lt;br /&gt;
c_{2}\\&lt;br /&gt;
\vdots\\&lt;br /&gt;
c_{n}\\&lt;br /&gt;
\end{array}&lt;br /&gt;
\right],&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
the subjects are partitioned into two disjoint groups: one for -1 and other other for +1. Each &amp;lt;math&amp;gt;c_i&amp;lt;/math&amp;gt; gives the difference between the numbers of subjects with feature &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; in the two groups. By minimizing &amp;lt;math&amp;gt;\|Ab\|_\infty=\|c\|_\infty&amp;lt;/math&amp;gt;, we ask for an optimal partition so that each feature is roughly as balanced as possible between the two groups.&lt;br /&gt;
&lt;br /&gt;
In a scientific experiment, one of the group serves as a [http://en.wikipedia.org/wiki/Scientific_control control group] (对照组). Ideally, we want the two groups are statistically identical, which is usually impossible to achieve in practice. The requirement of minimizing &amp;lt;math&amp;gt;\|Ab\|_\infty&amp;lt;/math&amp;gt; actually means the statistical difference between the two groups are minimized.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We propose an extremely simple &amp;quot;randomized algorithm&amp;quot; for computing a &amp;lt;math&amp;gt;b\in\{-1,+1\}^m&amp;lt;/math&amp;gt;: for each &amp;lt;math&amp;gt;i=1,2,\ldots, m&amp;lt;/math&amp;gt;, let &amp;lt;math&amp;gt;b_i&amp;lt;/math&amp;gt; be independently chosen from &amp;lt;math&amp;gt;\{-1,+1\}&amp;lt;/math&amp;gt;, such that &lt;br /&gt;
:&amp;lt;math&amp;gt;b_i=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
-1 &amp;amp; \mbox{with probability }\frac{1}{2}\\&lt;br /&gt;
+1 &amp;amp;\mbox{with probability }\frac{1}{2}&lt;br /&gt;
\end{cases}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure can hardly be called as an &amp;quot;algorithm&amp;quot;, because its decision is made disregard of the input &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;. We then show that despite of this obliviousness, the algorithm chooses a good enough &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;, such that for any &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\|Ab\|_\infty=O(\sqrt{m\ln n})&amp;lt;/math&amp;gt; with high probability.&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Theorem&#039;&#039;&#039;&lt;br /&gt;
:Let &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; be an &amp;lt;math&amp;gt;n\times m&amp;lt;/math&amp;gt; matrix with 0-1 entries. For a random vector &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; entries chosen independently and with equal probability from &amp;lt;math&amp;gt;\{-1,+1\}&amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[\|Ab\|_\infty&amp;gt;2\sqrt{2m\ln n}]\le\frac{2}{n}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Proof:&#039;&#039;&#039;&lt;br /&gt;
Consider particularly the &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-th row of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;. The entry of &amp;lt;math&amp;gt;Ab&amp;lt;/math&amp;gt; contributed by row &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;c_i=\sum_{j=1}^m a_{ij}b_j&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; be the non-zero entries in the row. If &amp;lt;math&amp;gt;k\le2\sqrt{2m\ln n}&amp;lt;/math&amp;gt;, then clearly &amp;lt;math&amp;gt;|c_i|&amp;lt;/math&amp;gt; is no greater than &amp;lt;math&amp;gt;2\sqrt{2m\ln n}&amp;lt;/math&amp;gt;. On the other hand if &amp;lt;math&amp;gt;k&amp;gt;2\sqrt{2m\ln n}&amp;lt;/math&amp;gt; then the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; nonzero terms in the sum&lt;br /&gt;
:&amp;lt;math&amp;gt;c_i=\sum_{j=1}^m a_{ij}b_j&amp;lt;/math&amp;gt;&lt;br /&gt;
are independent, each with probability 1/2 of being either +1 or -1. &lt;br /&gt;
&lt;br /&gt;
Thus, for these &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; nonzero terms, each &amp;lt;math&amp;gt;b_i&amp;lt;/math&amp;gt; is either positive or negative independently with equal probability. There are expectedly &amp;lt;math&amp;gt;\mu=\frac{k}{2}&amp;lt;/math&amp;gt; positive &amp;lt;math&amp;gt;b_i&amp;lt;/math&amp;gt;&#039;s among these &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; terms, and &amp;lt;math&amp;gt;c_i&amp;lt;-2\sqrt{2m\ln n}&amp;lt;/math&amp;gt; only occurs when there are less than &amp;lt;math&amp;gt;\frac{k}{2}-\sqrt{2m\ln n}=\left(1-\delta\right)\mu&amp;lt;/math&amp;gt; positive &amp;lt;math&amp;gt;b_i&amp;lt;/math&amp;gt;&#039;s, where &amp;lt;math&amp;gt;\delta=\frac{2\sqrt{2m\ln n}}{k}&amp;lt;/math&amp;gt;. Applying Chernoff bound, this event occurs with probability at most&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
\exp\left(-\frac{\mu\delta^2}{2}\right)&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\exp\left(-\frac{k}{2}\cdot\frac{8m\ln n}{2k^2}\right)\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\exp\left(-\frac{2m\ln n}{k}\right)\\&lt;br /&gt;
&amp;amp;\le&lt;br /&gt;
\exp\left(-\frac{2m\ln n}{m}\right)\\&lt;br /&gt;
&amp;amp;\le n^{-2}.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same argument can be applied to negative &amp;lt;math&amp;gt;b_i&amp;lt;/math&amp;gt;&#039;s, so that the probability that &amp;lt;math&amp;gt;c_i&amp;gt;2\sqrt{2m\ln n}&amp;lt;/math&amp;gt; is at most &amp;lt;math&amp;gt;n^{-2}&amp;lt;/math&amp;gt;. Therefore, by the union bound, &lt;br /&gt;
:&amp;lt;math&amp;gt;\Pr[|c_i|&amp;gt; 2\sqrt{2m\ln n}]\le\frac{2}{n^2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
Apply the union bound to all &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; rows.&lt;br /&gt;
:&amp;lt;math&amp;gt;\Pr[\|Ab\|_\infty&amp;gt;2\sqrt{2m\ln n}]\le n\cdot\Pr[|c_i|&amp;gt; 2\sqrt{2m\ln n}]\le\frac{2}{n}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;math&amp;gt;\square&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So how good is this randomized algorithm? In fact when &amp;lt;math&amp;gt;m=n&amp;lt;/math&amp;gt; there exists a matrix &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;\|Ab\|_\infty=\Omega(\sqrt{n})&amp;lt;/math&amp;gt; for any choice of &amp;lt;math&amp;gt;b\in\{-1,+1\}^n&amp;lt;/math&amp;gt;.&lt;/div&gt;</summary>
		<author><name>172.21.7.100</name></author>
	</entry>
</feed>