CHOICE-MEMORY TRADEOFF IN ALLOCATIONS

Similar documents
On Random Line Segments in the Unit Square

Optimally Sparse SVMs

Convergence of random variables. (telegram style notes) P.J.C. Spreij

Disjoint Systems. Abstract

Application to Random Graphs

w (1) ˆx w (1) x (1) /ρ and w (2) ˆx w (2) x (2) /ρ.

Chapter 6 Infinite Series

7.1 Convergence of sequences of random variables

An Introduction to Randomized Algorithms

Problem Set 2 Solutions

1 Hash tables. 1.1 Implementation

(A sequence also can be thought of as the list of function values attained for a function f :ℵ X, where f (n) = x n for n 1.) x 1 x N +k x N +4 x 3

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.436J/15.085J Fall 2008 Lecture 19 11/17/2008 LAWS OF LARGE NUMBERS II THE STRONG LAW OF LARGE NUMBERS

Notes 19 : Martingale CLT

Randomized Algorithms I, Spring 2018, Department of Computer Science, University of Helsinki Homework 1: Solutions (Discussed January 25, 2018)

Product measures, Tonelli s and Fubini s theorems For use in MAT3400/4400, autumn 2014 Nadia S. Larsen. Version of 13 October 2014.

Lecture 3: August 31

Lecture 2. The Lovász Local Lemma

Infinite Sequences and Series

The Growth of Functions. Theoretical Supplement

Hashing and Amortization

4.3 Growth Rates of Solutions to Recurrences

7.1 Convergence of sequences of random variables

Chapter 3. Strong convergence. 3.1 Definition of almost sure convergence

Lecture 5: April 17, 2013

4. Partial Sums and the Central Limit Theorem

Advanced Stochastic Processes.

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.265/15.070J Fall 2013 Lecture 3 9/11/2013. Large deviations Theory. Cramér s Theorem

(b) What is the probability that a particle reaches the upper boundary n before the lower boundary m?

MA131 - Analysis 1. Workbook 2 Sequences I

Basics of Probability Theory (for Theory of Computation courses)

ECE 901 Lecture 12: Complexity Regularization and the Squared Loss

Lecture 2 February 8, 2016

Discrete Mathematics for CS Spring 2008 David Wagner Note 22

The standard deviation of the mean

HOMEWORK 2 SOLUTIONS

Integrable Functions. { f n } is called a determining sequence for f. If f is integrable with respect to, then f d does exist as a finite real number

Self-normalized deviation inequalities with application to t-statistic

OPTIMAL ALGORITHMS -- SUPPLEMENTAL NOTES

CS / MCS 401 Homework 3 grader solutions

Random Walks on Discrete and Continuous Circles. by Jeffrey S. Rosenthal School of Mathematics, University of Minnesota, Minneapolis, MN, U.S.A.

STAT Homework 1 - Solutions

Lecture 2 Long paths in random graphs

Lecture 10 October Minimaxity and least favorable prior sequences

Sequences. Notation. Convergence of a Sequence

n outcome is (+1,+1, 1,..., 1). Let the r.v. X denote our position (relative to our starting point 0) after n moves. Thus X = X 1 + X 2 + +X n,

Problem Set 4 Due Oct, 12

Definition 4.2. (a) A sequence {x n } in a Banach space X is a basis for X if. unique scalars a n (x) such that x = n. a n (x) x n. (4.

THE ASYMPTOTIC COMPLEXITY OF MATRIX REDUCTION OVER FINITE FIELDS

Distribution of Random Samples & Limit theorems

Sequences I. Chapter Introduction

A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

Statistics 511 Additional Materials

Sequences A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

Machine Learning Theory Tübingen University, WS 2016/2017 Lecture 12

CS284A: Representations and Algorithms in Molecular Biology

Lecture 2: Concentration Bounds

REGRESSION WITH QUADRATIC LOSS

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 22

Lecture 2: April 3, 2013

ACO Comprehensive Exam 9 October 2007 Student code A. 1. Graph Theory

Math 155 (Lecture 3)

Math 216A Notes, Week 5

( ) = p and P( i = b) = q.

Lecture 4: April 10, 2013

SRC Technical Note June 17, Tight Thresholds for The Pure Literal Rule. Michael Mitzenmacher. d i g i t a l

Seunghee Ye Ma 8: Week 5 Oct 28

On Algorithm for the Minimum Spanning Trees Problem with Diameter Bounded Below

Assignment 5: Solutions

Lecture 6 Simple alternatives and the Neyman-Pearson lemma

Lecture 12: September 27

CS 330 Discussion - Probability

A Hadamard-type lower bound for symmetric diagonally dominant positive matrices

The random version of Dvoretzky s theorem in l n

6.3 Testing Series With Positive Terms

Chapter 5. Inequalities. 5.1 The Markov and Chebyshev inequalities

FACULTY OF MATHEMATICAL STUDIES MATHEMATICS FOR PART I ENGINEERING. Lectures

Element sampling: Part 2

Lecture 14: Graph Entropy

Lecture 9: Hierarchy Theorems

4 The Sperner property.

1 Review and Overview

Lecture 19: Convergence

Random Models. Tusheng Zhang. February 14, 2013

1 Review and Overview

Beurling Integers: Part 2

Math 61CM - Solutions to homework 3

Stochastic Simulation

PSYCHOLOGICAL RESEARCH (PYC 304-C) Lecture 9

Lecture 4 February 16, 2016

Chapter 6 Principles of Data Reduction

Machine Learning Brett Bernstein

If a subset E of R contains no open interval, is it of zero measure? For instance, is the set of irrationals in [0, 1] is of measure zero?

Sequences and Series of Functions

Mathematical Induction

Ada Boost, Risk Bounds, Concentration Inequalities. 1 AdaBoost and Estimates of Conditional Probabilities

1+x 1 + α+x. x = 2(α x2 ) 1+x

Regression with quadratic loss

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.265/15.070J Fall 2013 Lecture 21 11/27/2013

The log-behavior of n p(n) and n p(n)/n

Transcription:

CHOICE-MEMORY TRADEOFF IN ALLOCATIONS NOGA ALON, ORI GUREL-GUREVICH, AND EYAL LUBETZKY Abstract. I the classical balls-ad-bis paradigm, where balls are placed idepedetly ad uiformly i bis, typically the umber of bis with at least two balls i them is Θ) ad the maximum umber of balls i a bi is Θ log ). It is well kow that whe each roud log log offers k idepedet uiform optios for bis, it is possible to typically achieve a costat maximal load if ad oly if k = Ωlog ). Moreover, it is possible whp to avoid ay collisios betwee /2 balls if k > log 2. I this work, we exted this ito the settig where oly m bits of memory are available. We establish a tradeoff betwee the umber of choices k ad the memory m, dictated by the quatity km/. Roughly put, we show that for km oe ca achieve a costat maximal load, while for km o substatial improvemet ca be gaied over the case k = 1 i.e., a radom allocatio). For ay k = Ωlog ) ad m = Ωlog 2 ), oe ca achieve a costat load whp if km = Ω), yet the load is ubouded if km = o). Similarly, if km > C the /2 balls ca be allocated without ay collisios whp, whereas for km < ε there are typically Ω) collisios. log/m) Furthermore, we show that the load is whp at least. I log k+log log/m) particular, for k polylog), if m = 1 δ the optimal maximal load is Θ log ) the same as i the case k = 1), while m = 2 suffices log log to esure a costat load. Fially, we aalyze o-adaptive allocatio algorithms ad give tight upper ad lower bouds for their performace. 1. Itroductio The balls-ad-bis paradigm see, e.g., [11, 17]) describes the process where b balls are placed idepedetly ad uiformly at radom i bis. May variats of this classical occupacy problem were itesively studied, havig a wide rage of applicatios i Computer Sciece. It is well-kow that whe b = λ for λ fixed ad, the load of each bi teds to Poisso with mea λ ad the bis are asymptotically idepedet. I particular, for b =, the typical umber of empty bis at the ed of the process is 1/e + o1)). The typical maximal load i that case is 1 + o1)) log log log cf. [15]). I what follows, we say that a evet holds with high probability whp) if its probability teds to 1 as. Research of N. Alo was supported i part by a USA Israeli BSF grat, by a grat from the Israel Sciece Foudatio, by a ERC Advaced Grat ad by the Herma Mikowski Mierva Ceter for Geometry at Tel Aviv Uiversity. 1

