Skip to content

Lecture 8 (02/23/2026) - Balls and Bins - Load Analysis using Chernoff Bounds | CSCI 328

After: do exercises from Ch.4 in Mitzenmacher and Upfal.

When nn balls are thrown independently and uniformly at random into nn bins, the probability that the maximum load is more than 3ln⁡nln⁡ln⁡n\frac{3\ln{n}}{\ln \ln n} is at most 1n\frac{1}{n} for nn sufficiently large.

The probability that the maximum load is more than 3ln⁡nln⁡ln⁡n\frac{3\ln{n}}{\ln \ln n} is at most 1n\frac{1}{n}.

For n=eex≈1618n = e^{e^x} \approx 1618:

  • Pick n=ee2≈1618n = e^{e^2} \approx 1618
  • ⇒3ln⁡nln⁡ln⁡n=3e22≈12\Rightarrow \frac{3\ln n}{\ln \ln n} = \frac{3 e^2}{2} \approx 12

Essentially, when n≈1618n \approx 1618:

The probability that the maximum load is more than 12 is at most 11618≈0.0001=0.01%\frac{1}{1618} \approx 0.0001 = 0.01\%.

The probability that the maximum load is less than 12 is at least (1−0.0001)=99.99%(1 - 0.0001) = 99.99\%.

Bounds Using Different Concentration Inequalities

Section titled “Bounds Using Different Concentration Inequalities”

For HWC, the probability that a query takes more than tt time is (going by n=10,000n=10,000):

P(Q≥t)≤E[Q]t=1tP(Q \geq t) \leq \frac{E[Q]}{t} = \frac{1}{t} P(Q≥n)≤1n⇒P(Q≥10000)≤110,000P(Q \geq n) \leq \frac{1}{n} \Rightarrow P(Q \geq 10000) \leq \frac{1}{10,000} Pr⁡(Q≥t)≤Var(Q)t2=1t2\Pr(Q \geq t) \leq \frac{\text{Var}(Q)}{t^2} = \frac{1}{t^2} Pr⁡(Q≥n)≤1n\Pr(Q \geq \sqrt{n}) \leq \frac{1}{n} Pr⁡(Q≥ln⁡nln⁡ln⁡n)≤1n\Pr(Q \geq \frac{\ln n}{\ln \ln n}) \leq \frac{1}{n} ⇒Pr⁡(Q≥12)⏟Think of this guarantee as coming from Chernoff≤110000\Rightarrow \underbrace{\Pr(Q \geq 12)}_{\text{Think of this guarantee as coming from Chernoff}} \leq \frac{1}{10000}

Theorem 4.4: Chernoff Bounds for Sums of Bernoulli Random Variables

Section titled “Theorem 4.4: Chernoff Bounds for Sums of Bernoulli Random Variables”

Let X1,…,XnX_1, \ldots, X_n be independent Poisson (think this as Bernoulli for now) trials such that Pr⁡(Xi=1)=pi\Pr(X_i = 1) = p_i.

Let X=∑i=1nXiX = \sum_{i=1}^n X_i and μ=E(X)\mu = E(X). Then the following Chernoff bounds hold:

  • For any δ>0\delta > 0:

    Pr⁡(X≥(1+δ)μ)≤(eδ(1+δ)1+δ)μ\Pr(X \geq (1+\delta)\mu) \leq \left(\frac{e^\delta}{(1+\delta)^{1+\delta}}\right)^\mu
  • For 0<δ≤10 < \delta \leq 1:

    Pr⁡(X≥(1+δ)μ)≤e−μδ2/3\Pr(X \geq (1+\delta)\mu) \leq e^{-\mu\delta^2/3}
  • For R≥6μR \geq 6\mu:

    Pr⁡(X≥R)≤2−R\Pr(X \geq R) \leq 2^{-R}

For HWC, what is the probability that at least 6 similar keys hash to the same bucket in a query?

Pr⁡(Q≥6)≤?\Pr(Q \geq 6) \leq ?

We can apply Chernoff rule #3 to this since Q≥6μQ \geq 6\mu:

Pr⁡(Q≥6)=2−6=126=164\Pr(Q \geq 6) = 2^{-6} = \frac{1}{2^6} = \frac{1}{64}