About a Ball Removal Process on Bins

Published Online:https://doi.org/10.1287/stsy.2026.0149

Abstract

We consider a basic balls-and-bins question in which you have to distribute n balls into k bins. Then, round by round, a ball is removed from a nonempty bin chosen uniformly at random. The process ends when a single nonempty bin remains. The goal is to minimize the expected number of remaining balls. An open problem posed by Will Ma asks whether the initial assignment that minimizes the expected number of remaining balls is one that is as balanced as possible. Using a coupling argument, we answer this conjecture positively, and we discuss the case of nonuniform choice among the nonempty bins.

Funding: Financial support by the Israel Science Foundation [Grant 211/22] and by Agencia Nacional de Investigación y Desarrollo Chile through the Programa de Investigación Asociativa (Project FB210005) and Fondo Nacional de Desarrollo Científico y Tecnológico [Grant 1260036] is gratefully acknowledged.

1. Introduction

You have to distribute n balls into k bins. Then, round by round, a ball is removed from a nonempty bin chosen uniformly at random. The process ends when a single nonempty bin remains. The goal is to minimize the expected number of remaining balls. This problem was presented by Will Ma during an open problems session at the Simons Institute for the Theory of Computing. He conjectured that the initial assignments that minimize the expected number of remaining balls are those that distribute the n balls into the k bins as evenly as possible; in other words, the number of balls between any two bins differs by at most one. The purpose of this note is to affirmatively settle this conjecture.

Although this conjecture is very natural and interesting in its own right, one practical motivation comes from assortment optimization. At the beginning of the selling horizon, a seller selects the number of units to stock for each product. Each arriving customer makes a choice among the set of products with remaining inventory. The seller’s goal is to pick the stocking quantities to maximize the total expected revenue from the sales net of the stocking cost. Various approximations of the optimal solution under different assumptions on the data have been provided—for example, by Liang et al. (2021), Zhang et al. (2025), and Mouchtaki et al. (2026). The problem we study is a variation of this model, where products are perfect substitutes, customers are indifferent among them, and they are happy and make a purchase whenever they have a choice of products. In this case, they randomly purchase one unit of one product. The above conjecture is equivalent to determining how to initially distribute n items across k product types to maximize the expected number of happy customers. Although unrealistic as a model of customer behavior, it is arguably a particularly simple and mathematically interesting model that is not yet well understood. It is thus a relevant setting in which to develop tools for addressing more general and realistic models.

To formalize the problem, we assume that the k bins are labeled by [k]{1,,k} and that an initial assignment of balls to bins is given by n(n1,,nk)Nk, where N={0,1,}. Instead of the process implicit in the problem description, we consider the following process: at each round, a bin (possibly empty) is chosen according to the uniform distribution on [k], independently of past choices, and if the bin is nonempty, one ball is removed from it. Thus, the sample space is [k], and the probability distribution P is the product probability measure under which the coordinates are independent and uniformly distributed on [k]. This representation is independent of the initial assignment, because a point in the sample space determines the sequence of selected bins.

For each initial assignment n, denote by Xn the (random) number of balls in the last nonempty bin. Thus, if there are two bins and two balls, then X(1,1) and X(2,0) equal one and two, respectively.

We number rounds starting at 0: round 0 refers to the initial configuration, and, for t1, the configuration at the end of round t is the configuration after the first t selections. Let T(n) denote the first (random) round t0 at which the modified removal process started from n has a unique nonempty bin. Note that Xn is the number of balls remaining at round T(n) of the modified removal process. Crucially, this random variable has the same distribution as the number of balls remaining when the unmodified removal process terminates. Define

f(n)E[Xn],for all nNk.

We abuse notation and extend, in the natural way, the domain of f to m=2Nm.

From the definition, we see that f(a,0)=a, f(0,b)=b, and

f(a,b)=12f(a1,b)+12f(a,b1),for all a,bN{0}.(1)

Our main result is:

Theorem 1.