2 NOGA ALON, ORI GUREL-GUREVICH, AND EYAL LUBETZKY The extesive study of this model i the cotext of load balacig was pioeered by the celebrated paper of Azar et. al. [3] see the survey [19]) that aalyzed the effect of a choice betwee k idepedet uiform bis o the maximal load, i a olie allocatio of balls to bis. It was show i [3] that the Greedy algorithm choose the least loaded bi of the k) is optimal ad achieves a maximal-load of log k log whp, compared to a log load of log log for the origial case k = 1. Thus, k = 2 radom choices already sigificatly reduce the maximal load, ad as k further icreases, the maximal load drops util it becomes costat at k = Ωlog ). I the cotext of olie bipartite matchigs, the process of dyamically matchig each cliet i a group A of size /2 with oe of k idepedet uiform resources i a group B of size precisely correspods to the above geeralizatio of the balls-ad-bis paradigm: Each ball has k optios for a bi, ad is assiged to oe of them by a olie algorithm that should avoid collisios o two balls ca share a bi). It is well kow that the threshold for achievig a perfect matchig i this case is k = log 2 : For k 1 + ε) log 2, whp every cliet ca be exclusively matched to a target resource, ad if k 1 ε) log 2 the Ω) requests caot be satisfied. I this work, we study the above models i the presece of a costrait o the memory that the olie algorithm has at its disposal. We fid that a tradeoff betwee the choice ad the memory govers the ability to achieve a perfect allocatio as well as a costat maximal load. Surprisigly, the threshold separatig the subcritical regime from the supercritical regime takes a simple form, i terms of the product of the umber of choices k, ad the size of the memory i bits m: If km the oe ca allocate 1 ε) balls i bis without ay collisios whp, ad cosequetly achieve a load of 2 for balls. If km the ay algorithm for allocatig ε balls whp creates Ω) collisios ad a ubouded maximal load. Roughly put, whe km the amout of choice ad memory at had suffices to guaratee a essetially best-possible performace. O the other had, whe km, the memory is too limited to eable the algorithm to make use of the extra choice it has, ad o substatial improvemet ca be gaied over the case k = 1, where o choice is offered whatsoever. Note that rigorous lower bouds for space, ad i particular tradeoffs betwee space ad performace time, commuicatio, etc.), have bee studied itesively i the literature of Algorithm Aalysis, ad are usually highly otrivial. See, e.g., [1, 4 6, 8, 9, 12, 13] for some otable examples. Our first mai result establishes the exact threshold of the choice-memory tradeoff for achievig a costat maximal-load. As metioed above, oe

CHOICE-MEMORY TRADEOFF IN ALLOCATIONS 3 ca verify that whe there is ulimited memory, the maximal load is whp uiformly bouded iff k = Ωlog ). Thus, assumig that k = Ωlog ) is a prerequisite for discussig the effect of limited memory o this threshold. Theorem 1. Cosider balls ad bis, where each ball has k = Ωlog ) uiform choices for bis, ad m = Ωlog 2 ) bits of memory are available. If km = Ω), oe ca achieve a maximal-load of O1) whp. Coversely, if km = o), ay algorithm whp creates a load that exceeds ay costat. Cosider the case k = Θlog ). The aïve algorithm for achievig a costat maximal-load i this settig requires roughly bits of memory 2 bits of memory always suffice; see Subsectio 1.3). Surprisigly, the above theorem implies that O/ log ) bits of memory already suffice, ad this is tight. As we later show, oe ca exted the upper boud o the load, give i Theorem 1, to O km ) useful whe km log log log ), whereas the lower boud teds to with km. This further demostrates how the quatity km govers the value of the optimal maximal load. Ideed, Theorem 1 will follow from Theorems 3 ad 4 below, which determie that the threshold for a perfect matchig is km = Θ). Agai cosider the case of k = Θlog ), where a olie algorithm with ulimited memory ca achieve a O1) load whp. While the above theorem settles the memory threshold for achievig a costat load i this case, oe ca ask what the optimal maximal load would be below the threshold. This is aswered by the ext theorem, which shows that i this case, e.g., m = 1 δ bits of memory yield o sigificat improvemet over a algorithm which makes radom allocatios. Theorem 2. Cosider /k balls ad bis, where each ball has k uiform choices for bis, ad m log bits of memory are available. The for ay log/m) algorithm, the maximal load is at least 1 + o1)) log log/m)+log k whp. I particular, if m = 1 δ for some δ > 0 fixed ad 2 k polylog), the the maximal load is Θ log log log ) whp. log Recall that a load of order log log is what oe would obtai usig a radom allocatio of balls i bis. The above theorem states that, whe m = 1 δ ad k polylog), ay algorithm would create such a load already after /k rouds. Before describig our other results, we ote that the lower bouds i our theorems i fact apply to a more geeral settig. I the origial model, i each roud the olie algorithm chooses oe of k uiformly chose bis, thus iducig a distributio o the locatio of the ext ball. Clearly, this distributio has the property that o bi has a probability larger tha k/.

4 NOGA ALON, ORI GUREL-GUREVICH, AND EYAL LUBETZKY Our theorems apply to a relaxatio of the model, where the algorithm is allowed to dyamically choose a distributio Q t for each roud t, which is required to satisfy the above property i.e., Q t k/). We refer to these distributios as strategies. Observe that ideed this model gives more power to the olie algorithm: For istace, if k = 2 ad the memory is ulimited), a algorithm i the relaxed model ca allocate /2 balls perfectly by assigig 0 probability to the occupied bis), whereas i the origial model collisios occur already with 2/3 w) balls whp, for ay w) tedig to with. Furthermore, we also relax the memory costrait o the model. Istead of treatig the algorithm as a automato with 2 m states, we oly impose the restrictio that there are at most 2 m differet strategies to choose from. I other words, at time t, the algorithm kows the etire history the exact locatio of each ball so far), ad eeds to choose oe of its 2 m strategies for the ext roud. I this sese, our lower bouds are for the case of limited commuicatio complexity rather tha limited space complexity. We ote that all our bouds remai valid whe each roud offers k choices with repetitios. 1.1. Tradeoff for perfect matchig. The ext two theorems address the threshold for achievig a perfect matchig whe allocatig 1 δ) balls i bis for some fixed 0 < δ < 1 ote that for δ = 0, eve with ulimited memory, oe eeds k = Ω) choices to avoid collisios whp). The upper ad lower bouds obtaied for this threshold are tight up to a multiplicative costat, ad agai pipoit its locatio at km = Θ). The costats below were chose to simplify the proofs ad could be optimized. Theorem 3. For δ > 0 fixed, cosider 1 δ) balls ad bis: Each ball has k uiform choices for bis, ad there are m log bits of memory. If km ε for some small costat ε > 0, the ay algorithm has Ω) collisios whp. Furthermore, the maximal load is whp Ωlog log km ). Theorem 4. For δ > 0 fixed, cosider 1 δ) balls ad bis, where each ball has k uiform choices for bis, ad m bits of memory are available. The followig holds for ay k 3/δ) log ad m log log 2 log. If km C for some C = Cδ) > 0, the a perfect allocatio o collisios) ca be achieved whp. I light of the above, for ay value of k, the olie allocatio algorithm give by Theorem 4 is optimal with respect to its memory requiremets.

