Permutation pattern explained

In combinatorial mathematics and theoretical computer science, a (classical) permutation pattern is a sub-permutation of a longer permutation. Any permutation may be written in one-line notation as a sequence of entries representing the result of applying the permutation to the sequence 123...; for instance the sequence 213 represents the permutation on three elements that swaps elements 1 and 2. If π and σ are two permutations represented in this way (these variable names are standard for permutations and are unrelated to the number pi), then π is said to contain σ as a pattern if some subsequence of the entries of π has the same relative order as all of the entries of σ.

For instance, permutation π contains the pattern 213 whenever π has three entries x, y, and z that appear within π in the order x...y...z but whose values are ordered as y < x < z, the same as the ordering of the values in the permutation 213.

The permutation 32415 on five elements contains 213 as a pattern in several different ways: 3··15, ··415, 32··5, 324··, and ·2·15 all form triples of entries with the same ordering as 213. Note that the entries do not need to be consecutive. Each of the subsequences 315, 415, 325, 324, and 215 is called a copy, instance, or occurrence of the pattern. The fact that π contains σ is written more concisely as σ ≤ π.

If a permutation π does not contain a pattern σ, then π is said to avoid σ. The permutation 51342 avoids 213; it has ten subsequences of three entries, but none of these ten subsequences has the same ordering as 213.

Early results

A case can be made that was the first to prove a result in the field with his study of "lattice permutations".[1] In particular MacMahon shows that the permutations which can be divided into two decreasing subsequences (i.e., the 123-avoiding permutations) are counted by the Catalan numbers.[2]

Another early landmark result in the field is the Erdős–Szekeres theorem; in permutation pattern language, the theorem states that for any positive integers a and b every permutation of length at least

(a-1)(b-1)+1

must contain either the pattern

1,2,3,...,a

or the pattern

b,b-1,...,2,1

.

Computer science origins

The study of permutation patterns began in earnest with Donald Knuth's consideration of stack-sorting in 1968.[3] Knuth showed that the permutation π can be sorted by a stack if and only if π avoids 231, and that the stack-sortable permutations are enumerated by the Catalan numbers.[4] Knuth also raised questions about sorting with deques. In particular, Knuth's question asking how many permutation of n elements are obtainable with the use of a deque remains open.[5] Shortly thereafter, investigated sorting by networks of stacks,[6] while showed that the permutation π can be sorted by a deque if and only if for all k, π avoids 5,2,7,4,...,4k+1,4k-2,3,4k,1, and 5,2,7,4,...,4k+3,4k,1,4k+2,3, and every permutation that can be obtained from either of these by interchanging the last two elements or the 1 and the 2.[7] Because this collection of permutations is infinite (in fact, it is the first published example of an infinite antichain of permutations), it is not immediately clear how long it takes to decide if a permutation can be sorted by a deque. later presented a linear (in the length of π) time algorithm which determines if π can be sorted by a deque.[8]

In his paper, Pratt remarked that this permutation pattern order “seems to be the only partial order on permutation that arises in a simple and natural way” and concludes by noting that “from an abstract point of view”, the permutation pattern order “is even more interesting than the networks we were characterizing”.[7]

Enumerative origins

See main article: article and Enumerations of specific permutation classes. A prominent goal in the study of permutation patterns is in the enumeration of permutations avoiding a fixed (and typically short) permutation or set of permutations. Let Avn(B) denote the set of permutations of length n which avoid all of the permutations in the set B. (In the case B is a singleton, say, the abbreviation Avn(β) is used instead.) As noted above, MacMahon and Knuth showed that |Avn(123)| = |Avn(231)| = Cn, the nth Catalan number. Thus these are isomorphic combinatorial classes.

was the first paper to focus solely on enumeration. Among other results, Simion and Schmidt counted even and odd permutations avoiding a pattern of length three, counted permutations avoiding two patterns of length three, and gave the first bijective proof that 123- and 231-avoiding permutations are equinumerous.[9] Since their paper, many other bijections have been given, see for a survey.[10]

