# 高级算法 (Fall 2018)/Problem Set 2

## Problem 1

Starting with a graph with ${\displaystyle n}$ vertices and no edge, we consider the following process to build a random undirected simple graph. At each step, we choose an edge uniformly at random from the set of all remaining unchosen edges, and add it to the graph. I.e., in the first step, we choose an edge from the set of ${\displaystyle n \choose 2}$ edges; in the second step, we choose from the remaining ${\displaystyle {n \choose 2}-1}$ edges; and so on. Let ${\displaystyle X}$ denote number of edges added until the graph is connected, give an upper bound for ${\displaystyle \mathbb {E} [X]}$.

## Problem 2

In Balls-and-Bins model, we throw ${\displaystyle m}$ balls independently and uniformly at random into ${\displaystyle n}$ bins. We know that the maximum load is ${\displaystyle \Theta \left({\frac {\log n}{\log \log n}}\right)}$ with high probability when ${\displaystyle m=\Theta (n)}$. The two-choice paradigm is another way to throw ${\displaystyle m}$ balls into ${\displaystyle n}$ bins: each ball is thrown into the least loaded of two bins chosen independently and uniformly at random(it could be the case that the two chosen bins are exactly the same, and then the ball will be thrown into that bin), and breaks the tie arbitrarily. When ${\displaystyle m=\Theta (n)}$, the maximum load of two-choice paradigm is known to be ${\displaystyle \Theta (\log \log n)}$ with high probability, which is exponentially less than the maxim load when there is only one random choice. This phenomenon is called the power of two choices.

Here are the questions:

• Consider the following paradigm: we throw ${\displaystyle n}$ balls into ${\displaystyle n}$ bins. The first ${\displaystyle {\frac {n}{2}}}$ balls are thrown into bins independently and uniformly at random. The remaining ${\displaystyle {\frac {n}{2}}}$ balls are thrown into bins using the two-choice paradigm. What is the maximum load with high probability? You need to give an asymptotically tight bound (in the form of ${\displaystyle \Theta (\cdot )}$).
• Replace the above paradigm to the following: the first ${\displaystyle {\frac {n}{2}}}$ balls are thrown into bins using the two-choice paradigm while the remaining ${\displaystyle {\frac {n}{2}}}$ balls are thrown into bins independently and uniformly at random. What is the maximum load with high probability in this case? You need to give an asymptotically tight bound.
• Replace the above paradigm to the following: assume all ${\displaystyle n}$ balls are thrown in a sequence. For every ${\displaystyle 1\leq i\leq n}$, if ${\displaystyle i}$ is odd, we throw ${\displaystyle i}$-th ball into bins independently and uniformly at random, otherwise, we throw it into bins using the two-choice paradigm. What is the maximum load with high probability in this case? You need to give an asymptotically tight bound.

## Problem 3

Let ${\displaystyle X}$ be a real-valued random variable with finite ${\displaystyle \mathbb {E} [X]}$ and finite ${\displaystyle \mathbb {E} \left[\mathrm {e} ^{\lambda X}\right]}$ for all ${\displaystyle \lambda \geq 0}$. We define the log-moment-generating function as

${\displaystyle \Psi _{X}(\lambda ):=\ln \mathbb {E} [\mathrm {e} ^{\lambda X}]\quad {\text{ for all }}\lambda \geq 0}$,

and its dual function:

${\displaystyle \Psi _{X}^{*}(t):=\sup _{\lambda \geq 0}(\lambda t-\Psi _{X}(\lambda ))}$.

Assume that ${\displaystyle X}$ is NOT almost surely constant. Then due to the convexity of ${\displaystyle \mathrm {e} ^{\lambda X}}$ with respect to ${\displaystyle \lambda }$, the function ${\displaystyle \Psi _{X}(\lambda )}$ is strictly convex over ${\displaystyle \lambda \geq 0}$.