Fix n,k2. The quantity min{f(n):nNk,i[k]ni=n} is attained only by assignments n=(n1,,nk)Nk satisfying i[k]ni=n and |ninj|1 for every i,j[k].

The result was previously proved for k=2,3 in Gutiérrez and Subercaseaux (2024). For k=3, the proof argument is a complicated induction (on the initial number of balls n) of six mutually dependent claims. Each claim establishes, under suitable conditions, an inequality concerning the expected number of balls removed throughout the process. The complexity of the induction suggests that any generalization would require significant effort and provide little insight.

Independently of us, Zhou et al. (2026) proved Theorem 1 for any k, by embedding the discrete-time process into a continuous-time analytical framework. Specifically, the embedding recasts the time at which bins empty into independent Erlang random variables. This allows reframing the problem as one concerning order statistics of k independent Erlang variables. This yields a closed-form expression for the marginal contribution of adding one additional ball to any given bin. The closed-form expression is then analyzed and used to establish monotonicity of the expected number of balls removed throughout the process, with respect to the initial number of balls per bin. This directly translates into the optimality of the balanced initial assignment. As observed in Zhou et al. (2026), one key analytical difficulty in analyzing the process is that the objective function—the expected number of balls removed—is not Schur-concave. Thus, typical optimization techniques are not applicable to the problem under consideration. Our proof uses a standard coupling argument and is simpler and significantly shorter.

2. Proof of the Main Result

For completeness, we start by proving Theorem 1 for the case k=2, which involves a coupling argument.

Lemma 1.

Fix nN. For every n=(n1,n2)N2 such that n1+n2=n,

f(n/2,n/2)f(n1,n2),

with strict inequality whenever |n1n2|>1.

Proof.

Without loss of generality, assume n1n2. If |n1n2|1, then n1=n/2, n2=n/2, and there is nothing to prove. In what follows, we assume n1n2+2.

It suffices to show that f(n1,n2)>f(n11,n2+1), because the result then follows by repeatedly applying this inequality. To see that the inequality holds, run the process from the initial assignment (n1,n2) and consider a sequence of removals in which, eventually, at some round, bin 1 contains exactly one ball more than bin 2. Denote by t the first round at which this happens and by n1 the number of balls in bin 2 at the end of round t (so that bin 1 contains n1+1 at the end of that round). Starting from the initial assignment (n11,n2+1), the same sequence of removals, up to round t, leaves bins 1 and 2 with n1 and n1+1 balls, respectively. By symmetry, in any such sequence of removals, the number of balls remaining when the process stops is identically distributed, no matter if the initial assignment is (n1,n2) or (n11,n2+1).

Consider now the complementary situation in which a sequence of removals starting with the assignment (n1,n2) results in bin 1 having, throughout all rounds, at least two more balls than bin 2. Then, bin 1 is the last nonempty bin. Moreover, on the same sequence of removals, but starting with the assignment (n11,n2+1), the process takes longer and ends with fewer balls. Finally, note that this complementary situation occurs with positive probability. Indeed, this situation contains, for example, the sequence of chosen bins (2,2,,2) of n2 consecutive choices of bin 2. □

Remark 1.

Lemma 1 in fact yields the stronger statement that f(n1,n2)>f(n11,n2+1) for all n=(n1,n2)N2 with n1n2+2.

A simple property of f is the following:

Lemma 2.

f(r,1,1)f(r,1), for every r1, with strict inequality whenever r2.

Proof.

We prove the lemma by induction on r. For r=1, we have f(1,1,1)=f(1,1)=1. Assume that the lemma holds for a certain r1. Then,

f(r+1,1,1)=13f(r,1,1)+23f(r+1,1),(2)
13f(r,1)+13f(r,1)+13f(r+1,0),(3)
<12f(r,1)+12f(r+1,0),(4)
=f(r+1,1),(5)
where Equations (2) and (5) hold by the recursion that f satisfies, Equation (3) holds by the induction hypothesis and the recursion, and Equation (4) holds because f(r,1)r<r+1=f(r+1,0). □

