Positive and Negative (Automated!) Thinking in Enumerating Permutations Avoiding Consecutive Patterns (According to Andrew Baxter and Brian Nakamura [and implemented by S.B. Ekhad])

By Doron ZEILBERGER^{1}

Preface

This expository article, describes two complementary approaches to enumeration, the positive and the negative, each with its advantages and disadvantages. Both approaches are amenable to automation, and when applied to the currently active subarea, initiated in 2003 by Sergi Elizalde, of consecutive pattern-avoidance in permutations, were successfully pursued by my two current PhD students, Andrew Baxter[B] and Brian Nakamura[N]. In addition to briefly explaining what they did, I also, as an independent check, developed two Maple packages, SERGI and ELIZALDE implementing the algorithms that enable the computer to ”do research” by deriving, ”all by itself”, functional equations for the generating functions that enable polynomial-time enumeration for any set of patterns. In the case of ELIZALDE (the ”negative” approach), these functional equations can be sometimes (automatically!) simplified, and imply ”explicit” formulas, that previously were derived by humans using ad-hoc methods. We also get lots of new ”explicit” results, beyond the scope of humans, but we have to admit that we still need humans to handle ”infinite families” of patterns, but this too, no doubt, will soon be automatable, and I leave it as a challenge to the (human and/or computer) reader.

Consecutive Pattern Avoidance

Inspired by the very active research in pattern-avoidance, pioneered by Herb Wilf, Rodica Simion, Frank Schmidt, Richard Stanely, Don Knuth and others, Sergi Elizalde, in his PhD thesis (written under the direction of Richard Stanley) introduced the study of permutations avoiding consecutive patterns.

Recall that an n-permutation is a sequence of integers π = π_{1} … π_{n} of length n where each integer in {1, …, n} appears exactly once. It is well-known and very easy to see (today!) that the number of n-permutations is n! := ∏_{i=1}^{n} i .

The reduction of a list of different (integer or real) numbers (or members of any totally ordered set) [i_{1}, i_{2}, …, i_{k}], to be denoted by R([i_{1}, i_{2}, …, i_{k}]), is the permutation of {1, 2, …, k} that preserves the relative rankings of the entries. In other words, if p = p_{1} … p_{k} is the reduction of q = q_{1} … q_{k} then q_{i} is the p_{i}-th largest entry in q. For example the reduction of [4, 2, 7, 5] is [2, 1, 4, 3] and the reduction of [π, e, γ, ϕ] is [4, 3, 1, 2].

1 Department of Mathematics, Rutgers University (New Brunswick), Hill Center-Busch Campus, 110 Frelinghuysen

Rd., Piscataway, NJ 08854-8019, USA. zeilberg@math.rutgers.edu , http://www.math.rutgers.edu/~zeilberg/ .

First version: Jan. 1, 2011. Accompanied by Maple packages ELIZALDE and SERGI downloadable from the webpage of this article: http://www.math.rutgers.edu/~zeilberg/mamarim/mamarimhtml/posneg.html , where the reader can find lots of sample input and output. Supported in part by the United States of America National Science Foundation.

Exclusively published in the Personal Journal of S.B. Ekhad and Doron Zeilberger http://www.math.rutgers.edu/~zeilberg/pj.html and arxiv.org.