CHOICE-MEMORY TRADEOFF IN ALLOCATIONS 5 1.2. No-adaptive algorithms. I the o-adaptive case the algorithm is agai allowed to choose a fixed possibly radomized) strategy for selectig the placemet of ball umber t i oe of the k possible radomly chose bis give i step t. Therefore, each such algorithm cosists of a sequece Q 1, Q 2,..., Q of pre-determied strategies, where Q t is the strategy for selectig the bi i step umber t. log log Here we show that eve if k = log, the maximum load is whp at least 1 o1)) log log log, that is, it is essetially as large as i the case k = 1. It is also possible to obtai tight bouds for larger values of k. We illustrate this by cosiderig the case k = Θ). Theorem 5. Cosider the problem of allocatig balls ito bis, where each ball has k uiform choices for bis, usig a o-adaptive algorithm. log log i) The maximum load i ay o-adaptive algorithm with k log is whp at least 1 o1)) log log log. ii) Fix 0 < α < 1. The maximum load i ay o-adaptive algorithm with k = α is whp Ω log ). This is tight, that is, there exists a o-adaptive algorithm with k = α so that the maximum load i it is O log ) whp. 1.3. Rage of parameters. I the above theorems ad throughout the paper, the parameter k may assume values up to. As for the memory, oe may aïvly use log 2 L bits to store the status of bis, each cotaiig at most L balls. The ext observatio shows that the log 2 L factor is redudat: Observatio. At most + b 1 bits of memory suffice to keep track of the umber of balls i each bi whe allocatig b balls i bis. Ideed, oe ca maitai the umber of balls i each bi usig a vector i {0, 1} +b 1, where 1-bits stad for separators betwee the bis. I light of this, the origial case of ulimited memory correspods to the case m = 2. 1.4. Mai techiques. The key argumet i the lower boud o the performace of the algorithm with limited memory is aalyzig the expected umber of ew collisios that a give step itroduces. We wish to estimate this value with a error probability smaller tha 2 m, so it would hold whp for all of the 2 m possible strategies for this step. To this ed, we apply a large deviatio iequality, which relates the sum of a sequece of depedet radom variables X i ) with the sum of their predictios Y i ), where Y i is the expectatio of X i give the history up to time i. Propositio 2.1 essetially shows that if the sum of the predictios Y i is large exceeds some l), the so is the sum of the actual radom variables X i, except with probability exp cl). I the applicatio, the variable X i

6 NOGA ALON, ORI GUREL-GUREVICH, AND EYAL LUBETZKY measures the umber of ew collisios itroduced by the i-th ball, ad Y i is determied by the strategy Q i ad the history so far. The key igrediet i provig this propositio is a Berstei-Kolmogorov type iequality for martigales, which appears i a paper of Freedma [14] from 1975, ad bouds the probability of deviatio of a martigale i terms of its cumulative variace. We reproduce its elegat proof for completeess. Crucially, that theorem does ot require a uiform boud o idividual variaces such as the oe that appears i stadard versios of Azuma- Hoeffdig), ad rather treats them as radom variables. Cosequetly, the quality of our estimate i Propositio 2.1 is uaffected by the umber of radom variables ivolved. For the upper bouds, the algorithm essetially partitios the bis ito blocks, where for differet blocks it maitais a accoutig of the occupied bis with varyig resolutio. Oce a block exceeds a certai threshold of occupied bis, it is discarded ad a ew block takes its place. 1.5. Orgaizatio. This paper is orgaized as follows. I Sectio 2 we prove the large deviatio iequality Propositio 2.1). Sectio 3 cotais the lower bouds o the collisios ad load, thus provig Theorem 3. Sectio 4 provides algorithms for achievig a perfect-matchig ad for achievig a costat load, respectively provig Theorem 4 ad completig the proof of Theorem 1. I Sectio 5 we exted the aalysis of the lower boud to prove Theorem 2. Sectio 6 discusses o-adaptive allocatios, ad cotais the proof of Theorem 5. Fially, Sectio 7 is devoted to cocludig remarks. Remark. The problem of balaced allocatios with limited memory was proposed to us by Itai Bejamii. I a recet idepedet work, Bejamii ad Makarychev [7] studied the special case of the problem for k = 2 i.e., whe there are two choices for bis at each roud). While our focus was maily the regime k = Ωlog ) where oe ca readily achieve a costat maximal load whe there is ulimited memory), our results also apply for smaller values of k. Namely, as a by-product we improve the lower boud of [7] by a factor of 2, as well as exted it from k = 2 to ay k polylog). 2. A large deviatio iequality This sectio cotais a large deviatio result, which will later be oe of the key igrediets i provig our lower bouds for the load. Our proof will rely o a Berstei-Kolmogorov type iequality of Freedma [14], which exteds the stadard Azuma-Hoeffdig martigale cocetratio iequality. Give a sequece of bouded possibly depedet) radom variables X i ) adapted to some filter F i ), oe ca cosider the sequece Y i ) where Y i = E [X i F i 1 ], which ca be viewed as predictios for the X i )-s. The followig propositio

CHOICE-MEMORY TRADEOFF IN ALLOCATIONS 7 essetially says that, if the sum of the predictios Y i is large, so is the sum of the actual variables X i. Propositio 2.1. Let X i ) be a sequece of radom variables adapted to the filter F i ) so that 0 X i M for all i, ad let Y i = E[X i F i 1 ]. The { i t P X i i t Y 1 1 2 ad } ) Y i h for some t exp h ) i 20M +2. i t Proof. As metioed above, the proof higes o a tail-iequality for sums of radom variables, which appears i the work of Freedma [14] from 1975 see also [20]), ad exteds such iequalities of Berstei ad Kolmogorov to the settig of martigales. See [14] ad the refereces therei for more backgroud o these iequalities, as well as [10] for similar martigale estimates. We iclude the short proof of Theorem 2.2 for completeess. Theorem 2.2 [14, Theorem 1.6]). Let S 0, S 1,...) be a martigale with respect to the filter F i ). Suppose that S i+1 S i M for all i, ad write V t = t i=1 VarS i F i 1 ). The for ay s, v > 0 we have [ s 2 ] P S S 0 + s, V v for some ) exp. 2v + Ms) Proof. Without loss of geerality, suppose S 0 = 0, ad put X i = S i S i 1. Re-scalig S by M, it clearly suffices to treat the case X i 1. Set V t = VarS i F i 1 ) = EXi 2 F i 1 ), j=1 j=1 ad for some λ > 0 to be specified later, defie ) Z t = exp λs t e λ 1 λ)v t. The ext calculatio will show that Z t ) is a super-martigale with respect to the filter F t ). First otice that the fuctio fz) = ez 1 z z 2 for z 0, f0) = 1 2 is mootoe icreasig as f z) > 0 for all z 0), ad i particular, fλz) fλ) for all z 1. Rearragig, ) expλz) 1 + λz + e λ 1 λ z 2 for all z 1. Now, sice X i 1 ad E[X i F i 1 ] = 0 for all i, it follows that ) E [expλx i ) F i 1 ] 1 + e λ 1 λ E [ Xi 2 ] F i 1 ) exp e λ 1 λ E [ Xi 2 ] ) F i 1.

