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};
i2 : pattern2143 = {2,1,4,3};
i3 : isPatternAvoiding(w, pattern2143)

o3 = false
i4 : v = {2,3,7,1,5,8,4,6};
i5 : pattern1432 = {1,4,3,2};
i6 : isPatternAvoiding(v, pattern1432)

o6 = false
i7 : isPatternAvoiding({3,1,2},{3,1,2})

o7 = false

Ways to use isPatternAvoiding:

For the programmer

The object isPatternAvoiding is a method function.