Lecture 12 - 2025 / 3 / 27

Balls and Bins (2)

Lemma:E\cal E 是关于 bin loads 的事件,且 Pr[E]\Pr[\cal E] 关于 mm 递增是单调上升 / 单调下降的,则 PrX[E]4PrY[E]\Pr_X[\mathcal E] \le 4 \Pr_Y[\mathcal E],其中 XX 为 Balls and Bins 模型,YYnn 个独立的 π(m/n)\pi(m/n)

不妨设 Pr[E]\Pr[\cal E] 单调上升,则

PrY[E]=k=0PrY[Ei=1nYi=k]Pr[i=1nYi=k]k=mPrY[Ei=1nYi=m]Pr[i=1nYi=k]PrY[Ei=1nYi=m]Pr[i=1nYim]PrX[E]14\begin{aligned} \Pr_Y[\mathcal E] & = \sum_{k=0}^{\infty} \Pr_Y\left[\mathcal E \mid \sum_{i=1}^{n} Y_i = k\right] \Pr\left[ \sum_{i=1}^{n} Y_i = k \right] \\ & \ge \sum_{k=m}^{\infty} \Pr_Y\left[\mathcal E \mid \sum_{i=1}^{n} Y_i = m\right] \Pr\left[ \sum_{i=1}^{n} Y_i = k \right]\\ & \ge \Pr_Y\left[\mathcal E \mid \sum_{i=1}^{n} Y_i = m\right] \Pr\left[ \sum_{i=1}^{n} Y_i \ge m \right]\\ & \ge \Pr_X [\mathcal E] \cdot \frac{1}{4} \end{aligned}

最后一步用到对于 λN\lambda \in \N,对于 Xπ(λ)X \sim \pi(\lambda),有 Pr[Xλ]1/4\Pr[X \ge \lambda] \ge 1/4

Corollary: Pr[i,Xic]4Pr[i,Yic]\Pr[\forall i, X_i \le c] \le 4 \Pr[\forall i, Y_i \le c]

Theorem:nn 个球独立均匀放进 nn 个桶里,最大负载量 w.h.p 是 Ω(lnnlnlnn)\Omega(\dfrac{\ln n}{\ln \ln n})

E2\mathcal{E}_2 表示所有 Yi(1ε)lnnlnlnnY_i \le (1-\varepsilon)\dfrac{\ln n}{\ln \ln n} 我们需要证明 Pr[E2]=1/poly(n)\Pr [\mathcal{E}_2] = 1 / \text{poly}(n)

由于 Y1π(1)Y_1 \sim \pi(1),所以 Pr[Y1k]=j=ke1j!1k!\Pr[Y_1 \ge k] = \sum_{j = k}^{\infty} \dfrac{e^{-1}}{j!} \le \dfrac{1}{k!}。这是因为 e=1+1/2+1/3!+e = 1 + 1/2 + 1/3! + \cdots。当然,更直接的有 Pr[Y1k]1ek!\Pr[Y_1 \ge k] \ge \dfrac{1}{ek!}
Pr[E2]=(1Pr[Y1k])n(11ek!)nexp(nek!)exp(exp(Θ(εlnn)))=exp(nΘ(ε))\begin{aligned} \Pr[\mathcal E_2] & = (1 - \Pr[Y_1 \ge k])^n\\ & \le \left( 1 - \frac{1}{ek!} \right)^n\\ & \le \exp\left(-\frac{n}{ek!} \right) \\ & \le \exp(-\exp(\Theta(\varepsilon \ln n))) \\ & = \exp(-n^{\Theta(\varepsilon)}) \end{aligned}

于是以指数速度趋于 00

综上所述,最大负载量 w.h.p 是 Θ(lnnlnlnn)\Theta(\dfrac{\ln n}{\ln \ln n})

Stochastic Dominance