We turn to Theorem 1. Fix an initial assignment n such that |ninj|2 for some i, j. We assume throughout that n1nj for every j[k].

Denote by ei=(0,,0,1,0,,0) the i-th standard unit vector in Rk. By definition, the random variable Xne1+ei indicates the number of balls in the last nonempty bin when the initial assignment is ne1+ei. With this notation, for each i such that n1ni+2,

E[Xn]>E[Xne1+ei].

Note that if n1=ni+1, then by symmetry, E[Xn]=E[Xne1+ei]. In what follows, fix i such that n1ni+2.

Given an initial assignment, for every point in our sample space, we can calculate the number of balls in each bin at every round. It will be convenient to assume that if bin j was selected kj,t times up to round t, and if kj,t>nj, then at the end of round t, the bin contains a negative number of balls—that is, njkj,t balls.

If n has only one nonempty coordinate, transferring one ball from that bin to bin i strictly decreases the objective because f(r1,1)r1<r=f(r,0). We may therefore assume henceforth that at least two bins are initially nonempty.

Central to our proof is the following stopping time. Given an initial assignment n, let S(n) be the smallest t0 such that, at the end of round t, one of the following conditions holds:1

  1. Bin 1 contains exactly one ball more than bin i.

  2. There are exactly two nonempty bins, and one of them contains exactly one ball. Denote by r1 the number of balls in the other bin.

Thus, S(n)=0 if (at least) one of the conditions (a) or (b) already holds in the initial configuration.2 Note also that S(n) is defined relative to the process started from n, even when it is subsequently used to couple this process with the one started from ne1+ei.

From the definition of S(n), we have T(n)S(n). We next show that the same lower bound holds for T(ne1+ei). We include this result primarily for clarity, to help discard infeasible events.

Lemma 3.

T(ne1+ei)S(n).

Proof.

If S(n)=0, the result is immediate. Assume henceforth that S(n)1.

Take a specific sequence of bins that were selected along the process. If condition (a) is triggered, then at round S(n), bin 1 has exactly one more ball than bin i. Hence, in the previous round, bin 1 contained exactly two more balls than bin i, and a ball was removed from bin 1 in round S(n). Because condition (b) has not occurred earlier, there are at least two nonempty bins, and, if there are exactly two nonempty bins, both contain at least two balls. In both cases, when the initial assignment is ne1+ei, the removal process does not end at round S(n), and hence, T(ne1+ei)>S(n).

If condition (b) is triggered, then T(ne1+ei) may be smaller than S(n) only if bin 1 contains one ball at round S(n), so that when the initial assignment is ne1+ei, it would contain no balls (if bin i contained more than one ball, then for (b) to be triggered, bin 1 must contain one ball and condition (a) would have triggered before). Because condition (b) was not triggered before, either at round S(n) the last ball from a third bin j has been removed, or at round S(n), the penultimate ball from bin 1 was removed. In both cases, when the initial assignment is ne1+ei, the removal process has not ended before round S(n), and hence, T(ne1+ei)S(n). □

We will consider the following events:

  • Ca: At round S(n) condition (a) occurs—that is, bin 1 contains exactly one ball more than bin i.

Outside Ca, when condition (b) first occurs, exactly two nonempty bins remain, and one has one ball. We distinguish whether these bins are {1,i}, neither of them, or {1,j} for some j{1,i}; in the last case, we further distinguish whether the occupancies are (1,1), (r,1), or (1,r). Note that because condition Ca does not occur, bin 1 always contains at least two balls more than bin i, and therefore, it cannot be that i but not 1 is among the last two nonempty bins. We therefore define:

  • F1,i: Bins 1 and i are the last two nonempty bins.

  • F: The last two nonempty bins include neither 1 nor i.

  • F1,ja,b for j{1,i} and a,b1: Bins 1 and j are the last two nonempty bins, and at the first round in which condition (b) is triggered, bins 1 and j contain a and b balls, respectively.

Consequently, the following collection of events partitions the sample space.

