In this section, we prove the main result of this paper.
Theorem 1
Let c be an arbitrarily-large constant and let \(\mathbf {q}\) be any legitimate configuration. Let the repeated balls-into-bins process start from \(\mathbf {Q}^{(0)} = \mathbf {q}\). Then, over any period of length \(\mathcal {O}(n^c)\), the process visits only legitimate configurations, w.h.p., i.e., \(M^{(t)} = \mathcal {O}(\log n)\) for all \(t = \mathcal {O}(n^c)\) w.h.p. Moreover, starting from any configuration, the system reaches a legitimate configuration within \(\mathcal {O}(n)\) rounds, w.h.p.
The proof relies on the analysis of the behaviour of some essential random variables describing the repeated balls-into-bins process. In the next paragraph, we informally describe the main steps of this analysis. Then in Sects. 3.2–3.4, we prove the technical results required by such steps and, finally, in Sect. 3.5 these technical results are combined in order to prove Theorem 1.
Overview of the analysis
In the repeated balls-into-bins process, every bin can release at most one ball per round. As a consequence, the random walks performed by the balls delay each other and are thus correlated in a way that can make bin queues larger than in the independent case. Indeed, intuitively speaking, a large load observed at a bin in some round makes “any” ball more likely to spend several future rounds in that bin, because if the ball ends up in that bin in one of the next few rounds, it will undergo a large delay. This is essentially the major technical issue to cope with.
The previous approach in [12] relies on the fact that, in every round, the expected balance between the number of incoming and outgoing balls is always non-positive for every non-empty bin (notice that the expected number of incoming balls is always at most one). This may suggest viewing the process as a sort of parallel birth-death process [10]. Using this approach and with some further arguments, one can (only) get the “standard-deviation” bound \(\mathcal {O}(\sqrt{t})\) in [12]. Our new analysis proving Theorem 1 proceeds along three main steps.
(i) We first show that, after the first round, the aforementioned expected balance is always negative, namely, not larger than \(-1/4\). Indeed, the number of empty bins remains at least n / 4 with (very) high probability, which is extremely useful since a bin can only receive tokens from non-empty bins. This fact is shown to hold starting from any configuration and over any period of polynomial length.
(ii) In order to exploit the above negative balance to bound the load of the bins, we need some strong concentration bound on the number of balls entering a specific bin u along any period of polynomial size. However, it is easy to see that, for any fixed u, the random variables \(\left\{ Z^{(t)}_u\right\} _{t \geqslant 0}\) counting the number of balls entering bin u are not mutually independent, neither are they negatively associated, so that we cannot apply standard tools to prove concentration (see “Appendix B” for a counterexample).
To address this issue, we define a simpler repeated balls-into-bins process as follows.
Using a coupling argument and our previous upper bound on the number of empty bins, we prove that the maximum number of balls accumulating in a bin in the original process is not larger than the maximum number of balls accumulating in a bin in the Tetris process, w.h.p.
(iii) The Tetris process is simpler than the original one since, at every round, the number of balls assigned to the bins does not depend on the system’s state in the previous round. Hence, random variables \(\left\{ \hat{Z}^{(t)}_u\right\} _{t \geqslant 0}\) counting the number of balls arriving at bin u in the Tetris process are mutually independent. We can thus apply standard concentration bounds. On the other hand, differently from the approximating process considered in [12], the negative balance of incoming and outgoing balls proved in Step (i) still holds, thus yielding a much smaller bound on the maximum load than that in [12].
In the remainder of this section, we formally describe the above three steps, thus proving Theorem 1.
On the number of empty bins
We next show that the number of empty bins is at least a constant fraction of n over a very large time-window, w.h.p. This fact could be proved by standard concentration arguments if, at every round, all balls were thrown independently and uniformly at random. A little care is instead required in our process to properly handle, at any round, “congested” bins whose load exceeds 1. These bins will be surely non-empty at the next round too. So, the number of empty bins at a given round also depends on the number of congested bins in the previous round.
Lemma 1
Let \(\mathbf {q}= (q_1, \dots , q_n)\) be a configuration in a given round and let X be the random variable indicating the number of empty bins in the next round. For any large enough n, it holds that
$$\begin{aligned} \mathbf {P}_{}{\left( X \leqslant \frac{n}{4} \right) } \leqslant e^{- \alpha n} , \end{aligned}$$
where \(\alpha \) is a suitable positive constant.
Proof
Let \(a = a(\mathbf {q})\) and \(b = b(\mathbf {q})\) respectively denote the number of empty bins and the number of bins with exactly one token in configuration \(\mathbf {q}\). For each bin u of the \(a+b\) bins with at most one token, let \(Y_u\) be the random variable indicating whether or not bin u is empty in the next round, so that
$$\begin{aligned} X = \sum _{u = 1}^{a+b} Y_u \quad \text{ and }\quad \mathbf {P}_{}{\left( Y_u = 1 \right) } = \left( 1 - \frac{1}{n} \right) ^{n - a} \geqslant e^{-\frac{n-a}{n-1}} , \end{aligned}$$
where in the last inequality we used the fact that \(1 - x \geqslant e^{- \frac{x}{1-x}}\). Hence we have that
$$\begin{aligned} \mathbf {E}_{} \left[ X \right] \geqslant (a+b) e^{-\frac{n-a}{n-1}} . \end{aligned}$$
(1)
The crucial fact is that the number of bins with two or more tokens cannot exceed the number of empty bins, i.e. \(n - (a+b) \leqslant a\). Thus, we can bound the number of empty bins from below,Footnote 4\(a \geqslant (n-b)/2\), and by using that bound in (1) we get
$$\begin{aligned} \mathbf {E}_{} \left[ X \right] \geqslant \frac{n+b}{2} e^{ -\frac{n+b}{2(n-1)} } . \end{aligned}$$
Now observe that, for large enough n a positive constant \(\varepsilon \) exists such that
$$\begin{aligned} \frac{n+b}{2} e^{ -\frac{n+b}{2(n-1)} } \geqslant (1+\varepsilon )\frac{n}{4} ,\quad \text{ for } \text{ every } 0 \leqslant b \leqslant n . \end{aligned}$$
It is easy to show that random variables \(Y_1, \dots , Y_{a+b}\) are negatively associated (e.g., see Theorem 13 in [38]). Thus we can apply (see Lemma 7 in [38]) the Chernoff bound (6) with \(\delta = \varepsilon / (1+\varepsilon )\) to X to obtain
$$\begin{aligned} \mathbf {P}_{}{\left( X \leqslant \frac{n}{4} \right) } \leqslant \exp \left( - \frac{\varepsilon ^2}{4 (1+\varepsilon )} n \right) . \end{aligned}$$
\(\square \)
From the above lemma it easily follows that, if we look at our process over a time-window \(T = T(n)\) of polynomial size, after the first round we always see at least n / 4 empty bins, w.h.p. More formally, for every \(t \in \{1, \dots , T\}\), let \(\mathcal {E}_t\) be the event “The number of empty bins at round t is at least n / 4”. From Lemma 1 and the union bound we get the following lemma.
Lemma 2
Let \(\mathbf {q}_0\) denote the initial configuration, let \(T = T(n) = n^c\) for an arbitrarily large constant c. For any large enough n it holds that
$$\begin{aligned} \mathbf {P}_{}{\left( \bigcap _{t = 1}^T \mathcal {E}_t | \mathbf {Q}^{(0)} = \mathbf {q}_0 \right) } \geqslant 1 - e^{-\gamma n} , \end{aligned}$$
where \(\gamma \) is a suitable positive constant.
Proof
By using the union bound we obtain
$$\begin{aligned} \mathbf {P}_{}{\left( \bigcap _{t = 1}^T \mathcal {E}_t | \mathbf {Q}^{(0)} = \mathbf {q}_0 \right) }&= 1 - \mathbf {P}_{}{\left( \bigcup _{t = 1}^T \overline{\mathcal {E}_t} | \mathbf {Q}^{(0)} = \mathbf {q}_0 \right) } \\&\geqslant 1 - \sum _{t = 1}^T \mathbf {P}_{}{\left( \overline{\mathcal {E}_t} | \mathbf {Q}^{(0)} = \mathbf {q}_0 \right) } . \end{aligned}$$
By conditioning on the configuration at round \(t-1\), from the Markov property and Lemma 1 it then follows that
$$\begin{aligned}&\mathbf {P}_{}{\left( \overline{\mathcal {E}_t} | \mathbf {Q}^{(0)} = \mathbf {q}_0 \right) } \\&\quad = \sum _{\mathbf {q}} \mathbf {P}_{}{\left( \overline{\mathcal {E}_t} | \mathbf {Q}^{(t-1)} = \mathbf {q} \right) } \mathbf {P}_{}{\left( \mathbf {Q}^{(t-1)} = \mathbf {q}| \mathbf {Q}^{(0)} = \mathbf {q}_0 \right) } \\&\quad \leqslant e^{-\alpha n} . \end{aligned}$$
Hence,
$$\begin{aligned} \mathbf {P}_{}{\left( \bigcap _{t = 1}^T \mathcal {E}_t | \mathbf {Q}^{(0)} = \mathbf {q}_0 \right) } \geqslant 1 - T e^{-\alpha n} \geqslant 1 - e^{-\gamma n} , \end{aligned}$$
for a suitable positive constant \(\gamma \). \(\square \)
Coupling with Tetris
Using a coupling argument and Lemma 2 we now prove that the maximum load in the original process is stochastically not larger than the maximum load in the Tetris process w.h.p.
In what follows we denote by \(W^{(t)}\) the set of non-empty bins at round t in the original process. Recall that, in the latter, at every round a ball is selected from every non-empty bin u and it is moved to a bin chosen u.a.r. Accordingly we define, for every round t, the random variables
$$\begin{aligned} \left\{ X_u^{(t+1)} : u \in W^{(t)} \right\} , \end{aligned}$$
(2)
where \(X_u^{(t+1)}\) indicates the new position reached in round \(t+1\) by the ball selected in round t from bin u. Notice that for every non-empty bin \(u \in W^{(t)}\) we have that \(\mathbf {P}_{}{\left( X_u^{(t+1)} = v \right) } = 1/n\) for every bin \(v \in [n]\). The random process \(\left\{ \mathbf {Q}^{(t)} : t \in \mathbb {N} \right\} \) is completely defined by random variables \(X_u^{(t)}\)’s, indeed we can write
$$\begin{aligned} \mathcal {Q}_v^{(t+1)} = \max \left\{ \mathcal {Q}_v^{(t)}- 1,0\right\} + \left| \left\{ u \in W^{(t)} : X_u^{(t+1)} = v \right\} \right| \end{aligned}$$
and
$$\begin{aligned} W^{(t+1)} = \left\{ u \in [n] : \mathcal {Q}_u^{(t+1)} \geqslant 1 \right\} . \end{aligned}$$
Analogously, for each bin \(u \in [n]\) in the Tetris process, let \(\hat{\mathcal {Q}}_u^{(t)}\) be the random variable indicating the number of balls in bin u in round t. We next prove that, over any polynomially-large time window, the maximum load of any bin in our process is stochastically smaller than the maximum number of balls in a bin of the Tetris process w.h.p. More formally, we prove the following lemma.
Lemma 3
Let us start both the original process and the Tetris process from the same configuration \(\mathbf {q}= (q_1, \dots , q_n)\) such that \(\sum _{u = 1}^n q_u = n\) and containing at least n / 4 empty bins. Let \(T = T(n)\) be an arbitrary round and let \(M_T\) and \(\hat{M}_T\) be respectively the random variables indicating the maximum loads in our original process and in the Tetris process, up to round T. Formally
$$\begin{aligned} M_T = \max \left\{ \mathcal {Q}_u^{(t)} : u \in [n], t = 1, 2, \dots , T \right\} \end{aligned}$$
and
$$\begin{aligned} \hat{M}_T = \max \left\{ \hat{\mathcal {Q}}_u^{(t)} : u \in [n], t = 1, 2, \dots , T \right\} . \end{aligned}$$
Then, for every \(k \geqslant 0\) it holds that
$$\begin{aligned} \mathbf {P}_{}{\left( M_T \geqslant k \right) } \leqslant \mathbf {P}_{}{\left( \hat{M}_T \geqslant k \right) } + T \cdot e^{-\gamma n} , \end{aligned}$$
for a suitable positive constant \(\gamma \).
Proof
We proceed by coupling the Tetris process with the original one round by round. Intuitively speaking the coupling proceeds as follows:
-
Case (i): the number of non-empty bins in the original process is \(h \leqslant \frac{3}{4} n\). For each non-empty bin u, let \(i_u\) be the ball picked from u. We throw one of the \(\frac{3}{4} n\) new balls of the Tetris process in the same bin in which \(i_u\) ends up. Then, we throw all the remaining \(\frac{3}{4} n - h\) balls independently u.a.r.
-
Case (ii): the number of non-empty bins is \(h >\frac{3}{4} n\). We run one round of the Tetris process independently from the original one.
By construction, if the number of non-empty bins in the original process is not larger than \(\frac{3}{4} n\) at any round, case (ii) never applies and the Tetris process “dominates” the original one, meaning that every bin in the Tetris process contains at least as many balls as the corresponding bin in the original one. Since from Lemma 2 we know that the number of non-empty bins in the original process is not larger than \(\frac{3}{4} n\) for any time-window of polynomial size w.h.p., we thus have that the Tetris process dominates the original process for the whole time window w.h.p.
Formally, for \(t \in \{1, \dots , T\}\), denote by \(B^{(t)}\) the set of new balls in the Tetris process at round t (recall that the size of \(B^{(t)}\) is (3 / 4)n for every \(t \in \{1, \dots , T\}\)). For any round t and any ball \(i \in B^{(t)}\), let \(\hat{X}_i^{(t)}\) be the random variable indicating the bin where the ball ends up. Finally, let \(\left\{ U_i^{(t)} : t = 1, \dots , T, i \in B^{(t)} \right\} \) be a family of i.i.d. random variables uniform over [n].
At any round \(t \in \{ 1, \dots , T\}\), the following two cases may arise.
\(\text { If }|W^{(t-1)}| \leqslant (3/4)n\): Let \(B^{(t)}_W\) be an arbitrary subset of \(B^{(t)}\) with size exactly \(|W^{(t-1)}|\), let \(f^{(t)} : B^{(t)}_W \rightarrow W^{(t-1)}\) be an arbitrary bijection and set
$$\begin{aligned} \hat{X}_i^{(t)} =\left\{ \begin{array}{ll} X_i^{(t)} &{} \quad \text{ if } i \in B^{(t)}_W \\ U_i^{(t)} &{} \quad \text{ if } i \in B^{(t)} {\setminus } B^{(t)}_W \end{array}\right. \end{aligned}$$
(3)
\({\text {If} |W^{(t-1)}| > (3/4)n}\): Set \(\hat{X}_i^{(t)} = U_i^{(t)}\) for all \(i \in B^{(t)}\).
By construction we have that random variables
$$\begin{aligned} \left\{ \hat{X}_i^{(t)} : t \in \{ 1,2, \dots , T\}, i \in B^{(t)} \right\} \end{aligned}$$
are mutually independent and uniformly distributed over [n]. Moreover, in the joint probability space for any k we have that
$$\begin{aligned} \mathbf {P}_{}{\left( M_T \geqslant k \right) }&= \mathbf {P}_{}{\left( M_T \geqslant k, \hat{M}_T \geqslant M_t \right) } \\&\quad + \mathbf {P}_{}{\left( M_T \geqslant k, \hat{M}_T< M_T \right) } \\&\leqslant \mathbf {P}_{}{\left( \hat{M}_T \geqslant k \right) } + \mathbf {P}_{}{\left( \hat{M}_T < M_T \right) } . \end{aligned}$$
Finally, let \(\mathcal {E}_T\) be the event “There are at least n / 4 empty bins at all rounds \(t \in \{ 1, \dots , T\}\)” and observe that, from the coupling we have defined, the event \(\mathcal {E}_T\) implies event “\(\hat{M}_T \geqslant M_T\)”. Hence \(\mathbf {P}_{}{\left( \hat{M}_T < M_T \right) } \leqslant \mathbf {P}_{}{\left( \overline{\mathcal {E}_T} \right) }\) and the thesis follows from Lemma 2. \(\square \)
Analysis of the Tetris process
We begin by observing that in the Tetris process, the random variables indicating the number of balls ending up in a bin in different rounds are i.i.d. binomial. This fact is extremely useful to give upper bounds on the load of the bins, as we do in the next simple lemma, that will be used to prove self-stabilization of the original process.
Lemma 4
From any initial configuration, in the Tetris process every bin will be empty at least once within 5n rounds, w.h.p.
Proof
Let \(u \in [n]\) be a bin with \(k \leqslant n\) balls in the initial configuration. For \(t \in \{ 1, \dots , 5n\}\) let \(Y_t\) be the random variable indicating the number of new balls ending up in bin u at round t. Notice that in the Tetris process \(Y_1, \dots , Y_{5n}\) are i.i.d. \(B\left( (3/4)n, 1/n \right) \) hence
$$\begin{aligned} \mathbf {E}_{} \left[ Y_1 + \cdots + Y_{5n} \right] = \frac{15}{4} n \end{aligned}$$
and by applying Chernoff bound (7) with \(\delta = 1/15\) we get
$$\begin{aligned} \mathbf {P}_{}{\left( Y_1 + \cdots + Y_{5n} \geqslant 4n \right) } \leqslant e^{- \alpha n} , \text{ where } \alpha = 1/180 . \end{aligned}$$
Now let \(\mathcal {E}_u\) be the event “Bin u will be non-empty for all the 5n rounds”. Since when a bin is non-empty it loses a ball at every round, event \(\mathcal {E}_u\) implies, in particular, that
$$\begin{aligned} k - 5n + Y_1 + \cdots + Y_{5n} \geqslant 0 . \end{aligned}$$
That is
$$\begin{aligned} Y_1 + \cdots + Y_{5n} \geqslant 5n - k \geqslant 4n . \end{aligned}$$
Thus
$$\begin{aligned} \mathbf {P}_{}{\left( \mathcal {E}_u \right) } \leqslant \mathbf {P}_{}{\left( Y_1 + \cdots + Y_{5n} \geqslant 4n \right) } \leqslant e^{-\alpha n} . \end{aligned}$$
The thesis then follows from the union bound over all bins \(u \in [n]\). \(\square \)
We next focus on the maximum load that can be observed in the Tetris process at any given bin within a finite interval of time. We note that this result could be proved using tools from drift analysis (e.g., see [39]). We provide here an elementary and direct proof, that explicitly relies on the Markovian structure of the Tetris process.
Let \(\{X_t\}_t\) be a sequence of i.i.d. \(B\left( (3/4)n,1/n \right) \) random variables and let \(Z_t\) be the Markov chain with state space \(\{0,1,2, \dots \}\) defined as follows
$$\begin{aligned} Z_{t} =\left\{ \begin{array}{ll} 0 &{} \quad \text{ if } Z_{t-1} = 0 \\ Z_{t-1} - 1 + X_t &{}\quad \text{ if } Z_{t-1} \geqslant 1 \end{array}\right. \end{aligned}$$
(4)
Observe that 0 is an absorbing state for \(Z_t\) and let \(\tau \) be the absorption time \(\tau = \inf \{t \in \mathbb {N} : Z_t = 0\}\). We first prove the following lemma.
Lemma 5
For any initial starting state \(k \in \mathbb {N}\) and any \(t \geqslant 8 k\), it holds that
$$\begin{aligned} \mathbf {P}_{k}{\left( \tau > t \right) } \leqslant e^{- t / 144} . \end{aligned}$$
Proof
Observe that
$$\begin{aligned} \mathbf {P}_{k}{\left( \tau> t \right) }&= \mathbf {P}_{k}{\left( Z_t> 0 \right) } \\&= \mathbf {P}_{}{\left( k + \sum _{i = 1}^t X_i - t> 0 \right) } \\&= \mathbf {P}_{}{\left( \sum _{i = 1}^{t} X_i> t - k \right) } \\&\leqslant \mathbf {P}_{}{\left( \sum _{i = 1}^{t} X_i > \frac{7}{8} t \right) } , \end{aligned}$$
where in the last inequality we used hypothesis \(k < (1/8)t\). Since the \(X_i\)s are i.i.d. binomial B((3 / 4)n, 1 / n), it follows that \(\sum _{i = 1}^{t} X_i\) is binomial B((3 / 4)nt, 1 / n) and from Chernoff bound we get that
$$\begin{aligned} \mathbf {P}_{}{\left( \sum _{i = 1}^t X_i> \frac{7}{8} t \right) }&= \mathbf {P}_{}{\left( \sum _{i = 1}^t X_i > \left( 1 + \frac{1}{6}\right) \frac{3}{4}t \right) } \\&\leqslant e^{- \frac{(1/6)^2}{3} \frac{3}{4}t} \\&= e^{- t/144} . \end{aligned}$$
\(\square \)
Now we can easily prove the following statement on the Tetris process.
Lemma 6
Let c be an arbitrarily-large constant, and let the Tetris process start from any legitimate configuration. The maximum load \(\hat{M}^{(t)}\) is \(\mathcal {O}(\log n)\) for all \(t = \mathcal {O}(n^c)\), w.h.p.
Proof
Consider an arbitrary bin u that is non-empty in the initial legitimate configuration. Let \({\hat{\mathcal {Q}}}^{(0)} = \mathcal {O}(\log n)\) be its initial loadFootnote 5 and let \(\tau = \inf \left\{ t : \hat{\mathcal {Q}}^{(t)} = 0 \right\} \) be the first round the bin becomes empty. Observe that, for any \(t \leqslant \tau \), \({\hat{\mathcal {Q}}}^{(t)}\) behaves exactly as the Markov chain defined in (4). Hence, from Lemma 5 it follows that for every constant \(\hat{c}\) such that \(\hat{c} \log n \geqslant 8 {\hat{\mathcal {Q}}}^{(0)}\) we have
$$\begin{aligned} \mathbf {P}_{\hat{\mathcal {Q}}^{(0)}}{\left( \tau > \hat{c} \log n \right) } \leqslant n^{-\hat{c}/144} . \end{aligned}$$
(5)
Thus, within \(\mathcal {O}(\log n)\) rounds the bin will be empty w.h.p., and since the load of the bin decreases of at most one unit per round, the load of the bin is \(\mathcal {O}(\log n)\) for all such rounds w.h.p.
Next, define a phase as any sequence of rounds that starts when the bin becomes non-empty and ends when it becomes empty again. Notice that, by using a standard balls-into-bins argument, in the first round of each phase the load of the bin will be \(\mathcal {O}(\log n / \log \log n)\) w.h.p. Moreover, in any phase the load of the bin can be coupled with the Markov chain in (4). Hence, for any arbitrary large constant c we can choose the constant \(\hat{c}\) in (5) large enough so that, by taking the union bound over all phases up to round \(n^c\), the load of the bin is \(\mathcal {O}(\log n)\) in all rounds \(t \leqslant n^c\) w.h.p.
Finally, observe that for any bin that is initially empty the same argument applies with the only difference that the first phase for the bin does not start at round 0 but at the first round the bin becomes non-empty. The thesis thus follows from a union bound over all the bins. \(\square \)
Back to the original process: proof of Theorem 1
From a standard balls-into-bins argument (see, e.g., [11]), starting from any legitimate configuration, after one round the process still lies in a legitimate configuration w.h.p. and, thanks to Lemma 1, there are at least n / 4 empty bins w.h.p. From Lemma 3 with \(T = \mathcal {O}\left( n^c \right) \), we have that the maximum load of the repeated balls-into-bins process does not exceed the maximum load of the Tetris process in all rounds \(1,\dots ,T\), w.h.p. Finally, the upper bound on the maximum load of the Tetris process in Lemma 6 completes the proof of the first statement of Theorem 1.
As for self-stabilization, given an arbitrary initial configuration, Lemma implies that within \(\mathcal {O}(n)\) rounds, all bins have been emptied at least once, w.h.p. When a bin becomes empty, Lemma 5 ensures that its load will be \(\mathcal {O}(\log n)\) over a polynomial number of rounds. Hence, within \(\mathcal {O}(n)\) rounds, the system will reach a legitimate configuration, w.h.p. \(\square \)