In general, if |Avn(β)| = |Avn(σ)| for all n, then β and σ are said to be Wilf-equivalent. Many Wilf-equivalences stem from the trivial fact that |Avn(β)| = |Avn(β-1)| = |Avn(βrev)| for all n, where β-1 denotes the inverse of β and βrev denotes the reverse of β. (These two operations generate the Dihedral group D8 with a natural action on permutation matrices.) However, there are also numerous examples of nontrivial Wilf-equivalences (such as that between 123 and 231):

From these two Wilf-equivalences and the inverse and reverse symmetries, it follows that there are three different sequences |Avn(β)| where β is of length four:

β sequence enumerating Avn(β) OEIS reference exact enumeration reference
 1342  1, 2, 6, 23, 103, 512, 2740, 15485, 91245, 555662, ... [14]
 1234  1, 2, 6, 23, 103, 513, 2761, 15767, 94359, 586590, ... [15]
 1324  1, 2, 6, 23, 103, 513, 2762, 15793, 94776, 591950, ... unenumerated

In the late 1980s, Richard Stanley and Herbert Wilf conjectured that for every permutation β, there is some constant K such that |Avn(β)| < Kn. This was known as the Stanley–Wilf conjecture until it was proved by Adam Marcus and Gábor Tardos.[16]

Closed classes

See main article: Permutation class. A closed class, also known as a pattern class, permutation class, or simply class of permutations is a downset in the permutation pattern order. Every class can be defined by the minimal permutations which do not lie inside it, its basis. Thus the basis for the stack-sortable permutations is, while the basis for the deque-sortable permutations is infinite. The generating function for a class is Σ x|π| where the sum is taken over all permutations π in the class.

Möbius function

As the set of permutations under the containment order forms a poset it is natural to ask about its Möbius function, a goal first explicitly presented by .[17] The goal in such investigations is to find a formula for the Möbius function of an interval [σ, π] in the permutation pattern poset which is more efficient than the naïve recursive definition. The first such result was established by, who gave a formula for the Möbius function of an interval of layered permutations.[18] Later, generalized this result to intervals of separable permutations.[19]

It is known that, asymptotically, at least 39.95% of all permutations π of length n satisfy μ(1, π)=0 (that is, the principal Möbius function is equal to zero), but for each n there exist permutations π such that μ(1, π) is an exponential function of n.

Computational complexity

Given a permutation

\tau

(called the text) of length

n

and another permutation

\pi

of length

k

(called the pattern), the permutation pattern matching (PPM) problem asks whether

\pi

is contained in

\tau

. When both

n

and

k

are regarded as variables, the problem is known to be NP-complete, and the problem of counting the number of such matches is
  1. P-complete
. However, PPM can be solved in linear time when k is a constant. Indeed, Guillemot and Marx[20] showed that PPM can be solved in time
O(k2logk)
2

n

, meaning that it is fixed-parameter tractable with respect to

k

.

There are several variants on the PPM problem, as surveyed by Bruner and Lackner. For example, if the match is required to consist of contiguous entries then the problem can be solved in polynomial time. A different natural variant is obtained when the pattern is restricted to a proper permutation class

l{C}

. This problem is known as

l{C}

-Pattern PPM and it was shown to be polynomial-time solvable for separable permutations. Later, Jelínek and Kynčl[21] completely resolved the complexity of

Av(\sigma)

-Pattern PPM by showing that it is polynomial-time solvable when

\sigma

is equal to one of 1, 12, 21, 132, 231, 312 or 213 and NP-complete otherwise.

Another variant is when both the pattern and text are restricted to a proper permutation class

l{C}

, in which case the problem is called

l{C}

-PPM. For example, Guillemot and Vialette showed that

Av(321)

-PPM could be solved in

O(k2n6)

time. Albert, Lackner, Lackner, and Vatter later lowered this to

O(kn)

and showed that the same bound holds for the class of skew-merged permutations. They further asked if the

l{C}

-PPM problem can be solved in polynomial time for every fixed proper permutation class