Fixing a pattern p = [p_{1}, …, p_{k}], a permutation π = [π_{1}, …, π_{n}] avoids the consecutive pattern p if for all i, 1 ≤ i ≤ n − k + 1, the reduction of the list [π_{i}, π_{i+1}, …, π_{i+k−1} is not p. More generally a permutation π avoids a set of patterns P if it avoids each and every pattern p ∈ P.

The central problem is to answer the question: “Given a pattern or a set of patterns, find a “formula”, or at least an efficient algorithm, that inputs a positive integer n and outputs the number of permutations of length n that avoid that pattern (or set of patterns)”.

Human Research

After the pioneering work of Elizalde and Noy [EN], quite a few people contributed significantly, including Anders Claesson, Toufik Mansour, Sergey Kitaev, Anthony Mendes, Jeff Remmel, and the more recently, Vladimir Dotsenko and Anton Khoroshkin and Boris Shapiro. Also recently we witnessed the beautiful resolution of the Warlimont conjecture by Richard Ehrenborg, Sergey Kitaev, and Peter Perry [EKP]. The latter paper also contains extensive references.

Recommended Reading

While the present expository article is self-contained, the readers would get more out of it if they are familiar with [Z1], and its sequels [EZ][Z1][Z2][Z3][Z4].

Outline of the Positive Approach (according to Andrew Baxter[B])

Instead of dealing with avoidance (the number of permutations that have zero occurrences of the given pattern(s)) we will deal with the more general problem of enumerating the number of permutations that have specified numbers of occurrences of any pattern of length k.

Fix a positive integer k, and let {t_{p} : p ∈ S_{k}} be k! commuting indeterminates (alias variables). Define the weight of an n-permutation π = [π_{1}, …, π_{n}], to be denoted by w(π), by:

w([π_{1}, …, π_{n}] := ∏_{i=1}^{n−k+1} t_{R([p_{i},p_{i+1},...,p_{i+k−1}])} .

For example, with k = 3,

w([2, 5, 1, 4, 6, 3] := t_{R([2,5,1])}t_{R([5,1,4])}t_{R([1,4,6])}t_{R([4,6,3])} =
t − 231t_{312}t_{123}t_{231} = t_{123}t_{231}^{2}t_{312} .

We are interested in an efficient algorithm for computing the sequenec of polynomials in k! variables

P_{n}(t_{1,...,k}, …, t_{k,...,1}) := ∑_{π∈S_{n}} w(π) ,

or equivalently, as many terms as desired in the formal power series

F_{k}(t_{1,...,k}, …, t_{k,...,1}; z) = ∑_{n=0}^{∞} P_{n}z^{n} .

Note that once we have computed the P_{n} (or F_{k}), we can answer any question about pattern avoidance by specializing the t’s. For example to get the number of n-permutations avoiding the single pattern p, of length k, first compute P_{n}, and then plug-in t_{p} = 0 and all the other t’s to be 1. If you want the number of n-permutations avoiding the set of patterns P (all of the same length k), set t_{p} = 0 for all p ∈ P and the other t’s to be 1. Another advantage of the P_{n}(t_{p})’s is that we can extract statistical information, averages, variance, and higher moments of the random variable(s) “number of occurrences of the consectutive pattern(s) p (P))” by differentiating with respect to the relevant t_{p}’s and plugging-in 1 latter, but we will not pursue this option here.

First let’s recall one of the many proofs that the number of n-permutations, let’s denote it by a(n), satisfies the recurrence

a(n + 1) = (n + 1)a(n) .

Given a typical member of S_{n}, let’s call it π = π_{1} … π_{n}, it can be continued in n + 1 ways, by deciding on π_{n+1}. If π_{n+1} = i, then we have to “make room” for the new entry by incrementing by 1 all entries ≥ i, and then append i. This gives a bijection between S_{n} × [1, n + 1] and S_{n+1} and taking cardinalities yields the recurrence. Of course a(0) = 1, and “solving” this recurrence yields a(n) = n!. Of course this solving is “cheating”, since n! is just shorthand for the solution of this recurrence subject to the initial condition a(0) = 1, but from now on it is considered “closed form” (just by convention!).

When we do weighted counting with respect to the weight w with a given pattern-length k, we have to keep track of the last k − 1 entries of π:

[π_{n−k+2} … π_{n}]

and when we append π_{n+1} = i, the new permutation (let a′ = a if a < i and a′ = a + 1 if a ≥ i)

… π′_{n−k+2} … π′_{n}i ,

has “gained” a factor of t_{R[π′_{n−k+2}...π′_{n}i]} to its weight.

This calls for the finite-state method, alas, the “alphabet” is indefinitely large, so we need the umbral transfer-matrix method.

We introduce k − 1 “catalytic” variables x_{1}, x_{2}, …, x_{k−1}, as well as a variable z to keep track of the size of the permutation, and (k − 1)! “linear” state variables A[q] for each q ∈ S_{k−1}, to tell us the state that the permutation is in. and define the generailzed weight w′(π) of a permutation π ∈ S_{n} to be:

w′(π) := w(π)x_{1}^{j_{1}}x_{2}^{j_{2}} … x_{k−1}^{j_{k−1}}z^{n}A[q] ,

where [j_{1}, …, j_{k−1}], (1 ≤ j_{1} < j_{2} < … < j_{k−1} ≤ n) is the sorted list of the last k − 1 entries of π, and q is the reduction of its last k − 1 entries. For example, with k = 3:

w′([4, 7, 1, 6, 3, 5, 8, 2]) = t_{231}t_{312}t_{132}t_{312}t_{123}t_{231}x_{1}^{2}x_{2}^{8}z^{8}A[21] =

t_{123}t_{132}t_{231}^{2}t_{312}^{2}x_{1}^{2}x_{2}^{8}z^{8}A[21] .

Let’s give an example with k = 3. There are two states: [1, 2], [2, 1] corresponding to the cases where the two last entries are j_{1}j_{2} or j_{2}j_{1} respectively (always we assume j_{1} < j_{2}. Suppose we are in state [1, 2], so our permutation looks like

π = […, j_{1}, j_{2}] ,

and w′(π) = w(π)x_{1}^{j_{1}}x_{2}^{j_{2}}z^{n}A[1, 2]. We want to append i (1 ≤ i ≤ n + 1) to the end. There are three cases: Case 1: 1 ≤ i ≤ j_{1} The new permutation, let’s call it σ, looks like

σ = [… j_{1} + 1, j_{2} + 1, i] .

Its state is [2, 1] and w′(σ) = w(π)t_{231}x_{1}^{i}x_{2}^{j_{2}+1}zA[2, 1]. Case 2: j_{1} + 1 ≤ i ≤ j_{2} The new permutation, let’s call it σ, looks like

σ = [… j_{1}, j_{2} + 1, i] .

Its state is also [2, 1] and w′(σ) = w(π)t_{132}x_{1}^{i}x_{2}^{j_{2}+1}zA[2, 1]. Case 3: j_{2} + 1 ≤ i ≤ n + 1 The new permutation, let’s call it σ, looks like

σ = [… j_{1}, j_{2}, i] .

Its state is now [1, 2] and w′(σ) = w(π)t_{123}x_{1}^{j_{2}}x_{2}^{i}zA[1, 2]. It follows that any individual permutation of size n, and state [1, 2], gives rise to n + 1 children, and regarding weight, we have the “umbral evolution” (here W is the fixed part of the weight, that does not change):

W x_{1}^{j_{1}}x_{2}^{j_{2}}z^{n}A[1, 2] → W t_{231}zA[2, 1] (∑_{i=1}^{j_{1}} x_{1}^{i}x_{2}^{j_{2}+1}) z^{n}

+W t_{132}zA[2, 1] ( ∑_{i=j_{1}+1}^{j_{2}} x_{1}^{i}x_{2}^{j_{2}+1}) z^{n}

+W t_{123}zA[1, 2] ( ∑_{i=j_{2}+1}^{n+1} x_{1}^{j_{2}}x_{2}^{i}) z^{n}

Taking out whatever we can out of the ∑-signs, we have:

W x_{1}^{j_{1}}x_{2}^{j_{2}}z^{n}A[1, 2] → W t_{231}zA[2, 1] (∑_{i=1}^{j_{1}} x_{1}^{i}) x_{2}^{j_{2}+1}z^{n}

+W t_{132}zA[2, 1] ( ∑_{i=j_{1}+1}^{j_{2}} x_{1}^{i}) x_{2}^{j_{2}+1}z^{n}

+W t_{123}zA[1, 2] ( ∑_{i=j_{2}+1}^{n+1} x_{2}^{i}) x_{1}^{j_{2}}z^{n}

Now summing up the geometrical series, using the ancient formula:

∑_{i=a}^{b} Z^{i} = \frac{Z^{a} − Z^{b+1}}{1 − Z} ,

we get

W x_{1}^{j_{1}}x_{2}^{j_{2}}z^{n}A[1, 2] → W t_{231}zA[2, 1] (\frac{x_{1} − x_{1}^{j_{1}+1}}{1 − x_{1}} ) x_{2}^{j_{2}+1}z^{n}

+W t_{132}zA[2, 1] (\frac{x_{1}^{j_{1}+1} − x_{1}^{j_{2}+1}}{1 − x_{1}} ) x_{2}^{j_{2}+1}z^{n}

+W t_{123}zA[1, 2] (\frac{x_{2}^{j_{2}+1} − x_{2}^{n+2}}{1 − x_{2}} ) x_{1}^{j_{2}}z^{n}

This is the same as:

W x_{1}^{j_{1}}x_{2}^{j_{2}}z^{n}A[1, 2] → W t_{231}zA[2, 1] (\frac{x_{1}x_{2}^{j_{2}+1} − x_{1}^{j_{1}+1}x_{2}^{j_{2}+1}}{1 − x_{1}} ) z^{n}

+W t_{132}zA[2, 1] (\frac{x_{1}^{j_{1}+1}x_{2}^{j_{2}+1} − x_{1}^{j_{2}+1}x_{2}^{j_{2}+1}}{1 − x_{1}} ) z^{n}

+W t_{123}zA[1, 2] (\frac{x_{1}^{j_{2}}x_{2}^{j_{2}+1} − x_{1}^{j_{2}}x_{2}^{n+2}}{1 − x_{2}} ) z^{n}

This is what I called in [Z1] and its many sequels a “pre-umbra”. The above evolution can be expressed for a general monomial M(x_{1}, x_{2}, z) as:

M(x_{1}, x_{2}, z)A[1, 2] → t_{231}zA[2, 1] (\frac{x_{1}x_{2}M(1, x_{2}, z) − x_{1}x_{2}M(x_{1}, x_{2}, z)}{1 − x_{1}})

+t_{132}zA[2, 1] (\frac{x_{1}x_{2}M(x_{1}, x_{2}, z) − x_{1}x_{2}M(1, x_{1}x_{2}, z)}{1 − x_{1}})

+t_{123}zA[1, 2] (\frac{x_{2}M(1, x_{1}x_{2}, z) − x_{2}^{2}M(1, x_{1}, x_{2}, z}{1 − x_{2}} ) .

But by linearity this means that the coeff. of A[1,2] (the weight-enumerator of all permutations of state [1, 2] obeys the evolution equation:

f_{12}(x_{1}, x_{2}, z)A[1, 2] → t_{231}zA[2, 1] (\frac{x_{1}x_{2}f_{12}(1, x_{2}, z) − x_{1}x_{2}f_{12}(x_{1}, x_{2}, z)}{1 − x_{1}})

+t_{132}zA[2, 1] (\frac{x_{1}x_{2}f_{12}(x_{1}, x_{2}, z) − x_{1}x_{2}f_{12}(1, x_{1}x_{2}, z)}{1 − x_{1}})

+t_{123}zA[1, 2] (\frac{x_{2}f_{12}(1, x_{1}x_{2}, z) − x_{2}^{2}f_{12}(1, x_{1}, x_{2}z)}{1 − x_{2}}) .

Now we have to do it all over for a permutation in state [2, 1]. Suppose we are in state [2, 1], so our permutation looks like

π = […, j_{2}, j_{1}] ,

and w′(π) = w(π)x_{1}^{j_{1}}x_{2}^{j_{2}}z^{n}A[2, 1]. We want to append i (1 ≤ i ≤ n + 1) to the end. There are three cases: Case 1: 1 ≤ i ≤ j_{1} The new permutation, let’s call it σ, looks like

σ = [… j_{2} + 1, j_{1} + 1, i] .

Its state is [2, 1] and w′(σ) = w(π)t_{321}x_{1}^{i}x_{2}^{j_{1}+1}zA[2, 1]. Case 2: j_{1} + 1 ≤ i ≤ j_{2} The new permutation, let’s call it σ, looks like

σ = [… j_{2} + 1, j_{1}, i] .

Its state is also [1, 2] and w′(σ) = w(π)t_{312}x_{1}^{j_{1}}x_{2}^{i}zA[2, 1]. Case 3: j_{2} + 1 ≤ i ≤ n + 1 The new permutation, let’s call it σ, looks like

σ = [… j_{2}, j_{1}, i] .

Its state is now [1, 2] and w′(σ) = w(π)t_{213}x_{1}^{j_{1}}x_{2}^{i}zA[1, 2].

It follows that any individual permutation of size n, and state [2, 1], gives rise to n + 1 children, and regarding weight, we have the “umbral evolution” (here W is the fixed part of the weight, that does not change):

W x_{1}^{j_{1}}x_{2}^{j_{2}}z^{n}A[2, 1] → W t_{321}zA[2, 1] (∑_{i=1}^{j_{1}} x_{1}^{i}x_{2}^{j_{1}+1}) z^{n}

+W t_{312}zA[1, 2] ( ∑_{i=j_{1}+1}^{j_{2}} x_{1}^{j_{1}}x_{2}^{i}) z^{n}

+W t_{213}zA[1, 2] ( ∑_{i=j_{2}+1}^{n+1} x_{1}^{j_{1}}x_{2}^{i}) z^{n}

Taking out whatever we can out of the ∑-signs, we have:

W x_{1}^{j_{1}}x_{2}^{j_{2}}z^{n}A[2, 1] → W t_{321}zA[2, 1] (∑_{i=1}^{j_{1}} x_{1}^{i}) x_{2}^{j_{1}+1}z^{n}

+W t_{312}zA[1, 2] ( ∑_{i=j_{1}+1}^{j_{2}} x_{2}^{i}) x_{1}^{j_{1}}z^{n}

+W t_{213}zA[1, 2] ( ∑_{i=j_{2}+1}^{n+1} x_{2}^{i}) x_{1}^{j_{1}}z^{n} .

Now summing up the geometrical series, using the ancient formula:

∑_{i=a}^{b} Z^{i} = \frac{Z^{a} − Z^{b+1}}{1 − Z} ,

we get

W x_{1}^{j_{1}}x_{2}^{j_{2}}z^{n}A[2, 1] → W t_{321}zA[2, 1] (\frac{x_{1} − x_{1}^{j_{1}+1}}{1 − x_{1}} ) x_{2}^{j_{1}+1}z^{n}

+W t_{312}zA[1, 2] (\frac{x_{2}^{j_{1}+1} − x_{2}^{j_{2}+1}}{1 − x_{2}} ) x_{1}^{j_{1}}z^{n}

+W t_{213}zA[1, 2] (\frac{x_{2}^{j_{2}+1} − x_{2}^{n+2}}{1 − x_{2}} ) x_{1}^{j_{1}}z^{n}

This is the same as:

W x_{1}^{j_{1}}x_{2}^{j_{2}}z^{n}A[2, 1] → W t_{321}zA[2, 1] (\frac{x_{1}x_{2}^{j_{1}+1} − x_{1}^{j_{1}+1}x_{2}^{j_{1}+1}}{1 − x_{1}} ) z^{n}

+W t_{312}zA[1, 2] (\frac{x_{1}^{j_{1}}x_{2}^{j_{1}+1} − x_{1}^{j_{1}}x_{2}^{j_{2}+1}}{1 − x_{2}} ) z^{n}

+W t_{213}zA[1, 2] (\frac{x_{1}^{j_{1}}x_{2}^{j_{2}+1} − x_{1}^{j_{1}}x_{2}^{n+2}}{1 − x_{2}} ) z^{n}

The above evolution can be expressed for a general monomial M(x_{1}, x_{2}, z) as:

M(x_{1}, x_{2}, z)A[2, 1] → t_{321}zA[2, 1] (\frac{x_{1}x_{2}M(x_{2}, 1, z) − x_{1}x_{2}M(x_{1}x_{2}, 1, z)}{1 − x_{1}})

+t_{312}zA[1, 2] (\frac{x_{2}M(x_{1}x_{2}, 1, z) − x_{2}M(x_{1}, x_{2}, z)}{1 − x_{2}})

+t_{213}zA[1, 2] (\frac{x_{2}M(x_{1}, x_{2}, z) − x_{2}^{2}M(x_{1}, 1, x_{2}z}{1 − x_{2}} ) .

But by linearity this means that the coeff. of A[2,1] (the weight-enumerator of all permutations of state [2, 1] obeys the evolution equation:

f_{21}(x_{1}, x_{2}, z)A[2, 1] → t_{321}zA[2, 1] (\frac{x_{1}x_{2}f_{21}(x_{2}, 1, z) − x_{1}x_{2}f_{21}(x_{1}x_{2}, 1, z)}{1 − x_{1}})

+t_{312}zA[1, 2] (\frac{x_{2}f_{21}(x_{1}x_{2}, 1, z) − x_{2}f_{21}(x_{1}, x_{2}, z)}{1 − x_{2}})

+t_{213}zA[1, 2] (\frac{x_{2}f_{21}(x_{1}, x_{2}, z) − x_{2}^{2}f_{21}(x_{1}, 1, x_{2}z)}{1 − x_{2}}) .

Combining we have the “evolution”:

f_{12}(x_{1}, x_{2}, z)A[1, 2] + f_{21}(x_{1}, x_{2}, z)A[2, 1] →

t_{231}zA[2, 1] (\frac{x_{1}x_{2}f_{12}(1, x_{2}, z) − x_{1}x_{2}f_{12}(x_{1}, x_{2}, z)}{1 − x_{1}})

+t_{132}zA[2, 1] (\frac{x_{1}x_{2}f_{12}(x_{1}, x_{2}, z) − x_{1}x_{2}f_{12}(1, x_{1}x_{2}, z)}{1 − x_{1}})

+t_{123}zA[1, 2] (\frac{x_{2}f_{12}(1, x_{1}x_{2}, z) − x_{2}^{2}f_{12}(1, x_{1}, x_{2}z)}{1 − x_{2}}) .

+t_{321}zA[2, 1] (\frac{x_{1}x_{2}f_{21}(x_{2}, 1, z) − x_{1}x_{2}f_{21}(x_{1}x_{2}, 1, z)}{1 − x_{1}})

+t_{312}zA[1, 2] (\frac{x_{2}f_{21}(x_{1}x_{2}, 1, z) − x_{2}f_{21}(x_{1}, x_{2}, z)}{1 − x_{2}})

+t_{213}zA[1, 2] (\frac{x_{2}f_{21}(x_{1}, x_{2}, z) − x_{2}^{2}f_{21}(x_{1}, 1, x_{2}z)}{1 − x_{2}}) .

Now the “evolved” (new) f_{12}(x_{1}, x_{2}, z) and f_{21}(x_{1}, x_{2}, z) are the coeff. of A[1, 2], A[2, 1] respectively, and since the “initial weight of both” of them is x_{1}x^{2}z^{2}, we have the established the following system of functional equations:

f_{12}(x_{1}, x_{2}, z) = x_{1}x_{2}^{2}z^{2}+

t_{123}z (\frac{x_{2}f_{12}(1, x_{1}x_{2}, z) − x_{2}^{2}f_{12}(1, x_{1}, x_{2}z)}{1 − x_{2}}) +

+t_{312}z (\frac{x_{2}f_{21}(x_{1}x_{2}, 1, z) − x_{2}f_{21}(x_{1}, x_{2}, z)}{1 − x_{2}})

+t_{213}z (\frac{x_{2}f_{21}(x_{1}, x_{2}, z) − x_{2}^{2}f_{21}(x_{1}, 1, x_{2}z)}{1 − x_{2}}) ,

and

f_{21}(x_{1}, x_{2}, z) = x_{1}x_{2}^{2}z^{2}+

t_{231}z (\frac{x_{1}x_{2}f_{12}(1, x_{2}, z) − x_{1}x_{2}f_{12}(x_{1}, x_{2}, z)}{1 − x_{1}})

+t_{132}z (\frac{x_{1}x_{2}f_{12}(x_{1}, x_{2}, z) − x_{1}x_{2}f_{12}(1, x_{1}x_{2}, z)}{1 − x_{1}})

+t_{321}z (\frac{x_{1}x_{2}f_{21}(x_{2}, 1, z) − x_{1}x_{2}f_{21}(x_{1}x_{2}, 1, z)}{1 − x_{1}}) .

Let the computer do it!

All the above was only done for pedagogical reasons. The computer can do it all auomatically, much faster and more reliably. Now of we want to find functional equations for the number of permumations avoiding a given set of consecutive patterns P, all we have to do is plug-in t_{p} = 0 for pinP and t_{p} = 1 for p ∉ P. This gives a polynomial-time algorithm for computing any desired number of terms. This is all done automatically in the Maple package SERGI. See the webpage of this article for lots of sample input and output.

Outline of the Negative Approach (According to Brian Nakamura)

Suppose that we want to compute fast the first 100 terms (or whatever) of the sequence enumerating n-permutations avoiding the pattern 12 … 20. Using the “positive” approach, we would need to setup a system of functional equations with 19! power-series! While the algorithm is still polynomial in n, it is not very practical! (This is yet another illustation why the ruling paradigm in theoretical computer science, of equating “polynomial time” with “fast” is absurd).

This is analogous to computing words in a finite alphabet, say of a letters, avoiding a given word (or words) as factors (consecutive subwords). If the word-to-avoid has length k, then the naive transfer-matrix method would require to set-up a system of a^{k−1} equations and a^{k−1} unknowns.

The elegant and powerful Goulden-Jackson method [GJ1][GJ2], beautifully exposited and extended in [NZ], and even further extended in [KY] enables to do it with just solving one equation and one unknown. We assume that the reader is familiar with it, and briefly describe the analog for the present problem, where the alphabet is “infinite”. This is also the approach pursued in the beautiful human-generated papers [DK] and [KS]. I repeat that the focus and novelty in the present work of my students (and most of my work in at least the last ten years) is in automating enumeration (and the rest of mathematics), and the current topic of consecutive pattern-avoidance is used as a case-study.

One again, in order to illustate the method. I will use two specific, simple examples, (the patterns 321 and 231 already considered, using human ingenuity, in the pioneering paper [EN].) The general algorithm, written in Maple, is contained in the Maple package ELIZALDE. Out of laziness, so far, I only treat single patterns, but Brian Nakaumra’s [N] work deals with the general case.

But first generalities. For the sake of exposition, focusing on a single pattern p (the case of several patterns is analogous, see [DK]).

Using the inclusion-exclusion “negative” philosophy for counting, Fix a pattern p. For any npermutation, let P att_{p}(π) be the set of occurrences of the pattern p in π. For example

P att_{123}(179234568) = {179, 234, 345, 456, 568} ,
P att_{231}(179234568) = {792} ,
P att_{312}(179234568) = {923} ,
P att_{132} = P att_{213} = P att_{321} = ∅ .

consider the much larger set of pairs

{(π, S)|S is a a subset of P att_{p}(π)}

set of all permutations of length n, and define a new weight weight(π) := (t−1)^{#occurrencesofthepatternp}. For example, the

References

[B] Andrew Baxter, in preparation.

[DK] V. Dotsenko and A. Khoroshkin, Anick-type resolutions and consecutive pattern-avoidance, arXiv:1002.2761v1[Math.CO]

[EKP] Richard Ehrenborg, Sergey Kitaev, and Peter Perry, A Spectral Approach to Consecutive Pattern-Avoiding Permutations, arXiv: 1009.2119v1 [math.CO] 10 Sep 2010

[EN] Sergi Elizalde and Marc Noy, Consecutive patterns in permutations, Advances in Applied Mathematics 30 (2003), 110-125.

[EZ] Shalosh B. Ekhad, and D. Zeilberger, Using Rota’s Umbral Calculus to Enumerate Stanley’s P-Partitions, Advances in Applied Mathematics 41 (2008), 206-217.

[GJ1] I. Goulden and D.M. Jackson, An inversion theorem for cluster decompositions of sequences with distinguished subsequences, J. London Math. Soc.(2)20 (1979), 567-576.

[GJ2] I. Goulden and D.M. Jackson, ”Combinatorial Enumeration”, John Wiley, 1983, New York.

[KS] Anton Khoroshkin and Boris Shapiro, Using homological duality in consecutive pattern avoidance, arXiv:1009.5308v1 [math.CO].

[KY] Elizabeth J. Kupin, Debbie S. Yuster, Generalizations of the Goulden-Jackson Cluster Method, J. Difference Eq. Appl. 16 (2010), 1563-5120. (Also avialable in arXiv:0810.5113v1[math.CO].)

[N] Brian Nakamura, in preparation.

[NZ] John Noonan and Doron Zeilberger, The Goulden-Jackson Cluster Method: Extensions, Applications, and Implementations, J. Difference Eq. Appl. 5 (1999), 355-377.

[Z1] Doron Zeilbeger, The Umbral Transfer-Matrix Method I. Foundations, J. Comb. Theory, Ser. A 91 (2000), 451-463 .

[Z2] Doron Zeilbeger, The Umbral Transfer-Matrix Method. III. Counting Animals, New Journal of Mathematics 7(2001), 223-231 .

[Z3] Doron Zeilbeger, The Umbral Transfer-Matrix Method V. The Goulden-Jackson Cluster Method for Infinitely Many Mistakes, Integers 2 (2002), A5.

[Z4] Doron Zeilbeger, In How Many Ways Can You Reassemble Several Russian Dolls?, Personal

Journal of S.B. Ekhad and D. Zeilberger, http://www.math.rutgers.edu/~zeilberg/pj.html, Sept. 16,

2009.