8 NOGA ALON, ORI GUREL-GUREVICH, AND EYAL LUBETZKY By defiitio, this precisely says that E[Z i F i 1 ] Z i 1. That is, Z t ) is a super-martigale, ad hece by the Optioal Stoppig Theorem so is Z τ ), where is some iteger ad τ = mi{t : S t s}. I particular, EZ τ Z 0 = 1, ad oticig that V t+1 V t for all t) Markov s iequality ext implies that ) [ ] P S t s, V t v) exp λs + e λ 1 λ)v. t A choice of λ = log ) s+v v s ) [ P S t s, V t v) exp t s+v + 1 2 s s+v ) 2 therefore yields s s + v) log s + v v ad takig a limit over cocludes the proof. ) ] exp [ s2 2s + v) Remark. Note that Theorem 2.2 geeralizes the well-kow versio of the Azuma-Hoeffdig iequality, where each of the terms VarX i F i 1 ) is bouded by some costat σ 2 i cf., e.g., [18]). We ow wish to ifer Propositio 2.1 from Theorem 2.2. To this ed, defie Z t = Y i X i, V t = VarZ i F i 1 ), i=1 ad observe that Z t ) is a martigale by the defiitio Y i = E[X i F i 1 ]. Moreover, as the X i -s are uiformly bouded, so are the icremets of Z t : i=1 Z i Z i 1 = Y i X i M. Furthermore, crucially, the variaces of the icremets are bouded as well i terms of the coditioal expectatios: Var Y i X i F i 1 ) = Var X i F i 1 ) M E [X i F i 1 ] = M Y i, givig that V t M t i=1 Y i. Fially, for ay iteger j 1 let A j deote the evet { A j = X i 1 2 Y i ad jh } Y i j + 1)h i t i t i t ) for some t. Note that the evet A j implies that Z t jh/2. Hece, applyig Theorem 2.2 to the martigale Z t ) alog with its cumulative variaces V t ) we ow get ) [ PA j ) P Z t j 2 h, V j ] 2 t j + 1)hM exp h)2 2 j + 1)hM + M j 2 [ h)) j 2 ] = exp 43j + 2) h/m) exp h ) 20M j. ],

CHOICE-MEMORY TRADEOFF IN ALLOCATIONS 9 Summig over the values of j, we obtai that if h 20M the P j 1 A j ) e e 1 exp h ) exp h ) 20M 20M j + 1, while for h 20M the above iequality holds trivially. Hece, for all h > 0, { P t : X i 1 2 Y i ad Y i h} ) exp h ) 20M + 1. 2.1) i t i t i t To complete the proof of the propositio, we repeat the above aalysis for Z t = Z t = i=1 X i Y i, V t = VarZ i F i 1 ) = V t. Clearly, we agai have Z i Z i 1 M ad V t M t i=1 Y i. Defiig { } ) A j = Y i 2 3 Y i j + 1)h for some t i t i t X i ad jh i t i=1 it follows that the evet A j implies that Z t 1 2 before, we have that ) PA j) P Z t j 2 h, V t j + 1)hM ad thus for all h > 0 { P t : Y i 2 3 X i ad i t i t i t i Y i jh/2. Therefore, as exp Y i h} ) exp h ) 20M j, h ) 20M + 1. 2.2) Summig the probabilities i 2.1) ad 2.2) yields the desired result. We ote that essetially the same proof yields the followig geeralizatio of Propositio 2.1. As before, the costats ca be optimized. Propositio 2.3. Let X i ) ad Y i ) be as give i Propositio 2.1. The for ay 0 < ε 1 2, { i t P X i i t Y 1 ε ad } ) Y i h for some t exp hε2 ) i 5M + 2. i t Remark 2.4. The statemets of Propositio 2.1 ad Propositio 2.3 hold also i cojuctio with ay stoppig time τ adapted to the filter F i ). That is, we get the same boud o the probability of the metioed evet happeig at ay time t < τ. This follows easily, for istace, by alterig the sequece of icremets to be idetically 0 after τ. Such statemets become useful whe the uiform boud o the icremets is oly valid before τ.,

10 NOGA ALON, ORI GUREL-GUREVICH, AND EYAL LUBETZKY 3. Lower bouds o the collisios ad load I this sectio we prove Theorem 3 as well as the lower boud i Theorem 1, by showig that if the quatity km/ is suitably small, the ay allocatio would ecessarily produce early liearly may bis with arbitrarily large load. The mai igrediet i the proof is a boud for the umber of collisios, i.e., pairs of balls that share a bi, defied ext. Let N t i) deote the umber of balls i bi i after performig t rouds; the umber of collisios at time t is the ) Col 2 t) = Nt i). 2 i=1 The followig theorem provides a lower boud o Col 2 t) for t c km for some absolute c > 0. Theorem 3.1. Cosider balls ad bis, where each ball has k uiform choices for bis, ad m log bits of memory are available. i) For all t 500 km we have E Col 2 t) t 2 /9). ii) Furthermore, with probability 1 O 4 ), for all L = L) ad ay t 500km 30 L log ), either the maximal load is at least L or Col 2 t) t 2 /16). Note that the mai statemet of Theorem 3 immediately follows from the above theorem, by choosig t = 1 δ) ad L =. Ideed, recallig the assumptio i Theorem 3 that m log, we obtai that, except with probability O 4 ), either the algorithm creates a load of, or it has Col 2 ) 1 δ)2 16. Observig that a load of L immediately iduces ) L 2 collisios, we deduce that either way there are at least Ω) collisios whp. We ext prove Theorem 3.1; the statemet of Theorem 3 o ubouded maximal load will follow from a iterative applicatio of a more geeral form of this theorem amely, Theorem 3.4), which appears i Subsectio 3.1. Proof of Theorem 3.1. As oted i the Itroductio, we relax the model by allowig the algorithm to choose ay distributio µ = µ1),..., µ)) for the locatio of the ext ball, as log as it satisfies µ k/. We also relax the memory costrait as follows. The algorithm has a pool of at most 2 m differet strategies, ad may choose ay of them at a give step without ay restrictio basig its dyamic decisio o the etire history). To summarize, the algorithm has a pool of at most 2 m strategies, all of which have a L -orm of at most k/. I each give roud, it adaptively

CHOICE-MEMORY TRADEOFF IN ALLOCATIONS 11 chooses a strategy µ from this pool based o the etire history, ad a ball the falls to a bi distributed accordig to µ. The outlie of the proof is as follows: cosider the sequece Q 1,..., Q, chose adaptively out of the pool of 2 m of strategies. The large deviatio iequality of Sectio 2 Propositio 2.1) will eable us to show the followig: The expected umber of collisios ecoutered i the above process is well approximated by the expected umber of collisios betwee idepedet balls, placed accordig to Q 1,..., Q i.e., equivalet to the result of the o-adaptive algorithm with strategies Q 1,..., Q ). Havig reduced the problem to the aalysis of a o-adaptive algorithm, we may the derive a lower boud o E Col 2 t) by aalyzig the structure of the above strategies. This boud is the traslated to a boud o Col 2 t) usig aother applicatio of the large deviatio iequality of Propositio 2.1. Let ν = ν1),..., ν)) be a arbitrary probability distributio o [] satisfyig ν k/, ad deote by Q s = Q s 1),..., Q s )) the strategy of the algorithm at time s. It will be coveiet from time to time to treat these distributios as vectors i R. By the above discussio, Q s is a radom variable whose values belog to some a-priori set {µ 1,..., µ 2 m}. We further let J s deote the actual positio of the ball at time s draw accordig to the distributio Q s ). Give the strategy at time s, let x s deote the probability of a collisio betwee ν ad Q s give J s, i.e., that the ball that is distributed accordig to ν will collide with the oe that arrived i time s. We let v s be the ier product of Q s ad ν, which measures the expectatio of these collisios. x ν s v ν s = νj s ), = Q s, ν = Q s i)νi) = E[x ν s F s 1 ]. Further defie the cumulative sums of v ν s ad x ν s as follows: i=1 X ν t V ν t = = x ν s, vs ν. To motivate these defiitios, otice that give the history up to time s 1 ad ay possible strategy for the ext roud, ν, we have s 1 Xs 1 ν = νj i ) = i=1 νi) {r < s : J r = i} = i=1 νi)n s 1 i), i=1