l{C}

. This question was answered negatively by Jelínek and Kynčl who showed that

Av(4321)

-PPM is in fact NP-complete. Later, Jelínek, Opler, and Pekárek[22] showed that

Av(\sigma)

-PPM is NP-complete for any

\sigma

of length at least 4 not symmetric to one of 3412, 3142, 4213, 4123 or 41352.

Packing densities

The permutation π is said to be β-optimal if no permutation of the same length as π has more copies of β. In his address to the SIAM meeting on Discrete Mathematics in 1992, Wilf defined the packing density of the permutation β of length k as

\limn → infty

numberofcopiesof\betaina\beta-optimalpermutationoflengthn
\displaystyle{n\choosek
}.

An unpublished argument of Fred Galvin shows that the quantity inside this limit is nonincreasing for nk, and so the limit exists. When β is monotone, its packing density is clearly 1, and packing densities are invariant under the group of symmetries generated by inverse and reverse, so for permutations of length three, there is only one nontrivial packing density. Walter Stromquist (unpublished) settled this case by showing that the packing density of 132 is, approximately 0.46410.

For permutations β of length four, there are (due to symmetries) seven cases to consider:

β packing density reference
 1234  1 trivial
 1432  root of [23]
 2143 
 1243  [24]
 1324  conjectured to be
 1342  conjectured to be
 2413  conjectured to be

For the three unknown permutations, there are bounds and conjectures. used an approximation algorithm which suggests that the packing density of 1324 is around 0.244.[23] Birzhan Batkeyev (unpublished) constructed a family of permutations showing that the packing density of 1342 is at least the product of the packing densities of 132 and 1432, approximately 0.19658. This is conjectured to be the precise packing density of 1342. provided a lower bound on the packing density of 2413. This lower bound, which can be expressed in terms of an integral, is approximately 0.10474, and conjectured to be the true packing density.[25]

Superpatterns

See main article: article and Superpattern. A k-superpattern is a permutation that contains all permutations of length k. For example, 25314 is a 3-superpattern because it contains all 6 permutations of length 3. It is known that k-superpatterns must have length at least k2/e2, where e ≈ 2.71828 is Euler's number,[26] and that there exist k-superpatterns of length ⌈(k2 + 1)/2⌉.This upper bound is conjectured to be best possible, up to lower-order terms.[27]

Generalizations

The type of pattern defined above, in which entries do not need to occur consecutively, is called a classical (permutation) pattern.If the entries are required to be consecutive, then the pattern is called a consecutive pattern.

There are several ways in which the notion of "pattern" has been generalized. For example, a vincular pattern is a permutation containing dashes indicating which adjacent pairs of entries need not occur consecutively. For example, the permutation 314265 has two copies of the dashed pattern 2-31-4, given by the entries 3426 and 3425. For a dashed pattern β and any permutation π, we write β(π) for the number of copies of β in π. Thus the number of inversions in π is 2-1(π), while the number of descents is 21(π). Going further, the number of valleys in π is 213(π) + 312(π), while the number of peaks is 231(π) + 132(π). These patterns were introduced by, who showed that almost all known Mahonian statistics could be expressed in terms of vincular permutations.[28] For example, the Major index of π is equal to 1-32(π) + 2-31(π) + 3-21(π) + 21(π).