Definition (SD w.r.t. random variables): 对于两个在 [a,b][a, b] 上的随机变量 X,YX, Y,如果 c[a,b],Pr[Yc]Pr[Xc]\forall c \in [a, b], \Pr[Y \ge c] \ge \Pr[X \ge c],则称 YY stochastic dominates XX,记作 XYX \preceq Y

Definiton (SD w.r.t. functions): 对于两个在 [a,b][a, b] 上的函数 f,gf, g,如果 c[a,b]\forall c \in [a, b]
xcf(x)dxycg(y)dy\int_{x \ge c} f(x) \text d x \le \int_{y \ge c} g(y) \text d y

则称 ff stochastic dominates gg,记作 fgf \preceq g

Lemma: X1Y1,X2Y2X_1 \preceq Y_1, X_2 \preceq Y_2,且 X1,X2X_1, X_2 独立,Y1,Y2Y_1, Y_2 独立,则 X1+X2Y1+Y2X_1 + X_2 \preceq Y_1 + Y_2

对于任何 cc,我们只需证明 Y1+X2Y1+Y2Y_1 + X_2 \preceq Y_1 + Y_2,则根据对称性得证。
Pr[Y1+Y2c]=y1Pr[Y1=y1]Pr[Y2cy1]y1Pr[Y1=y1]Pr[X2cy1]=Pr[Y1+X2c]\begin{aligned} \Pr[Y_1 + Y_2 \ge c] & = \sum_{y_1} \Pr[Y_1 = y_1] \Pr[Y_2 \ge c - y_1] \\ & \ge \sum_{y_1} \Pr[Y_1 = y_1] \Pr[X_2 \ge c - y_1] \\ & = \Pr[Y_1 + X_2 \ge c] \end{aligned}

Corollary: 如果函数列 {gj}j=1m\{g_j\}_{j=1}^{m}{fj}j=1m\{f_j\}_{j=1}^{m} 满足 fj(;x1,,xi1)gj()f_j(\cdot; x_1, \cdots, x_{i-1}) \preceq g_j(\cdot),则
xjcf1(x1)fm(xm;x1,,xm1)dxxjcg1(x1)gm(xm)dx\int_{\sum x_j \ge c} f_1(x_1)\cdots f_m(x_m; x_1, \cdots, x_{m-1})\text dx \le \int_{\sum x_j \ge c} g_1(x_1)\cdots g_m(x_m) \text dx

归纳法,先固定 x1,,xm1x_1, \cdots, x_{m-1},将 fm(;x1,,xm1)f_m(\cdot; x_1, \cdots, x_{m-1}) 替换为 g()g(\cdot),然后重复上述过程。

Power of 2 Choices (1)

mm 个球独立放入 nn 个桶中,每个球随机选择两个桶,放入负载较小的那个桶。

Theorem: m=nm = n 时,最大负载量 w.h.p 不超过 lnlnnln2+Θ(1)\dfrac{\ln \ln n}{\ln 2} + \Theta(1)

证明的大体思路是,设 BiB_i 为负载量 i\ge i 的桶的个数。我们试图找到一系列 bound βi\beta_i,使得 w.h.p BiβiB_i \le \beta_i,则对于任何一个特定的球,其落在负载 i\ge i 的桶的概率 (βin)2\le \left( \dfrac{\beta_i}{n} \right)^2。从而 Bi+1B(n,(βi/n)2)B_{i+1} \preceq \mathcal B(n, (\beta_i / n)^2),均值为 βi2/n\beta_i^2 / n,可以根据 Chernoff bound 取 βi+1=cβi2/n\beta_{i+1} = c \beta_i^2 /n,于是有 βi+1n=c(βin)2\dfrac{\beta_{i+1}}{n} = c \left( \dfrac{\beta_i}{n} \right)^2,即 βi/n\beta_i / n 平方速度下降,当 ilnlnnln2i \approx \dfrac{\ln \ln n}{\ln 2} 时有 βi<1\beta_i < 1,这便是最大负载量。