12 NOGA ALON, ORI GUREL-GUREVICH, AND EYAL LUBETZKY ad so X Q s s 1 is the expected umber of collisios that will be cotributed by the ball J s Q s give the etire history F s 1. Summig over s, we have that [ ] E Col 2 t) = E X Qs s 1, thus estimatig the quatities X Qs s 1 will provide a boud o the expected umber of collisios. Our aim i the ext lemma is to show that whp, wheever V Q s s 1 is large, so is XQ s s 1. This will reduce the problem to the aalysis of the quatities V Q s s 1, which are determiistic fuctios of Q 1,..., Q. This is the mai coceptual igrediet i the lower boud, ad its proof will follow directly from the large deviatio estimate give i Propositio 2.1. Lemma 3.2. Let Q 1,..., Q be a sequece of strategies adapted to the filter F i ), ad let Xs ν ad Vs ν be defied as above. The with probability at least 1 Oe 4m ), for every ν {µ 1..., µ 2 m} ad every s we have that Vs ν 100 ν m implies Xs ν Vs ν /2. Proof. Before describig the proof, we wish to emphasize a delicate poit. The lemma holds for ay sequece of strategies Q 1, Q 2,..., Q each Q i is a arbitrary fuctio of F i 1 ). No restrictios are made here o the way each such Q i is produced e.g., it does ot eve eed to belog to the pool of 2 m strategies), as log as it satisfies Q i k/. The reaso that such a geeral statemet is possible is the followig: Oce we specify how each Q i is determied from F i 1 this ca ivolve extra radom bits, i case the adaptive algorithm is radomized), the process of exposig the positios of the balls, J i Q i, defies a martigale. Hece, for each fixed ν, we would be able to show that the desired evet occurs except with probability Oe 5m ). A uio boud over the strategies ν which, crucially, do belog to the pool of size 2 m ) will the complete the proof. Fix a strategy ν out of the pool of 2 m possible strategies, ad recall the defiitios of x ν s ad v ν s, accordig to which 0 x ν s ν, v ν s = E[x ν s F s 1 ]. By applyig Propositio 2.1 to the sequece x ν s) with the cumulative sums Xs ν ad cumulative coditioal expectatios Vs ν ), we obtai that for all h, PXs ν Vs ν /2, Vs ν h for some s) exp h ) + 2. 20 ν Thus, takig h = 100 ν m we obtai that PX ν s V ν s /2, V ν s 100 ν m for some s) exp 5m + 2). Summig over the pool of at most 2 m predetermied strategies ν completes the proof.

CHOICE-MEMORY TRADEOFF IN ALLOCATIONS 13 Havig show that Xt ν are iterested i estimatig X Q s s 1 values of V Q s s 1. is well approximated by Vt ν, ad recallig that we, we ow tur our attetio to the possible Claim 3.3. For ay sequece of strategies Q 1,..., Q t we have that V Q tt k) s s 1. 2 Proof. By our defiitios, for the strategies Q 1,..., Q t we have s 1 V Q s s 1 = Q r, Q s = Q r i)q s i) = 1 2 r=1 i=1 r<s t [ ) 2 ] Q s i) Q s i) 2. 3.1) i=1 Recallig the defiitio of the strategies Q i, we have that { 0 Qs i) k/ for all i ad s, i=1 Q si) = 1 for all s. Therefore, i=1 Q s i) 2 k i=1 O the other had, by Cauchy-Schwartz, ) 2 1 Q s i) i=1 i=1 Q s i) = kt. 2 t Q s i)) 2 =. Pluggig these two estimates i 3.1) we deduce that tt k) V Qs s 1, 2 as required. While the above claim tells us that the average size of V Qs s 1 is fairly large has order at least t k)/), we wish to obtai bouds correspodig to idividual distributios Q s. As we ext show, this sum ideed ejoys a sigificat cotributio from idices s where V Q s s 1 = Ωkm/). More precisely, settig h = 100km/, we claim that for large eough, V Q s s 1 1 t2 {V Qs s 1 >h} 4. 3.2) To see this, observe that if t t 0 = 5h = 500km,

14 NOGA ALON, ORI GUREL-GUREVICH, AND EYAL LUBETZKY the V Q s s 1 1 {V Qs s 1 t2 t h h} 5. Combiig this with Claim 3.3 while otig that tt k) 2 = 1 o1)) t2 2 ) yields 3.2) for ay sufficietly large. We may ow apply Lemma 3.2, ad obtai that, except with probability Oe 4m ), wheever V Q s s 1 > h we have XQ s s 1 1 2 V Q s s 1, ad so X Qs s 1 1 2 V Qs s 1 1 t2 {V Q s s 1 >h} Altogether, sice X Q s s 1 0, we ifer that 8 for all t t 0. 3.3) [ ] E Col 2 t) = E X Q s s 1 t2 1 O 4 ) ) t2 8 9 for all t t 0, 3.4) where the last iequality holds for large eough. This proves Part i) of Theorem 3.1. It remais to establish cocetratio for Col 2 t) uder the additioal assumptio that t 30 L log for some L = L). First, set the followig stoppig-time for reachig a maximal-load of L: Next, recall that ad otice that τ L = mi { Col 2 t) = E[N s 1 J s ) F s 1 ] = t : max j } N t j) L. N s 1 J s ), i=1 Q s i)n s 1 i) = X Qs s 1. Therefore, we may apply our large deviatio estimate give i Sectio 2 Propositio 2.1), combied with the stoppig-time τ L see Remark 2.4): The sequece of icremets is N s 1 J s )). The sequece of coditioal expectatios is X Q s s 1 ). The boud o the icremets is L, as N s 1 J s ) max i N s 1 i) L for all s < τ L.

It follows that P { Col 2 t) 1 2 CHOICE-MEMORY TRADEOFF IN ALLOCATIONS 15 s t X Qs s 1 ad X Qs s 1 t2 } ) for some t < τ L 8 s t exp t2 /8 ) 20L + 2 O 5 ), where the last iequality is by the assumptio t 30 L log. Fially, by 3.3), we also have that s t XQ s s 1 t2 /8) for all t t 0, except with probability O 4 ). Combiig these two statemets, we deduce that for ay t t 0 30 L log ), P Col 2 t) < t2 ) 16, τ L > t = O 4), cocludig the proof of Theorem 3.1. 3.1. Boostig the subcritical regime to ubouded maximal load. While Theorem 3.1 give above provides a careful aalysis for the umber of 2-collisios, i.e., pairs of balls sharig a bi, oe ca iteratively apply this theorem, with very few modificatios, i order to obtai that the umber of q-collisios a set of q balls sharig a bi) has order Ω 1 o1) ) whp. The proof of this result higes o Theorem 3.4 below, which is a geeralizatio of Theorem 3.1. Recall that i the relaxed model studied so far, at ay give time t the algorithm adaptively selects a strategy Q t based o the etire history F t 1 ), after which a ball is positioed i a bi J t Q t. We ow itroduce a extra set of radom variables, i the form of a sequece of icreasig subsets, A 1... A []. The set A t is determied by F t 1, ad has the followig effect: If J t A t, we add a ball to this bi as usual, whereas if J t / A t, we igore this ball all bis remai uchaged). That is, the umber of balls i bi i at time t is ow give by N t i) = 1 {Js=i}1 As i), ad as before we are iterested i a lower boud for the umber of collisios: ) Col 2 t) = Nt i). 2 i=1 The idea here is that, i the applicatio, the set A t will cosists of the bis that already cotai l balls at time t. As such, they ideed form a icreasig sequece of subsets determied by F i ). I this case, ay collisio correspods to 2 balls placed i some bi which already has l other balls, ad thus immediately implies a load of l + 2.

