This article presents a powerful method for the enumeration of pattern-avoiding words generated by an automaton or a context-free grammar. It relies on methods of analytic combinatorics, and on a matricial generalization of the kernel method. Due to classical bijections, this also gives the generating functions of many other structures avoiding a pattern (e.g., trees, integer compositions, some permutations, directed lattice paths, and more generally words generated by a push-down automaton). We focus on the important class of languages encoding lattice paths, sometimes called generalized Dyck paths. We extend and refine the study by Banderier and Flajolet in 2002 on lattice paths, and we unify several dozens of articles which investigated patterns like peaks, valleys, humps, etc., in Dyck and Motzkin words. Indeed, we obtain formulas for the generating functions of walks/bridges/meanders/excursions avoiding any fixed word (a pattern). We show that the autocorrelation polynomial of this forbidden pattern (as introduced by Guibas and Odlyzko in 1981, in the context of regular expressions) still plays a crucial role for our algebraic functions. We identify a subclass of patterns for which the formulas have a neat form. En passant, our results give the enumeration of some classes of self-avoiding walks, and prove several conjectures from the On-Line Encyclopedia of Integer Sequences. Our approach also opens the door to establish the universal asymptotics and limit laws for the occurrence of patterns in more general algebraic languages.
Banderier, C., Wallner, M.: The kernel method for lattice paths below a rational slope. In: Lattice Paths Combinatorics And Applications, Developments in Mathematics Series, pp. 1–36. Springer (2018)Google Scholar
Bousquet-Mélou, M.: Rational and algebraic series in combinatorial enumeration. In: International Congress of Mathematicians, vol. III, pp. 789–826. EMS (2006)Google Scholar
Bousquet-Mélou, M., Jehanne, A.: Polynomial equations with one catalytic variable, algebraic series and map enumeration. J. Comb. Theory Ser. B 96(5), 623–672 (2006)MathSciNetCrossRefzbMATHGoogle Scholar
Manes, K., Sapounakis, A., Tasoulas, I., Tsikouras, P.: Strings of length 3 in Grand-Dyck paths and the Chung-Feller property. Electron. J. Combin. 19(2), 10 (2012). Paper 2MathSciNetzbMATHGoogle Scholar
Manes, K., Sapounakis, A., Tasoulas, I., Tsikouras, P.: Equivalence classes of ballot paths modulo strings of length 2 and 3. Discret. Math. 339(10), 2557–2572 (2016)MathSciNetCrossRefzbMATHGoogle Scholar