F={Ca,F1,iCa,FCa,(F1,j1,1Ca)j{1,i},(F1,jr,1Ca)j{1,i};r2,(F1,j1,rCa)j{1,i};r2}.

Note that F is defined relative to the stopping time S(n), which assumes that the initial assignment is n. Because these events cover the sample space, by the law of iterated expectations, we have

E[Xn]=P(Ca)·E[Xn|Ca]+P(F1,iCa)·E[Xn|F1,iCa]+P(FCa)·E[Xn|FCa]+j{1,i}P(F1,j1,1Ca)·E[Xn|F1,j1,1Ca]+j{1,i}r2(P(F1,jr,1Ca)·E[Xn|F1,jr,1Ca]+P(F1,j1,rCa)·E[Xn|F1,j1,rCa]).(6)

An analogous equality holds for E[Xne1+ei]. Note that although the random variable Xne1+ei is defined relative to the initial assignment ne1+ei, the partition F which is used in the analogous equality for E[Xne1+ei] is defined relative to the initial assignment n. This coupling constitutes the core of our proof strategy.

Next, we show that the first four summands in (6) are at least as large as the corresponding summands in the analogous expression for E[Xne1+ei].

Lemma 4.

The following hold:

  1. E[Xn|Ca]=E[Xne1+ei|Ca].

  2. E[Xn|F1,iCa]>E[Xne1+ei|F1,iCa].

  3. Xn=Xne1+ei on FCa.

  4. Xn=Xne1+ei=1 on F1,j1,1Ca, for every j{1,i}.

Proof.

On Ca, bin 1 contains one more ball than bin i at round S(n). Hence, when the initial assignment is ne1+ei, bin 1 contains one ball fewer, whereas bin i contains one additional ball at round S(n). By symmetry, Xn conditioned on Ca and Xne1+ei conditioned on Ca are identically distributed, and item (i) follows.

On F1,iCa the last two nonempty bins are 1 and i, and condition (b) triggers at round S(n). Hence, bin 1 contains at least two more balls than bin i, which, in turn, contains one ball. By Remark 1, we have f(m,1)>f(m1,2) for every m>2, and therefore, item (ii) follows.

On FCa, bin 1 is empty, and hence, bin i contains a negative number of balls. Even if we transferred in the initial assignment a ball from bin 1 to bin i, it would not affect the identity of the last two bins. This establishes item (iii).

On F1,j1,1Ca, we have Xn=1. Immediately before round S(n), for some {1,j}, bins 1, j, must each have contained one ball. Indeed, if bins 1 and j had contained two and one balls, respectively, or one and two balls, respectively, then condition (b) would have occurred earlier. Moreover, the additional nonempty bin cannot be i, because condition (a) was not triggered in an earlier round. Hence, in this case Xne1+ei=1. As a result, item (iv) holds. □

Recall that k,t denotes the number of times bin is selected in the first t rounds and that f(a,b)=f(b,a) by symmetry. Observe that for r2:

E[Xn|F1,jr,1Ca]=E[Xn|F1,j1,rCa]=f(r,1),E[Xne1+ei|F1,jr,1Ca,ki,S(n)>ni]=f(r1,1),E[Xne1+ei|F1,jr,1Ca,ki,S(n)=ni]=f(r1,1,1),E[Xne1+ei|F1,j1,rCa]=f(r,0).(7)

Regarding the last equality, on F1,j1,rCa bin 1 contains one ball at round S(n), and because Ca does not hold, bin i contains a negative number of balls. Moreover, because condition (b) is triggered, there are two possibilities for what happened at round S(n): either a ball was removed from bin 1 or a ball was removed from some bin {1,j,i}. In both cases, when the initial assignment is ne1+ei, at the beginning of round S(n), there are r balls in bin j and one ball in another bin (1 or ), and at the end of that round, that other bin is empty.

Because P(F1,iCa)>0, Lemma 4 implies that, to prove E[Xn]>E[Xne1+ei], it suffices to show that for every j{1,i} and every r2,

