Skip to content

Lecture 8 on 02/23/2026 - Balls and Bins - Load Analysis using Chernoff Bounds

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 3lnnlnlnn\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 3lnnlnlnn\frac{3\ln{n}}{\ln \ln n} is at most 1n\frac{1}{n}.

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

  • Pick n=ee21618n = e^{e^2} \approx 1618
  • 3lnnlnlnn=3e2212\Rightarrow \frac{3\ln n}{\ln \ln n} = \frac{3 e^2}{2} \approx 12

Essentially, when n1618n \approx 1618:

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

The probability that the maximum load is less than 12 is at least (10.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(Qt)E[Q]t=1tP(Q \geq t) \leq \frac{E[Q]}{t} = \frac{1}{t} P(Qn)1nP(Q10000)110,000P(Q \geq n) \leq \frac{1}{n} \Rightarrow P(Q \geq 10000) \leq \frac{1}{10,000} Pr(Qt)Var(Q)t2=1t2\Pr(Q \geq t) \leq \frac{\text{Var}(Q)}{t^2} = \frac{1}{t^2} Pr(Qn)1n\Pr(Q \geq \sqrt{n}) \leq \frac{1}{n} Pr(Qlnnlnlnn)1n\Pr(Q \geq \frac{\ln n}{\ln \ln n}) \leq \frac{1}{n} Pr(Q12)Think of this guarantee as coming from Chernoff110000\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 R6μR \geq 6\mu:

    Pr(XR)2R\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(Q6)?\Pr(Q \geq 6) \leq ?

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

Pr(Q6)=26=126=164\Pr(Q \geq 6) = 2^{-6} = \frac{1}{2^6} = \frac{1}{64}