16 NOGA ALON, ORI GUREL-GUREVICH, AND EYAL LUBETZKY Theorem 3.4. Cosider the followig balls ad bis settig: 1) The olie adaptive algorithm has a pool of 2 m possible strategies, where each strategy µ satisfies µ k/. The algorithm selects a radom) sequece of strategies Q 1,..., Q adapted to the filter F i ). 2) Let A 1... A [] deote a radom icreasig sequece of subsets adapted to the filter F i ), i.e., A i is determied by F i 1. 3) There are rouds, where i roud t a ew potetial locatio for a ball is chose accordig to Q t. If this locatio belogs to A t, a ball is positioed there otherwise, othig happes). Defie T = Q sa s ). The for ay L = L), P T 30 km L log ), Col 2 ) < T 2 16, max j ) N j) L O 4 ). Proof. As the proof follows the same argumets of Theorem 3.1, we restrict our attetio to describig the modificatios that are required for the ew statemet to hold. Defie the followig sub-distributio of Q s with respect to A s : Q s = Q s 1 As. As before, give Q s, the strategy at time s, defie the followig parameters: x ν s = νj s ), vs ν = Q si)νi), i=1 ad let the cumulative sums of v ν s ad x ν s be deoted by: X ν t = x ν s, V ν t = vs ν. We claim that a statemet aalogous to that of Lemma 3.2 holds as is with respect to the above defiitios, for ay choice of icreasig subsets A 1... A adapted to the filter F i )). As we soo argue, the martigale cocetratio argumet is valid without ay chages, ad the oly delicate poit is the idetity of the target strategy ν. Lemma 3.5. Let Q 1,..., Q ad A 1... A be strategies ad subsets resp., adapted to the filter F i ), ad let Xs ν ad Vs ν be defied as above. The with probability at least 1 Oe 4m ), for every ν {µ 1..., µ 2 m} ad every s we have that Vs ν 100 ν m implies Xs ν Vs ν /2, where ν = ν1 As+1. Proof. Let ν be a strategy. Previously i the proof of Lemma 3.2), we compared Xs ν to Vs ν usig the large deviatio iequality of Sectio 2. Now, for each s, our desigated ν is a fuctio of ν ad A s+1, ad hece depeds o F s. I particular, there are potetially more tha 2 m differet strategies

CHOICE-MEMORY TRADEOFF IN ALLOCATIONS 17 to cosider as ν, destroyig our uio boud! The crucial observatio that resolves this issue is the followig: Observatio 3.6. Let r > s ad let ν be a strategy. The Vs ν = Vs ν Xs ν = Xs ν for ay icreasig sequece A 1,..., A r, where ν = ν1 Ar. To see this, first cosider Xs ν ad Xs ν. If x ν i for some 1 i s had a o-zero cotributio to Xs ν, the by defiitio J i A i. Sice A i A r, we also have J i A r, ad so x ν i = νj i )1 Ar J i ) = x ν i ow follows from the fact that V ν s ν. The statemet Vs is the sum of vi ν = E[xν i F i 1]. ad = V ν s Usig the above observatio, it ow suffices to prove the statemet of Lemma 3.5 directly o the strategies ν rather tha o ν ). Hece, the oly differece betwee this settig ad that of Lemma 3.2 is that here some of the rouds are forfeited as reflected i the ew defiitio of the vs ν s). The proof of Lemma 3.2 therefore holds uchaged for this case. Similarly, the followig claim is the aalogue of Claim 3.3, with t the umber of balls i the origial versio) replaced by T = s i Q si) the expected umber of balls actually positioed). Claim 3.7. For ay Q 1,..., Q ad A 1... A we have that T T k) V Q s s 1 2 The proof of the above claim follows from the exact same argumet as i Claim 3.3: Notice that the boud there, give as a fuctio of t, was actually a boud i terms of t i Q si), ad so replacig Q s by Q s yields the desired boud as a fuctio of T. With this i mid, set h = 100km/ ad ote that, clearly, Therefore, if the V Q s s 1 1 {V Q s s 1. h} h. t 0 = 5h 25 km, h T 2 5 for ay T t 0, ad so for such T ad ay large eough V Q s s 1 1 T 2 {V Q s s 1 >h} 4.

18 NOGA ALON, ORI GUREL-GUREVICH, AND EYAL LUBETZKY By followig the ext argumets from the proof of Theorem 3.1, it ow follows that, as log as T t 0, [ E Col 2 ) = E X Q s s 1 ] T 2 8 1 O 4 ) ) T 2 9. Similarly, usig the argumet as i the proof of Theorem 3.1, which defies the stoppig-time τ L ad applies Propositio 2.1 o the sequece of icremets give by Col 2 t) Col 2 t 1) = N s 1 J s )1 As J s ), we deduce that, if T t 0 30 L log ) the as required. P Col 2 ) < T 2 ) 16, τ L > = O 4), We ext show how to ifer the results regardig a ubouded maximal load from Theorem 3.4. For each iteger l = 0, 1, 2,..., we defie the icreasig sequece A t ) by: Further defie A l t = {i [] : N t i) l}. T l = Q s A l s), which is the expected umber of balls that are placed i bis which already hold at least l balls. The proof will follow from a iductive argumet, which bouds the value of T l+1 i terms of T l. For some L = L) to be specified later, our bouds will be meaigful as log as the maximal load is at most L, ad T l 30 km L log ). 3.5) Usig Theorem 3.4, we will show that, if 3.5) holds the To this ed, defie R l = T l+1 T 2 l 20L. 3.6) ) N i) l, 2 i=1 that is, R l deotes the umber of collisios betwee all pairs of balls that were placed i a bi, that already held at least l balls.

CHOICE-MEMORY TRADEOFF IN ALLOCATIONS 19 To ifer 3.6), apply Theorem 3.4 with respect to the subsets A l s). The assumptio 3.5) implies that, except with probability O 4 ), either the load is at least L, or R l T 2 l 16. Notice that ay ball that is placed i a bi, which cotais at most L balls, ca cotribute at most L collisios to the cout of R l. Therefore, if the maximal load is less tha L, the followig holds: The umber of balls placed i bis that already cotai at least l balls, is at least R l /L T 2 l 16L, with probability 1 O 4 ). 3.7) Recallig that T l+1 is the expected umber of such balls, we ifer that T l+1 1 O 4)) R l L T 2 l 20L, where the last iequality holds for large eough with room to spare). This establishes that 3.5) implies 3.6). Sice by defiitio T 0 =, we deduce that the decreasig series T 0, T 1,...) satisfies T l+1 20L) 2l+1 1 if T l satisfies 3.5). Rearragig, it follows that, i particular, 3.5) is satisfied if 30 20L) 2l 1 km It is ow easy to verify that, for ay fixed ε > 0, choosig ) L = l = 1 ε) log 2 log km L log. 3.8) satisfies 3.8) for large eough. By 3.7), we ca the ifer that R l > 0 with probability 1 O 4 ), hece the maximal load is at least l. This cocludes the proof of Theorem 3. 4. Algorithms for perfect matchig ad costat load I this sectio, we prove Theorem 4 by providig a algorithm that avoids collisios whp usig oly O/k) bits of memory, which is the miimum possible by Theorem 3. The case km = Ω) of Theorem 1 will the follow from repeated applicatios of this algorithm.