Another generalization is that of a barred pattern, in which some of the entries are barred. For π to avoid the barred pattern β means that every set of entries of π which form a copy of the nonbarred entries of β can be extended to form a copy of all entries of β. introduced these types of patterns in his study of permutations which could be sorted by passing them twice through a stack.[29] (Note that West's definition of sorting twice through a stack is not the same as sorting with two stacks in series.) Another example of barred patterns occurs in the work of, who showed that the Schubert variety corresponding to π is locally factorial if and only if π avoids 1324 and 21

354.[30]

External links

A conference on permutation patterns has been held annually since 2003:

  1. Permutation Patterns 2003, February 10–14, 2003, University of Otago, Dunedin, New Zealand.
  2. Permutation Patterns 2004, July 5–9, 2004, Malaspina University-College, Nanaimo, British Columbia, Canada.
  3. Permutation Patterns 2005, March 7–11, 2005, University of Florida, Gainesville, Florida, USA.
  4. Permutation Patterns 2006, June 12–16, 2006, Reykjavík University, Reykjavík, Iceland.
  5. Permutation Patterns 2007, June 11–15, 2007, University of St. Andrews, St. Andrews, Scotland.
  6. Permutation Patterns 2008, June 16–20, 2008, University of Otago, Dunedin, New Zealand.
  7. Permutation Patterns 2009, July 13–17, 2009, Università di Firenze, Florence, Italy.
  8. Permutation Patterns 2010, August 9–13, 2010, Dartmouth College, Hanover, New Hampshire, USA.
  9. Permutation Patterns 2011, June 20–24, 2011, California Polytechnic State University, San Luis Obispo, California, USA.
  10. Permutation Patterns 2012, June 11–15, 2012, University of Strathclyde, Glasgow, Scotland.
  11. Permutation Patterns 2013, July 1–5, 2013, Université Paris Diderot, Paris, France.
  12. Permutation Patterns 2014, July 7–11, 2014, East Tennessee State University, Johnson City, Tennessee, USA.
  13. Permutation Patterns 2015, June 15–19, 2015, De Morgan House, London, England.
  14. Permutation Patterns 2016, June 27–July 1, 2016, Howard University, Washington, DC, USA.
  15. Permutation Patterns 2017, June 26–30, 2017, Reykjavík University, Reykjavík, Iceland.
  16. Permutation Patterns 2018, July 9–13, 2018, Dartmouth College, Hanover, New Hampshire, USA.
  17. Permutation Patterns 2019, June 17–21, 2019, Universität Zürich, Zürich, Switzerland.
  18. Permutation Patterns 2020 Virtual Workshop, June 30–July 1, 2020, hosted by Valparaiso University, Valparaiso, Indiana, USA.
  19. Permutation Patterns 2021 Virtual Workshop, June 15–16, 2021, hosted by University of Strathclyde, Glasgow, Scotland.
  20. Permutation Patterns 2022, June 20-24, 2022, Valparaiso University, Valparaiso, Indiana, USA.
  21. Permutation Patterns 2023, July 3-7, 2023, University of Burgundy, Dijon, France.

American Mathematical Society Special Sessions on Patterns in Permutations have been held at the following meetings:

Other permutation patterns meetings:

Other links:

Notes and References

  1. .
  2. , Items 97 and 98.
  3. .
  4. , Section 2.2.1, Exercises 4 and 5.
  5. , Section 2.2.1, Exercise 13, rated M49 in the first printing, and M48 in the second.
  6. .
  7. .
  8. .
  9. .
  10. .
  11. .
  12. .
  13. .
  14. .
  15. .
  16. .
  17. .
  18. .
  19. .
  20. Guillemot. Sylvain. Marx, Daniel. Finding small patterns in permutations in linear time. Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms. 2014. 20. 10.1137/1.9781611973402.7. 1307.3073. 978-1-61197-338-9. 1846959.
  21. Hardness of Permutation Pattern Matching. Vít. Jelínek. Jan. Kynčl. 2017. Proceedings of the Twenty-Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2017, Barcelona, Spain, Hotel Porta Fira, January 16-19. SIAM. 378–396. 1608.00529. 10.1137/1.9781611974782.24.
  22. Griddings of Permutations and Hardness of Pattern Matching. Vít. Jelínek. Michal. Opler. Jakub. Pekárek. 2021. 46th International Symposium on Mathematical Foundations of Computer Science, MFCS 2021, August 23-27, 2021, Tallinn, Estonia. Schloss Dagstuhl - Leibniz-Zentrum für Informatik. 2. 65:1–65:22. 2107.10897. 10.4230/LIPIcs.MFCS.2021.65. free .
  23. .
  24. .
  25. .
  26. .
  27. .
  28. .
  29. .
  30. .