P(F1,jr,1Ca)·E[Xn|F1,jr,1Ca]+P(F1,j1,rCa)·E[Xn|F1,j1,rCa]P(F1,jr,1Ca)·E[Xne1+ei|F1,jr,1Ca]+P(F1,j1,rCa)·E[Xne1+ei|F1,j1,rCa].(8)

Fix then j{1,i}. By Lemma 2, for every r2, we have f(r1,1,1)f(r1,1), and hence, by (7), Equation (8) is implied by

(P(F1,jr,1Ca)+P(F1,j1,rCa))·f(r,1)P(F1,jr,1Ca)·f(r1,1)+P(F1,j1,rCa)·f(r,0).

By (1) and because f(r1,1)<r=f(r,0) for every r2, the inequality above holds, provided P(F1,jr,1Ca)P(F1,j1,rCa). Thus, all that remains to establish Theorem 1 is to show this last inequality. We do so in what follows.

Note that nk,t is the number of balls remaining in bin at the end of round t (possibly becoming negative). Let Sb denote the first round at which condition (b) holds—that is, the first round at which exactly two bins are nonempty and one of them contains exactly one ball. With the above notation,

Cac={n1k1,tniki,t+2 for every 0tSb}.(9)

On Cac, we have S(n)=Sb.

We now define the reflection map Ψ:[k][k]. Informally, this map swaps the selections of bins 1 and j after the last round in which they contain the same number of balls, thereby sending a path in F1,j1,r to a path in F1,jr,1 while preserving the event Cac. Formally, for ω[k] with Sb(ω)<, let

τ(ω)max{t:0tSb(ω),n1k1,t(ω)=njkj,t(ω)},
whenever this set is nonempty, and set Ψ(ω)ω otherwise. When τ is defined, let Ψ(ω) be the point obtained from ω by interchanging the symbols 1 and j in every coordinate ωt with t>τ(ω), all other coordinates (in particular, all selections of bin i) being left unchanged.

Lemma 5.

The map Ψ is a measure-preserving involution of ([k],P).

Proof.

The map Ψ is clearly an involution and, in particular, a bijection. Moreover, Ψ is measure preserving. Indeed, for each s0, on the set {τ=s}, the function Ψ interchanges the symbols 1 and j after time s and, hence, is measure preserving; and on the set where τ is undefined, Ψ is the identity. □

Lemma 6.

For all j{1,i} and all r2, we have P(F1,jr,1Ca)P(F1,j1,rCa).

Proof.

Note that τ is defined on F1,j1,r. Indeed, n1nj, and on this event in round Sb, bin 1 contains less balls than bin j, so there must be a round in which the two bins contain the same number of balls. We next assert that Ψ(F1,j1,rCa)Cac. Indeed, let ωF1,j1,rCac. Observe that:

  • Because ω and Ψ(ω) coincide up to time τ and condition (a) is not triggered along ω up to that time (because ωCac), it is not triggered along Ψ(ω) up to time τ as well.

  • Because ωF1,j1,r, in each round between τ+1 and Sb, bin 1 contains more balls along Ψ(ω) than along ω. This is because τ is the last round in which the two bins contain the same number of balls, and along ω, at time Sb bin j contains more balls than bin 1. Hence, if condition (a) is not triggered along ω between those rounds, it is not triggered also along Ψ(ω).

These two items imply that Ψ(ω)Cac, thus establishing the assertion.

Next, we assert that Ψ(F1,j1,r)F1,jr,1. Indeed, fix ωF1,j1,r. At time τ(ω), bins 1 and j contain the same number of balls—say, z. Because ωF1,j1,r, along ω, between rounds τ(ω)+1 and Sb(ω), the number of rounds in which bins 1 and j have been selected is z1 and zr, respectively. Because up to time τ(ω) both ω and Ψ(ω) coincide, and after that time, the symbols 1 and j are swapped, Ψ(ω)F1,jr,1.