• Prove the following Chernoff bound:
${\displaystyle \Pr[X\geq t]\leq \exp(-\Psi _{X}^{*}(t))}$.
In particular if ${\displaystyle \Psi _{X}(\lambda )}$ is continuously differentiable, prove that the supreme in ${\displaystyle \Psi _{X}^{*}(t)}$ is achieved at the unique ${\displaystyle \lambda \geq 0}$ satisfying
${\displaystyle \Psi _{X}'(\lambda )=t}$
where ${\displaystyle \Psi _{X}'(\lambda )}$ denotes the derivative of ${\displaystyle \Psi _{X}(\lambda )}$ with respect to ${\displaystyle \lambda }$.
• Normal random variables. Let ${\displaystyle X\sim \mathrm {N} (\mu ,\sigma )}$ be a Gaussian random variable with mean ${\displaystyle \mu }$ and standard deviation ${\displaystyle \sigma }$. What are the ${\displaystyle \Psi _{X}(\lambda )}$ and ${\displaystyle \Psi _{X}^{*}(t)}$? And give a tail inequality to upper bound the probability ${\displaystyle \Pr[X\geq t]}$.
• Poisson random variables. Let ${\displaystyle X\sim \mathrm {Pois} (\nu )}$ be a Poisson random variable with parameter ${\displaystyle \nu }$, that is, ${\displaystyle \Pr[X=k]=\mathrm {e} ^{-\nu }\nu ^{k}/k!}$ for all ${\displaystyle k=0,1,2,\ldots }$. What are the ${\displaystyle \Psi _{X}(\lambda )}$ and ${\displaystyle \Psi _{X}^{*}(t)}$? And give a tail inequality to upper bound the probability ${\displaystyle \Pr[X\geq t]}$.
• Bernoulli random variables. Let ${\displaystyle X\in \{0,1\}}$ be a single Bernoulli trial with probability of success ${\displaystyle p}$, that is, ${\displaystyle \Pr[X=1]=1-\Pr[X=0]=p}$. Show that for any ${\displaystyle t\in (p,1)}$, we have ${\displaystyle \Psi _{X}^{*}(t)=D(Y\|X)}$ where ${\displaystyle Y\in \{0,1\}}$ is a Bernoulli random variable with parameter ${\displaystyle t}$ and ${\displaystyle D(Y\|X)=(1-t)\ln {\frac {1-t}{1-p}}+t\ln {\frac {t}{p}}}$ is the Kullback-Leibler divergence between ${\displaystyle Y}$ and ${\displaystyle X}$.
• Sum of independent random variables. Let ${\displaystyle X=\sum _{i=1}^{n}X_{i}}$ be the sum of ${\displaystyle n}$ independently and identically distributed random variables ${\displaystyle X_{1},X_{2},\ldots ,X_{n}}$. Show that ${\displaystyle \Psi _{X}(\lambda )=\sum _{i=1}^{n}\Psi _{X_{i}}(\lambda )}$ and ${\displaystyle \Psi _{X}^{*}(t)=n\Psi _{X_{i}}^{*}({\frac {t}{n}})}$. Also for binomial random variable ${\displaystyle X\sim \mathrm {Bin} (n,p)}$, give an upper bound to the tail inequality ${\displaystyle \Pr[X\geq t]}$ in terms of KL-divergence.
Give an upper bound to ${\displaystyle \Pr[X\geq t]}$ when every ${\displaystyle X_{i}}$ follows the geometric distribution with a probability ${\displaystyle p}$ of success.

## Problem 4

A boolean code is a mapping ${\displaystyle C:\{0,1\}^{k}\rightarrow \{0,1\}^{n}}$. Each ${\displaystyle x\in \{0,1\}^{k}}$ is called a message and ${\displaystyle y=C(x)}$ is called a codeword. The code rate ${\displaystyle r}$ of a code ${\displaystyle C}$ is ${\displaystyle r={\frac {k}{n}}}$. A boolean code ${\displaystyle C:\{0,1\}^{k}\rightarrow \{0,1\}^{n}}$ is a linear code if it is a linear transformation, i.e. there is a matrix ${\displaystyle A\in \{0,1\}^{n\times k}}$ such that ${\displaystyle C(x)=Ax}$ for any ${\displaystyle x\in \{0,1\}^{k}}$, where the additions and multiplications are defined over the finite field of order two, ${\displaystyle (\{0,1\},+_{\bmod {2}},\times _{\bmod {2}})}$.

The distance between two codeword ${\displaystyle y_{1}}$ and ${\displaystyle y_{2}}$, denoted by ${\displaystyle d(y_{1},y_{2})}$, is defined as the Hamming distance between them. Formally, ${\displaystyle d(y_{1},y_{2})=\|y_{1}-y_{2}\|_{1}=\sum _{i=1}^{n}|y_{1}(i)-y_{2}(i)|}$. The distance of a code ${\displaystyle C}$ is the minimum distance between any two codewords. Formally, ${\displaystyle d=\min _{x_{1},x_{2}\in \{0,1\}^{k} \atop x_{1}\neq x_{2}}d(C(x_{1}),C(x_{2}))}$.

Usually we want to make both the code rate ${\displaystyle r}$ and the code distance ${\displaystyle d}$ as large as possible, because a larger rate means that the amount of actual message per transmitted bit is high, and a larger distance allows for more error correction and detection.

• Use the probabilistic method to prove that there exists a boolean code ${\displaystyle C:\{0,1\}^{k}\rightarrow \{0,1\}^{n}}$ of code rate ${\displaystyle r}$ and distance ${\displaystyle \left({\frac {1}{2}}-\Theta \left({\sqrt {r}}\right)\right)n}$. Try to optimize the constant in ${\displaystyle \Theta (\cdot )}$.
• Prove a similar result for linear boolean codes.