Documentation

CslibFrontier.GameTheory.LoadBalancing.GeneralBallsIntoBins

General (n, m) balls-into-bins expected maximum occupancy #

This module formalizes the full two-sided general (n, m) balls-into-bins expected maximum occupancy theorem ([Voc07], §20.4.1, Proposition 20.11, p. 530): when n ≥ 1 balls are placed independently and uniformly at random into m ≥ 2 bins, the expected maximum occupancy is Θ(log m / log (1 + (m / n) * log m)) (and equals n when m = 1).

Proof overview #

We model n unit balls in m bins directly as unitBallsGame n m (the identical-machine load-balancing game with n unit-weight jobs and m machines) under uniformBallsProfile n m (p i j = 1 / m), so expectedMaxOccupancy n m coincides definitionally with (unitBallsGame n m).expectedMakespan (uniformBallsProfile n m) and agrees with (unitIdenticalGame m).expectedMakespan (uniformMixedProfile m) at n = m.

  1. Upper bound (expectedMaxOccupancy_le): setting T = 6 * log m / log (1 + (m / n) * log m) and applying the weighted Chernoff tail LoadBalancingGame.prob_subset_load_ge_le_exp to each bin at thresholds (r + 1) * T gives Pr[L_j ≥ (r + 1) * T] ≤ (1 / m ^ 2) ^ (r + 1) via the universal inequality √(1 + x) * log (1 + x) ≤ 2 * x < (6 / e) * x for all x > 0. Union-bounding over m ≥ 2 bins and summing the resulting (1 / 2) ^ (r + 1) geometric tail yields expectedMaxOccupancy n m ≤ 2 * T = 12 * log m / log (1 + (m / n) * log m) for every n ≥ 1 and m ≥ 2.
  2. Lower bound (expectedMaxOccupancy_ge): writing x = (m / n) * log m and L = log m / log (1 + x):
    • for x ≤ 256, concavity of log on [1, 257] gives (1 / 47) * L ≤ n / m ≤ E[max L_j];
    • for L ≤ 16, the trivial lower bound 1 ≤ E[max L_j] gives (1 / 16) * L ≤ E[max L_j];
    • for x > 256 and L > 16, taking d = ⌊L / 8⌋₊ gives 2 * n ≤ d * m, 2 * d ≤ n, and m * Pr[L_j = d] ≥ 1, so ballsIntoBins_tail_ge_half_of_one_le yields E[max L_j] ≥ d / 2 ≥ (1 / 32) * L.

Main definitions #

Main results #

References #

n unit-weight jobs on m identical machines (general (n, m) balls-into-bins instance; [Voc07], §20.4.1, Proposition 20.11, p. 530).

The uniform mixed strategy profile p i j = 1 / m for n jobs on m machines.

The expected maximum occupancy when n balls are placed independently and uniformly at random into m bins ([Voc07], §20.4.1, Proposition 20.11, p. 530).

theorem Cslib.GameTheory.LoadBalancingGame.load_unitBallsGame_eq_card (n m : ℕ) (A : Fin n → Fin m) (j : Fin m) :
(unitBallsGame n m).load A j = ↑{i : Fin n | A i = j}.card
theorem Cslib.GameTheory.LoadBalancingGame.expectedMaxOccupancy_eq_sum (n m : ℕ) [NeZero m] :
expectedMaxOccupancy n m = ∑ A : Fin n → Fin m, (1 / ↑m) ^ n * Finset.univ.sup' ⋯ fun (j : Fin m) => ↑{i : Fin n | A i = j}.card

Explicit balls-into-bins sum formula for expectedMaxOccupancy n m.

For n = m, expectedMaxOccupancy m m coincides with the uniform mixed equilibrium makespan of unitIdenticalGame m.

Exact expected maximum occupancy for a single bin (m = 1): all n balls land in bin 0.

Pigeonhole lower bound: for any n balls and m ≥ 1 bins, n / m ≤ expectedMaxOccupancy n m.

For n ≥ 1 balls and m ≥ 1 bins, every assignment has maximum occupancy at least 1.

theorem Cslib.GameTheory.LoadBalancingGame.expectedMaxOccupancy_le {n m : ℕ} [NeZero m] (hn : 1 ≤ n) (hm : 2 ≤ m) :
expectedMaxOccupancy n m ≤ 12 * (Real.log ↑m / Real.log (1 + ↑m / ↑n * Real.log ↑m))

General (n, m) balls-into-bins expected maximum occupancy upper bound ([Voc07], §20.4.1, Proposition 20.11, p. 530): for all n ≥ 1 balls thrown independently and uniformly into m ≥ 2 bins, expectedMaxOccupancy n m ≤ 12 * (log m / log (1 + (m / n) * log m)).

theorem Cslib.GameTheory.LoadBalancingGame.expectedMaxOccupancy_ge {n m : ℕ} [NeZero m] (hn : 1 ≤ n) (hm : 2 ≤ m) :
1 / 47 * (Real.log ↑m / Real.log (1 + ↑m / ↑n * Real.log ↑m)) ≤ expectedMaxOccupancy n m

General (n, m) balls-into-bins expected maximum occupancy lower bound ([Voc07], §20.4.1, Proposition 20.11, p. 530): for all n ≥ 1 balls thrown independently and uniformly into m ≥ 2 bins, (1 / 47) * (log m / log (1 + (m / n) * log m)) ≤ expectedMaxOccupancy n m.