Lecture 12 - 2025 / 3 / 27

Balls and Bins (2)

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

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

Pr⁡Y[E]=∑k=0∞Pr⁡Y[E∣∑i=1nYi=k]Pr⁡[∑i=1nYi=k]≥∑k=m∞Pr⁡Y[E∣∑i=1nYi=m]Pr⁡[∑i=1nYi=k]≥Pr⁡Y[E∣∑i=1nYi=m]Pr⁡[∑i=1nYi≥m]≥Pr⁡X[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,Xi≤c]≤4Pr⁡[∀i,Yi≤c]\Pr[\forall i, X_i \le c] \le 4 \Pr[\forall i, Y_i \le c]

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

记 E2\mathcal{E}_2 表示所有 Yi≤(1−ε)ln⁡nln⁡ln⁡nY_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⁡[Y1≥k]=∑j=k∞e−1j!≤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⁡[Y1≥k]≥1ek!\Pr[Y_1 \ge k] \ge \dfrac{1}{ek!}。
Pr⁡[E2]=(1−Pr⁡[Y1≥k])n≤(1−1ek!)n≤exp⁡(−nek!)≤exp⁡(−exp⁡(Θ(εln⁡n)))=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 是 Θ(ln⁡nln⁡ln⁡n)\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⁡[Y≥c]≥Pr⁡[X≥c]\forall c \in [a, b], \Pr[Y \ge c] \ge \Pr[X \ge c],则称 YY stochastic dominates XX,记作 X⪯YX \preceq Y。

Definiton (SD w.r.t. functions): 对于两个在 [a,b][a, b] 上的函数 f,gf, g,如果 ∀c∈[a,b]\forall c \in [a, b]
∫x≥cf(x)dx≤∫y≥cg(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,记作 f⪯gf \preceq g。

Lemma: X1⪯Y1,X2⪯Y2X_1 \preceq Y_1, X_2 \preceq Y_2,且 X1,X2X_1, X_2 独立,Y1,Y2Y_1, Y_2 独立,则 X1+X2⪯Y1+Y2X_1 + X_2 \preceq Y_1 + Y_2。

对于任何 cc,我们只需证明 Y1+X2⪯Y1+Y2Y_1 + X_2 \preceq Y_1 + Y_2,则根据对称性得证。
Pr⁡[Y1+Y2≥c]=∑y1Pr⁡[Y1=y1]Pr⁡[Y2≥c−y1]≥∑y1Pr⁡[Y1=y1]Pr⁡[X2≥c−y1]=Pr⁡[Y1+X2≥c]\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,⋯ ,xi−1)⪯gj(⋅)f_j(\cdot; x_1, \cdots, x_{i-1}) \preceq g_j(\cdot),则
∫∑xj≥cf1(x1)⋯fm(xm;x1,⋯ ,xm−1)dx≤∫∑xj≥cg1(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,⋯ ,xm−1x_1, \cdots, x_{m-1},将 fm(⋅;x1,⋯ ,xm−1)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 不超过 ln⁡ln⁡nln⁡2+Θ(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+1⪯B(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 平方速度下降,当 i≈ln⁡ln⁡nln⁡2i \approx \dfrac{\ln \ln n}{\ln 2} 时有 βi<1\beta_i < 1,这便是最大负载量。