20 NOGA ALON, ORI GUREL-GUREVICH, AND EYAL LUBETZKY Perfect allocatio algorithm for 1 δ) balls 1. For l = m/2, partitio the bis ito cotiguous blocks B 1,..., B l each comprisig m/2 bis. Igore ay remaiig uused bis. 2. Set d = log 5 2 Cδ log ), ad defie the arrays A 0,..., A d 1 : A j comprises 2 j cotiguous blocks a total of 2 j 1 m bis). For each cotiguous o-overlappig) 4 j -tuple of bis i A j, we keep a sigle bit that holds whether ay of its bis is occupied. All blocks curretly or previously used are cotiguous. 3. Repeat the followig procedure util exhaustig all rouds: Let j be the miimal iteger so that a bi of A j, marked as empty, appears i the curret selectio of k bis. If o such j exists, the algorithm aouces failure. Allocate the ball ito this bi, ad mark its 4 j -tuple as occupied. If the fractio of empty 4 j -tuples remaiig i A j just dropped below δ/2, relocate the array A j to a fresh cotiguous set of empty 2 j blocks immediately beyod the last allocated block). If there are less tha 2 j available ew blocks, the algorithm fails. 4. Oce 1 δ) rouds are performed, the algorithm stops. We proceed to verify the validity of the algorithm i stages: First, we discuss a more basic versio of the algorithm suited for the case where km = Ω log ); the, we examie a itermediate versio which exteds the rage of the parameters to km log m = Ω log ); fially, we study the actual algorithm, which features the tight requiremet km = Ω). Throughout the proof of the algorithm, assume that i each roud we are preseted with k idepedet uiform idices of bis, possibly with repetitios. Clearly, a upper boud for the maximal load i this relaxed model traslates ito oe for the origial model k choices without repetitios). 4.1. Basic versio of the algorithm. We begi with a descriptio ad a proof of a simpler versio of the above algorithm, suited for the case where km 3/δ) log. 4.1) This versio will serve as the base for the aalysis. For simplicity, assume first that m.

CHOICE-MEMORY TRADEOFF IN ALLOCATIONS 21 Basic versio of allocatio algorithm for 1 δ) balls 1. Let B 1,..., B l be a arbitrary partitio of the bis ito l = /m blocks, each cotaiig m bis. Put r = 1 δ)m. 2. Throughout stage j [l], oly the m bis belogig to B j are tracked. At the begiig of the stage, all bis i the block are marked empty. 3. Stage j comprises r rouds, i each of which: The algorithm attempts to place a ball i a arbitrary empty bi of B j if possible. If o empty bi of B j is offered, the algorithm declares failure. 4. Oce 1 δ) rouds are performed, the algorithm stops. To verify that this algorithm ideed produces a perfect allocatio whp, examie a specific roud of stage j, ad coditio o the evet that so far the algorithm did ot fail. I particular, its accoutig of which bis are occupied i B j is accurate, ad at least m r = δ o1))m bis i B j are still empty otice that by our assumptio m = Ωlog ), ad so m with ). Let Miss j deote the evet that the ext ball precludes all of the empty bis of B j i its k choices, we have PMiss j ) 1 m r ) k e δ o1)) km 3+o1), 4.2) by assumptio 4.1). A uio boud over the rouds ow yields with room to spare) that the algorithm succeeds whp. The case where m does ot divide is treated similarly: Set l = m/2, ad partitio the bis ito blocks that ow hold m/2 bis each, except for the fial block B l which would have betwee m/2 ad m 1 bis. As before, i stage j we attempt to allocate 1 δ) B j balls ito B j, while relyig o the property that B j has at least δ o1)) B j δ o1))m/2 empty bis. This gives as required. km/2 δ o1)) PMiss j ) e 3/2+o1), 4.2. Itermediate versio of the algorithm. We ow wish to adapt the above algorithm to the followig case: km log 2 m 20/δ) log5/δ) log, log 3 m log. 4.3) Notice that if m ε, the above requiremet is essetially that km = Ω/ε).

22 NOGA ALON, ORI GUREL-GUREVICH, AND EYAL LUBETZKY The full versio of the algorithm will elimiate this depedecy o ε. Itermediate versio of allocatio algorithm for 1 δ) balls 1. For l = m/2, partitio the bis ito cotiguous blocks B 1,..., B l each comprisig m/2 bis. Igore ay remaiig uused bis. 2. Set d = 1 4 log 2 m, ad defie the arrays A 0,..., A d 1 : A j is oe of the blocks B 1,..., B l. For each cotiguous o-overlappig) 2 j -tuple of bis i A j, we keep a sigle bit that holds whether ay of its bis is occupied. 3. Repeat the followig procedure util exhaustig all rouds: Let j be the miimal iteger so that a bi of A j, marked as empty, appears i the curret selectio of k bis. If o such j exists, the algorithm aouces failure. Allocate the ball ito this bi, ad mark its 2 j -tuple as occupied. If the fractio of empty 2 j -tuples remaiig i A j just dropped below δ/2, relocate the array A j to a fresh block immediately beyod the last allocated block). If o such block is foud, the algorithm fails. 4. Oce 1 δ) rouds are performed, the algorithm stops. Sice the array A j cotais 2 j m/2) differet 2 j -tuples, the amout of memory required to maitai the status of all tuples is m 2 d 1 2 j = 1 2 d )m m m 3/4. j=0 I additio, we keep a idex for each A j, holdig its positio amog the l blocks. By defiitio of d ad l, this amouts to at most d log 2 l log 2 ) 2 < m 3/4 bits of memory, where the last iequality holds for ay large by 4.3). We first show that the algorithm does ot fail to fid a bi of A j marked as empty. At ay give poit, each A j has a fractio of at least δ/2 bis marked as empty. Hece, recallig 4.2), the probability of missig all the bis marked as empty i A 0,..., A d 1 is at most exp [ δ 2 o1) ) km 2 d ] exp [ δ ) 10 log 20 2 o1) δ log 2 m log δ ) 1 4 log 2 m] log5/δ)5/4 o1) < 5/4, 4.4) where the last iequality holds for large. Therefore, whp the algorithm ever fails to fid a array A j with a empty bi amog the k choices.

