Automated Counting of Towers (À La Bordelaise) [Or: Footnote to p. 81 of the Flajolet-Sedgewick Chef-d'œvre]
aa r X i v : . [ m a t h . C O ] D ec Automated Counting of Towers ( `A La Bordelaise)[Or: Footnote to p. 81 of the Flajolet-Sedgewick Chef-d’oevre]
Shalosh B. EKHAD and
Doron ZEILBERGER `A la m´emoire de Philippe FLAJOLET Introduction
One of our favorite theorems in enumerative combinatorics, whose proof-from-the-book by JeanB´etr´ema and Jean-Guy Penaud[BeP] is succinctly outlined on p. 81 of the Flajolet-Sedgewick[FS] bible , (that, in turn, is based on Mireille Bousquet-M´elou’s “insightful presentation” [Bo]), is the3 n theorem[GV] of Dominique Gouyou-Beauchamps and Xavier Viennot.This amazing result asserts that there are exactly n ways of forming a tower of n + 1 dominopieces such that the bottom floor consists of one or more contiguous pieces, and every piece at ahigher floor touches one or two pieces on the floor right under it in such a way that the commonboundary is exactly (the left- or right-) half of either piece.For example, here are 100 such towers with 35 pieces: ,and here are all
27 such towers with four pieces: .We love this proof (and theorem) so much that we wrote the admiring expos´e [Z1].
Why the present article?
Physcists call domino-pieces dimers . After writing [Z1], we realized that the same idea still appliesto the problem of enumerating towers where instead of using dimers as pieces, one uses trimes, ortetramers, or pentamers, etc. Even more surprisingly, the [BeP] ideas may be used to enumeratetowers using any given (finite) set of k -mers, where all interfaces are allowed. By a k -mer we meana 1 × k rectangular piece, where the case k = 2 is a dimer (alias domino-piece).This is all implemented in the Maple package TOWERS , written by DZ, and linkable from the “front”of this article Department of Mathematics, Rutgers University (New Brunswick), Hill Center-Busch Campus, 110 FrelinghuysenRd., Piscataway, NJ 08854-8019, USA. zeilberg at math dot rutgers dot edu , . Written: 12.12.12. Accompanied by the Maple package TOWERSavailable from , where one can alsofind lots of output that should be considered part of this article. Supported in part by the NSF. ,that implements these beautiful human ideas. There you can also find lots of new and excitingenumeration theorems generated by SBE, that readers are welcome to extend even further. Background
Recall that a domino (alias dimer ) is a 1 × i -mer to be a 1 × i rectangular piece.Fix a positive integer k , and suppose that we are allowed to use, as pieces, i -mers with 1 ≤ i ≤ k . A tower is a two-dimensional configuration where the bottom consists of (one or more) contiguous pieces (i.e., no gaps). A general tower is formed by starting with a bottom floor (which is alreadycalled a tower), and, if desired, building higher floors by placing non-overlapping pieces on top ofthe currently highest floor, in such a way that every piece in the newly created floor, must touch(at least) one piece of the floor right below it (or else the piece would drop down). Of course,the length of the common boundary between two touching pieces from adjacent floors must be astrictly positive integer ≤ k .On the computer, we describe a tower as a list of lists where on each floor, we list the locations[ x, x + i ], of the i -mer whose left-end is at x .For example, when k = 3, the following is one such (legal) tower:[[0 , , [1 , , [2 , , [5 , , [[3 , , [6 , , [[3 , , but [[1 , , [2 , , [5 , , [[3 , , [6 , , [[4 , , is not legal since the piece [4 , , , [0 , , is legal (but would not be in the “xaviers” counted by the original 3 n theorem).Let the weight of one piece of size i (i.e. of the form [ a, a + i ], for some a ), be t i z i , and let theweight of a tower be the product of the weights of the individual pieces.For example, weight ([[1 , , [2 , , [5 , , [[3 , , [6 , , [[4 , tz )( t z )( t z )) · (( tz )( t z )) · ( t z )) = t z z z .
2e are interested in M k = M k ( t ; z , . . . , z k ), the generating function (alias weight-enumerator) ofthe (“infinite”) set of all legal towers formed from i -mers with 1 ≤ i ≤ k . Then the coefficient of t n would give us the generating polynomial , for all towers with area n , and setting all the z i ’s to 1we would get the number of towers of area n .As in the B´etr´ema-Penaud approach (see [Z1]), let a pyramid be a tower whose first floor onlyconsists of one piece, and, let a half-pyramid be a pyramid none of whose floors have pieces that liestrictly to the left of the bottom piece.Let H = H ( t ; z , . . . , z k ), P = P ( t ; z , . . . , z k ), and M = M ( t ; z , . . . , z k ) be the weight-enumeratorsof half-pyramids, pyramids, and towers, respectively. Then an almost verbatim (you do it!)argument shows that H satisfies the following algebraic equation : H = k X i =1 t i z i (1 + H ) i . ( Half P yramids )Once we know H , we can get P from: P = H − P ki =1 ( i − t i z i (1 + H ) i , ( P yramids )and finally M = P − H . ( T owers )If the set of piece-sizes is not { , . . . , k } , but an arbitrary finite set of positive integers, S , then ofcourse H = X i ∈ S t i z i (1 + H ) i . From H we can get P : P = H − P i ∈ S ( i − t i z i (1 + H ) i , and finally M = P − H .
If we only want straight-enumeration, then set all z i = 1, getting H = X i ∈ S t i (1 + H ) i . ( Half P yramids P : P = H − P i ∈ S ( i − t i (1 + H ) i , ( P yramids M = P − H . ( T owers H → P i ∈ S t i (1+ H ) i , starting with H = 0, to crank outthe first 200 terms, but it gets slower and slower for higher terms. But thanks to Comtet’s famoustheorem, implemented in the Salvy-Zimmermann Maple package gfun [SaZ], we can (rigorously)find a linear differential equation with polynomial coefficients, and from this (still using gfun ) alinear recurrence equation for the enumerating sequence of half-pyramids, that would give you, much faster than the algebraic equation, the 50000-th term, say.Also from ( Half P yramids H , one can derive algebraic equations for P and M using ( P yramids
1) and (
T owers
1) respectively.Furthermore, from these algebraic equations, one can use the beautiful methods described in [FS]to derive asymptotics. Alternatively, one can derive them from the linear recurrences by using theMaple package
AsyRec described in [Z2].But an even more efficient approach is an empirical one. First use the algebraic equations tocrank out the first few terms of the desired sequences, guess linear recurrences, then use them tocrank out many terms, and use empirical asymptotics to estimate the asymptotics. So everythingis, if not “rigorous”, at least semi-rigorous, and easily rigorizable . Being empiricists , we prefer thelatter method.
Encore: The One Piece-Size CaseI. All Interfaces are allowed
If there is only one piece, of size k , and all interfaces are allowed then the generating function, H ,in the variable b , for the number of half-pyramids with n pieces (so b = t k ) is: H = b (1 + H ) k , and by Lagrange Inversion , we get the humanly-generated fact that the number of half-pyramids(where all interfaces are allowed) using n pieces, each of length k , equals ( kn )! n !( kn − n +1)! , and thanksto P = H − ( k − H , we get that the number of such pyramids is k (cid:0) knn (cid:1) . For k >
2, there is no ‘nice’expression for the number of towers with n pieces, but of course, using M = H (1 − ( k − H ))(1 − H ) , onecan get a linear recurrence, either directly, or better still, empirically.For k = 2 we have a nice surprise , the number of domino towers with n pieces, where all interfacesare allowed, is 4 n − , in nice analogy with the fact that the number of xaviers (where the exact-alignment interface is forbidden) is 3 n − . II. All Interfaces are allowed, except Exact Alignment
Recall that in the original, Viennot, scenario, that lead to the beautiful 3 n − formula, with dimers(dominoes), it was forbidden to place a piece exactly aligned with a piece on the floor below it. Ifwe impose this rule for the one-piece case , of size k , (unfortunately, the analysis is inapplicable forstructures with more than one piece-size), we get the equation H = b ((1 + H ) k − H ) , P = H − ( k − H , M = H (1 − ( k − H ))(1 − H ) .For k >
2, things are no longer closed-form, but we still get linear recurrences with polynomialcoefficients, since the generating functions are algebraic, and hence D -finite. References [BeP] J. B´etr´ema et J.-G. Penaud,
Mod`eles avec particules dures, animaux dirig´es et s´eries envariables partiellement commutatives http://fr.arxiv.org/abs/math/0106210 [Bo] Mireille Bousquet-M´elou,
Rational and algebraic series in combinatorial enumeration , invitedpaper for the International Congress of Mathematicians 2006. Proceedings of the ICM. Sessionlectures, pp. 789–826. http://fr.arxiv.org/abs/0805.0588 .[FS] P. Flajolet and R. Sedgewick, “Analytic Combinatorics” , Cambridge University Press, 2009.[freely(!) available on-line from http://algo.inria.fr/flajolet/Publications/book.pdf ][GV] D. Gouyou-Beauchamps and G. Viennot,
Equivalence of the two dimensional directed animalsproblem to a one-dimensional path problem , Adv. in Appl. Math. (1988), 334-357.[SaZ] Bruno Salvy and Paul Zimmermann, Gfun: a Maple package for the manipulation of gener-ating and holonomic functions in one variable , ACM Transactions on Mathematical Software, (1994), 163-177.[V] G. X. Viennot, Probl`emes combinatoires pos´es par la physique statistique , S´eminaire N. Bour-baki, expos´e n o e ann´ee, in Ast´erisque n o The amazing n theorem and its even more Amazing Proof [discovered by XavierViennot and his ´Ecole Bordelaise gang] , Personal Journal of Shalosh B. Ekhad and Doron Zeil-berger. [Z2] Doron Zeilberger, AsyRec: A Maple package for Computing the Asymptotics of Solutions ofLinear Recurrence Equations with Polynomial Coefficients , Personal Journal of Shalosh B. Ekhadand Doron Zeilberger.