An online bin-packing problem with an underlying ternary structure

Following an orginal idea by Kn\"odel, an online bin-packing problem is considered where the the large items arrive in double-packs. The dual problem where the small items arrive in double-packs is also considered. The enumerations have a ternary random walk flavour, and for the enumeration, the kernel method is employed.


Introduction
Walter Knödel introduced the following online bin-packing problem [3]: There are bins of size 1, and random items of size 2  3 (large items) and of size 1 3 (small items) appear and are put into the boxes.A typical scenario is that a number j of partially filled boxes exist, and the number j becomes j + 1 resp.j − 1, depending on whether a the new item is of large resp.small type."At random" means that both types appear with the same probability 1  2 .In my collection of examples [4], I showed how to deal with the Knödel problem using the kernel method.I was, however, not the only author who was intrigued by such questions; a notable paper is by Michael Drmota [1], which is of a more probabilistic type, whereas I tried to emphasize the combinatorial point of view.
The present paper has a certain 'ternary' flavour: the next section deals with the instance of large items appearing in double-packs.The handler breaks off the doublepacks, and then treats the items as Knödel would have done.Typically, the number of partially filled boxes increases by 2 or decreases by 1.In order to keep the system balanced, we assume that the small items appear twice as often as the double-packs.
The last section deals with the dual problem, where the small items appear in doublepacks and the large items as single units.
The kernel method is used to obtain all the relevant enumerations.The recent paper [5] served as an inspiration, but deals with a different issue.It must be said that, when [4] was prepared, such ternary questions would have been outside of my reach.Luckily, now, they are not.
We confine ourselves here just to enumerations, deriving explicit generating functions in one or two variables.Questions of a more probabilistic nature are not treated.

The first model
The following items arrive at random: a double-pack of items, each of size 2  3 , and an item of size 1  3 .We could equip the set-up with general probabilities p and q = 1−p, but we restrict ourselves to the 'balanced' case where the single items are twice as likely as the double-packs, so we set p = 1 3 and q = 2 3 .The following state diagram (we show only a finite part of it) describes the situation.There are states representing 'i boxes filled to 2  3 '; a double-pack pushes the i to i + 2, and a single item reduces it to i − 1.There is an exceptional state, called β, standing for one box, filled to 1  3 .The red edges represent an arrival of a double-pack, and will be labelled by pz; the black edges represent an arrival of a single item, and will be labelled by qz.From the state diagram, we set off an infinite set of generating functions in the variable z, where the coefficient of z n is the probability that n random steps lead to state i, for i ≥ 0 or i = β.Mostly, we just write f i instead of f i (z).The following system of recursions can be read off immediately: Our method to solve this system is the kernel method.For that, we introduce a bivariate generating function F (u, z), but we mostly write just F (u): Note that f 0 = F (0).It is beneficial to introduce the new variable u = zU; doing this, powers of z that appear are multiples of 3. As can be seen, the numbers of steps leading to a state i belong to just one residue class modulo 3. We compute As it is common using the kernel method, setting U = 0 leads to a void equation.However, factorizing the denominator is the method of choice.There is 'bad' factor in the denominator, which must also appear in the numerator, which allows us to compute f 0 and consequently the whole bivariate generating function.In order to deal with the ternary equation successfully, we further set x = z 3 = 27 4 t(1 − t) 2 and we find the 3 roots Plugging U = 2 3(1−t) into the numerator (this is the bad factor, as explained a little bit later), leads to and furthermore to the simplified numerator The variable x is given in terms of t.The inverse relation is of interest.It can be obtained by the Lagrange inversion formula or, as here, by contour integration: which, after simplification, gives us A similar computation leads to From this we infer that U ∼ 2 3 , or u ∼ 2 3 z, explaining why we are talking about the bad factor.We continue the computation: .

Partial fraction decomposition leads to (we use the abbreviation
For the further simplification we will resort to two identities going by the name of Girard-Waring formula, see e. g. [2]: Of course, we will apply them with X = τ and Y = σ.Then Combining the two leads to a pleasant simplification: We need a second similar term: Putting everything together we found Reading off coefficients of powers of z as well is now done with Cauchy's integral formula; the contours are always small circles (or equivalent) around the origin.The starting point is and we will treat the two sums separately.There is only a contribution if n + j ≡ 0 mod 3. (This is also clear from the combinatorial context.)Assume this and set N := n+j 3 .
Step 1: Step 2: We put all the results of this section together in a theorem.
Theorem 1.The generating function F (u) = F (u, z) has the following explicit form: Here, u = zU, z 3 = x = 27 4 t(1 − t) 2 , and Written in the new variable U, only powers of z that are multiples of 3 appear.Further, we get the representation sorted by powers of u: Reading off coefficients of z N u j , where N = n+j 3 leads to For the special state β, the following series representation holds: The computation for the special state was not shown yet: 3n + 1 n .

The dual model
Now, the red edges mean the arrival of the large objects (size 2 3 ) and the black edges mean a double-pack of the small edges (size 1  3 each).To keep the system balanced, the large objects should arrive twice as often as the double-packs of small edges.Again, the generating function g i refers to paths of length n leading eventually into state i.After n steps, only a state i can be reached with n ≡ i mod 3. The state diagram and the recursions are immediate: We work only with p = 2 3 , q = 1 3 .Directly from the state diagram, Summing the recursions, Solving, we find with V = uz: Now we factorize the denominator: x.This time, both, (V − σ) and (V − τ ) are bad factors.Plugging into the numerator, we find two equations, and the solutions: .
Dividing out the bad factors, we find Altogether: Now let us consider j + 3N steps to reach state j, and then The coefficients of g 0 are different: Furthermore, Here are the main results of this section: Theorem 2. The generating function G(u) = G(u, z) has the following explicit form: .
Here, u = V z , z 3 = x = 27 4 t(1 − t) 2 .Written in the new variable V , only powers of z that are multiples of 3 appear.Further, we get the representation sorted by powers of u: For the special cases, the following series representation holds: