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

• 每道题目的解答都要有完整的解题过程。中英文不限。

## Problem 1

Fix a universe $U$ and two subset $A,B \subseteq U$, both with size $n$. we create both Bloom filters $F_A$($F_B$) for $A$ ($B$), using the same number of bits $m$ and the same $k$ hash functions.

• Let $F_C = F_A \land F_B$ be the Bloom filter formed by computing the bitwise AND of $F_A$ and $F_B$. Argue that $F_C$ may not always be the same as the Bloom filter that are created for $A\cap B$.
• Bloom filters can be used to estimate set differences. Express the expected number of bits where $F_A$ and $F_B$ differ as a function of $m, n, k$ and $|A\cap B|$.

## Problem 2

In Balls-and-Bins model, we throw $m$ balls independently and uniformly at random into $n$ bins. We know that the maximum load is $\Theta\left(\frac{\log n}{\log\log n}\right)$ with high probability when $m=\Theta(n)$. The two-choice paradigm is another way to throw $m$ balls into $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 $m=\Theta(n)$, the maximum load of two-choice paradigm is known to be $\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 $n$ balls into $n$ bins. The first $\frac{n}{2}$ balls are thrown into bins independently and uniformly at random. The remaining $\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 $\Theta(\cdot)$).
• Replace the above paradigm to the following: the first $\frac{n}{2}$ balls are thrown into bins using the two-choice paradigm while the remaining $\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 $n$ balls are thrown in a sequence. For every $1\le i\le n$, if $i$ is odd, we throw $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

Suppose we want to estimate the value of $Z$. Let $\mathcal{A}$ be an algorithm that outputs $\widehat{Z}$ satisfying $\Pr[ (1-\epsilon)Z \leq \widehat{Z} \leq (1+\epsilon )Z] \geq \frac{3}{4} .$

We run $\mathcal{A}$ independently for $s$ times, and obtain the outputs $\widehat{Z}_1,\widehat{Z}_2,\ldots,\widehat{Z}_s$.

Let $X$ be the median (中位数) of $\widehat{Z}_1,\widehat{Z}_2,\ldots,\widehat{Z}_s$. Find the number $s$ such that $\Pr[ (1-\epsilon)Z \leq X \leq (1+\epsilon )Z] \geq 1 - \delta .$

Express $s$ as a function of $\delta$. Make $s$ as small as possible.

Remark: in this problem, we boost the probability of success from $\frac{3}{4}$ to $1-\delta$. This method is called the median trick.

Hint: Chernoff bound.

## Problem 4

Let $X$ be a random variable with expectation $0$ such that moment generating function $\mathbf{E}[\exp(t|X|)]$ is finite for some $t \gt 0$. We can use the following two kinds of tail inequalities for $X$.

Chernoff Bound

\begin{align} \mathbf{Pr}[|X| \geq \delta] \leq \min_{t \geq 0} \frac{\mathbf{E}[e^{t|X|}]}{e^{t\delta}} \end{align}

$k$th-Moment Bound

\begin{align} \mathbf{Pr}[|X| \geq \delta] \leq \frac{\mathbf{E}[|X|^k]}{\delta^k} \end{align}
• Show that for each $\delta$, there exists a choice of $k$ such that the $k$th-moment bound is stronger than the Chernoff bound.
 Hint: Consider the Taylor expansion of the moment generating function and apply the probabilistic method.

• Why would we still prefer the Chernoff bound to the (seemingly) stronger $k$-th moment bound?

## Problem 5

In this problem, we will explore the idea of negative association, show that the classical Chernoff bounds also hold for sum of negatively associated random variables, and see negative association in action by considering occupancy numbers in the balls and bins model. Let $\boldsymbol{X}=(X_1,\cdots,X_n)$ be a vector of random variables. We say random variables $\boldsymbol{X}$ are negatively associated if for all disjoint subsets $I,J\subseteq[n]$,

$\mathbb{E}[f(X_i,i\in I)g(X_j,j\in J)]\leq \mathbb{E}[f(X_i,i\in I)]\mathbb{E}[g(X_j,j\in J)]$

for all non-decreasing function $f:\mathbb{R}^{|I|}\rightarrow\mathbb{R}$ and $g:\mathbb{R}^{|J|}\rightarrow\mathbb{R}$.

Intuitively, if a set of random variables is negatively related, then if any monotone increasing function $f$ of one subset of variables increases then any other monotone increasing function $g$ of a disjoint set of variables must decrease.

(a) Let $X_1,\cdots,X_n$ be a set of negatively associated random variables, show that for any non-negative non-decreasing function $f_i$ where $i\in[n]$,

$\mathbb{E}\left[\prod_{i\in[n]}f_i(X_i)\right]\leq\prod_{i\in[n]}\mathbb{E}[f_i(X_i)]$

(b) Show that the classical Chernoff bounds can be applied as is to $X=\sum_{i\in[n]}X_i$ if the random variables $X_1,\cdots,X_n$ are negatively associated. (Consider both the upper tail and the lower tail.)

To establish the negative association condition, the following two properties are usually very helpful:

• (Closure under products).If $\boldsymbol{X}=(X_1,\cdots,X_n)$ is a set of negatively associated random variables, and $\boldsymbol{Y}=(Y_1,\cdots,Y_m)$ is also a set of negatively associated random variables, but $\boldsymbol{X}$ and $\boldsymbol{Y}$ are mutually independent, then the augmented vector $(\boldsymbol{X},\boldsymbol{Y})=(X_1,\cdots,X_n,Y_1,\cdots,Y_m)$ is a set of negatively associated random variables.
• (Disjoint monotone aggregation). Let $\boldsymbol{X}=(X_1,\cdots,X_n)$ be a set of negatively associated random variables. Let $I_1,\cdots,I_k\subseteq[n]$ be disjoint index sets for some positive integer $k$. For $j\in[k]$, let $f_j:\mathbb{R}^{|I_j|}\rightarrow\mathbb{R}$ be functions that are all non–decreasing or all non–increasing, and define $Y_j=f_j(X_i,i\in I_j)$. Then, $\boldsymbol{Y}=(Y_1,\cdots,Y_k)$ is also a set of negatively associated random variables. (That is, non–decreasing or non–increasing functions of disjoint subsets of negatively associated variables are also negatively associated.)

We now consider the paradigmatic example of negative dependence: occupancy numbers in the balls and bins model. Again, $m$ balls are thrown independently into $n$ bins. However, this time, the balls and the bins are not necessarily identical: ball $k$ has probability $p_{i,k}$ of landing in bin $i$, for $k\in[m]$ and $i\in[n]$, with $\sum_{i\in[n]}p_{i,k}=1$ for each $k\in[m]$. Define indicator random variable $B_{i,k}$ taking value one if and only if ball $k$ lands in bin $i$. The occupancy numbers are $B_i=\sum_{k\in[m]}B_{i,k}$. That is, $B_i$ denote the number of balls that land in bin $i$.

(c) Intuitively, $B_1,\cdots,B_n$ are negatively associated: if we know one bin has more balls, then clearly other bins are more likely to have less balls. Now, show that the occupancy numbers $B_1,\cdots,B_n$ are negatively associated, formally.