combinat::permutations::haspattern
--
Patterns on standard permutations
Functions related to patterns on standard permutations
hasPattern(standard permutations perm, patt)
patt
a pattern
appearing in perm
?''
patternPositions(standard permutations perm, patt)
patt
appears
in the standard permutations perm
.To check whether a permutation contains a given pattern, you can use:
>> combinat::permutations::hasPattern([3, 5, 1, 4, 6, 2], [1, 3, 2])
TRUE
To look at the positions where the pattern appears, you can ask:
>> combinat::permutations::patternPositions([3, 5, 1, 4, 6, 2], [1, 3, 2])
[[1, 2, 4], [3, 4, 6], [3, 5, 6]]
Ax::systemRep
MuPAD Combinat, an open source algebraic combinatorics package