Macaulay2 » Documentation
Packages » MatrixSchubert :: isPatternAvoiding
next | previous | forward | backward | up | index | toc

isPatternAvoiding -- whether a permutation avoids certain patterns, e.g. $2143$-avoiding or $312$- and $231$-avoiding

Synopsis

Description

Given a permutation, checks if the permutation is pattern-avoiding, e.g. $2143$-avoiding or $1432$-avoiding. For example, a permutation $w$ is $2143$-avoiding if there does not exist indices $i < j < k < l$ such that $w_j < w_i < w_l < w_k$.

i1 : w = {7,2,5,8,1,3,6,4}

o1 = {7, 2, 5, 8, 1, 3, 6, 4}

o1 : List
i2 : pattern2143 = {2,1,4,3}

o2 = {2, 1, 4, 3}

o2 : List
i3 : isPatternAvoiding(w, pattern2143)

o3 = false
i4 : v = {2,3,7,1,5,8,4,6}

o4 = {2, 3, 7, 1, 5, 8, 4, 6}

o4 : List
i5 : pattern1432 = {1,4,3,2}

o5 = {1, 4, 3, 2}

o5 : List
i6 : isPatternAvoiding(v, pattern1432)

o6 = false

Ways to use isPatternAvoiding :

For the programmer

The object isPatternAvoiding is a method function.