The two established claims imply Ψ(F1,j1,rCa)F1,jr,1Ca. To conclude, observe that

P(F1,j1,rCa)=P(Ψ(F1,j1,rCac))P(F1,jr,1Ca),
where the first equality is because Ψ is measure preserving and injective (Lemma 5) and the inequality is by monotonicity of P. □

3. Nonuniform Selection of Bins

In the case where the bins from which balls are removed are chosen nonuniformly, it is natural to ask whether the optimal initial assignment of balls to bins is proportional to the probability of picking each bin. The goal of this section is to show that this is not the case, even for the two-bin scenario.

Consider the case where k=2 and n=6. We claim that the initial assignment (5,1) is not optimal when, at each round, bins 1 and 2 are chosen with probabilities 5/6 and 1/6, respectively. Note that the assignment (5,1) is perfectly proportional to the selection probabilities.

Let fp(a,b) denote the expected number of balls remaining when the process stops, starting from the initial assignment (a,b), when bin 1 is selected with probability p and bin 2 with probability 1p at each round. To achieve this section’s stated goal, it suffices to show that f5/6(4,2)<f5/6(5,1). That is, the perfectly proportional initial assignment is not optimal: moving one ball from the heavier bin to the lighter bin reduces the expected number of balls in the last nonempty bin.

First, note that fp(a,b) satisfies the following recursion:

fp(a,b)={a,if b=0,b,if a=0,pfp(a1,b)+(1p)fp(a,b1),otherwise.

Using this relation, one can verify that the following expression holds for b=1:

fp(a,1)=appa1pfor a>0.

Similarly, one can verify that for b=2:

fp(a,2)=a+221p+pa(a+2+2p1p) for aN.

Simple calculations show that

f5/6(5,1)=312512962.41,f5/6(4,2)=139811.72.

In particular, the proportional initial assignment (5,1) is not optimal.

Although the optimal allocation is not balanced, we conjecture that for every number of bins, the L distance between the optimal allocation and the balanced allocation is O(n).

Acknowledgments

The authors thank Bernardo Subercaseaux for calling to their attention the problem addressed in this manuscript and for several insightful conversations. The authors also thank Will Ma and Elchanan Mossel for useful discussions and pointers to the literature. The authors acknowledge the use of Claude (Anthropic, July 2026) in identifying an error in an earlier proof of Lemma 6 and in developing the argument given here. Part of this work was done while the third author was a postdoc and the fourth author was a visitor at the Centro de Modelamiento Matemático at Universidad de Chile.

Endnotes

1 Although S(n) depends on i, we opt not to make the dependence explicit in the notation.

2 Both conditions are triggered simultaneously if at round S(n), bin i contains zero balls; some bin k1,i contains more than one ball; bin 1 contains two balls at the beginning of the round and is selected at that round; and all other bins are empty.

References

  • Gutiérrez F, Subercaseaux B (2024) Assortment optimization for conference goodies with indifferent attendees. Preprint, submitted March 5, https://arxiv.org/abs/2403.03330.Google Scholar
  • Liang AJ, Jasin S, Uichanco J (2021) Assortment and inventory planning under dynamic substitution with MNL model: An LP approach and an asymptotically optimal policy. Technical report, University of Michigan, Ann Arbor, MI.Google Scholar
  • Mouchtaki O, El Housni O, Gallego G, Goyal V, Humair S, Kim S, Sadighian A, Wu J (2026) Joint assortment and inventory planning under the Markov chain choice model. Management Sci., ePub ahead of print February 4, https://doi.org/10.1287/mnsc.2023.01322.LinkGoogle Scholar
  • Zhang J, Ma W, Topaloglu H (2025) Technical note—Leveraging the degree of dynamic substitution in assortment and inventory planning. Oper. Res. 73(3):1248–1259.LinkGoogle Scholar
  • Zhou Z, Wang T, Zhang J (2026) Optimal inventory allocation for indifferent goods under dynamic substitution. Oper. Res. 74(4):2001–2012.LinkGoogle Scholar