CHOICE-MEMORY TRADEOFF IN ALLOCATIONS 23 It remais to show that, wheever the algorithm relocates a array A j, there is always a fresh block available. By the above aalysis, the probability that a ball is allocated i A j for j 1 at a give roud is at most exp [ δ 2 o1) ) km/2 j ] exp [ δ ) 10 log 20 ) ] 2 o1) δ log 2 m log j δ exp 3 log5/δ)j) = p j, where the last iequality holds for ay sufficietly large. Let N j deote the umber of balls that were allocated i blocks of type j throughout the ru of the algorithm. Clearly, N j is stochastically domiated by a biomial radom variable Bi, p j ). Hece, kow estimates for the biomial distributio see, e.g., [2]) imply that for all j, PN j > p j + C log ) C. The total umber of blocks eeded for A j is at most 2 j N j 1 δ 2 ) m, 2 ad hece the total umber of blocks eeded is whp at most d 1 2 j 1 δ)p j + C2 j log d 1 2 j 1 δ)p j 3/4 log ) 1 δ 2 ) m 2 1 δ 2 ) m + O. m 2 j=0 Sice d 1 d 1 ) 2 j p j = exp jlog 2 3 log5/δ)) < 2 2δ/5) 3 < δ/5 j=1 j=1 with room to spare), the total umber of blocks eeded is whp at most 1 + δ/5)1 δ) 3/4 log ) 1 δ 2 ) m + O < = l m m/2 2 for ay sufficietly large. 4.3. Fial versio of the algorithm. The mai disadvatage i the itermediate versio of the algorithm is that the size of each A j was fixed at m/2 bis. Sice the resolutio of each A j is i 2 j -tuples, we are limited to at most log 2 m arrays. However, the probability of missig all the arrays A 0,..., A d 1 has to compete with, hece the requiremet that m would be polyomial i. To remedy this, the algorithm uses arrays with icreasig sizes, amely 2 j blocks for A j. The resolutio of each array is ow i 4 j -tuples, i.e., trackig the status of A j ow requires at most 2 j m/2 /4 j m/2 j+1 bits. Recallig j=0

24 NOGA ALON, ORI GUREL-GUREVICH, AND EYAL LUBETZKY that d = log 5 2 Cδ log ), the umber of memory bits required for all arrays is at most m 2 d 1 2 j = 1 2 d )m m Om/ log ). 4.5) j=0 The followig calculatio shows that ideed there are sufficietly may blocks to iitially accommodate all the arrays: 2 d 1) m/2 5 5km m log 2Cδ 6C = 5 6, where we used the assumptios k 3/δ) log ad km = C. Each of the arrays comes alog with a poiter to its startig block, ad the total umber of memory bits required for this is at most d log 2 2/m) log 2 log + O1)) log 2 = 1 + o1)) log 2 log 2 log. Whe m = Ωlog 3 ), the space for these poiters clearly fits amog the Om/ log ) bits remaiig accordig to 4.5). For smaller values of m, as before we ca apply the algorithm for, say, m = m/3 after triplig the costat C δ to reflect this chage), thus earig 2m/3 bits for the poiters recall the requiremet that m log 2 log log 2 ). As fial evidece that the choice of parameters for the algorithm is valid, ote that each A j ideed cotais may 4 j -tuples. It suffices to check A d 1, which ideed comprises about 1 + o1)) m 2 d 1 Cδ ) m 2 4 d 1 = 1 + o1))m/2d = 5 + o1) = Ωlog log ) log 4 d 1 -tuples, where the last equality is by the assumptio o the order of m. It remais to verify that the algorithm succeeds whp. This will follow from the same argumet as i the itermediate versio of the algorithm. I that versio, each A j cotaied at least a fractio of δ/2) empty bis, ad A j was about m/2 for all j. I the fial versio of the algorithm, each A j agai cotais at least a fractio of δ/2) empty bis, but crucially, ow A j cotais 2 j bis. Thus, recallig 4.4), the probability to miss A 0,..., A d 1 i a give roud is ow at most [ δ ) km exp 2 o1) d 1 2 j] exp 1 o1)) Cδ ) 2 4 2d 1) j=0 = 5/4 o1), where the last iequality is by the defiitio of d. A uio boud over the rouds gives that, whp, a array A j with a empty bi is foud for every ball.

CHOICE-MEMORY TRADEOFF IN ALLOCATIONS 25 To see that whp there are always sufficietly may available fresh blocks to relocate a array, oe essetially repeats the argumet from the itermediate versio of the algorithm. That is, we agai examie the probability that a ball is allocated i A j, to obtai that this time p j = exp 1 o1)) Cδ ) 4 2j 1). A choice of C K1/δ) log1/δ) with some suitably large K > 0 would give d 1 4 j p j < δ/5, j=1 ad the rest of that argumet uchaged ow implies that the algorithm ever rus out of fresh blocks whp. This completes the proof of Theorem 4. 4.4. Proof of upper boud i Theorem 1. We ow wish to apply the algorithm from Theorem 4 i order to obtai a costat load i the case where km c for some c > 0. To achieve this, cosider the perfect matchig algorithm for, say, δ = 1 2, ad let C δ be the costat that appears i Theorem 4. Next, joi every cosecutive C δ /c -tuple of bis together ad write for the umber of such tuples. As km C, we may apply the perfect-matchig algorithm for /2 balls with respect to the tuples of bis, keepig i mid that the algorithm is valid also for the model of repetitios. This gives a perfect matchig whp, ad repeatig this process gives a total load of at most 2C δ /c = O1) for all balls. 5. Improved lower bouds for poly-logarithmic choices 5.1. Proof of Theorem 2. Our proof of this case is a extesio of the proof of Theorem 3. We ow wish to estimate the umber of q-collisios for geeral q: ) Col q t) = Nt i). q i=1 The aalysis higes o a recursio o q, for which we eed to achieve bouds o a geeralized quatity, a liear fuctio of the q-collisios vector: X f;q t = fi)1 {Js1 =i} 1 {Jsq =i} = ) Nt i) fi), 5.1) q s 1 <...<s q t i i = fi)q s1 i) Q sq i). 5.2) V f;q t s 1 <...<s q t i Our objective is to obtai lower bouds for X f;q t with f 1, as clearly Col q t) = X 1;q t. Notice that the parameters Xt ν, Vt ν from Sectio 3 are

26 NOGA ALON, ORI GUREL-GUREVICH, AND EYAL LUBETZKY exactly X ν;1 t, V ν;1 t defied above. There, ν was a strategy, whereas ow our f will be the product of differet strategies. This fact will allow us -s ad a approximate recursio for the X f;q t. We achieve this usig the ext lemma, where here i ad throughout the proof we let to formulate a recursio relatio betwee the V f;q t L = log/m) 5.3) deote a maximal load we do ot expect to reach except if the algorithm is far from optimal). We further defie { Γ = L } i=1 f i : f i {1, µ 1,..., µ 2 m} for all i to be the set of all poit-wise products of at most L strategies from the pool. Lemma 5.1. Either the maximal load exceeds L, or the followig holds for all q < L, every t /k ad every f Γ, except with probability e 3mL. If V f;q t 100 3L)q+1 m f the X f;q t 3 q V f;q t. 5.4) q! Proof. The key property of the quatities V f;q t, which justified the iclusio of the ier products with f, is the followig recursio relatio, whose validity readily follows from defiitio 5.2): V f;q+1 t = s<t V Q s+1 f);q s for ay q 1 ad ay t. 5.5) We ow wish to write a similar recursio for the variables X f;q t. As opposed to the variables V f;q t, which satisfied the above recursio combiatorially, here the recursio will oly be stochastic. Notice that ) )) X f;q+1 t+1 X f;q+1 Nt J t+1 ) + 1 Nt J t+1 ) t = fj t+1 ) q + 1 q + 1 ) Nt J t+1 ) = fj t+1 ), q ad hece [ ] E X f;q+1 t+1 X f;q+1 t F t = ) Nt i) Q t+1 i)fi) = X Q t+1 f);q t. q i We may therefore apply Propositio 2.1 as follows: The sequece of icremets we cosider is X f;q+1 t+1 X f;q+1 t ) that results i a telescopic sum). The sequece of coditioal expectatios is X Q t+1 f);q t ). The boud o the icremet is M = f L q), where L is a upper boud for the maximal load if we ecouter a load of L, we stop the process).