combinat::permutations::peaks --
Peaks of permutations
IntroductionFunctions related to the peaks of permutations
Details
peaks(permutation p)p, that is the list of integers i such that
p[i-1]<=p[i] and p[i]>p[i+1].
peaksNumber(permutation p)p.
Example 1The peaks of a permutation are computed as:
>> combinat::permutations::peaks([2, 1, 6, 4, 7, 3, 5])
[3, 5]
The number of peaks can be directly computed using:
>> combinat::permutations::peaksNumber([2, 1, 6, 4, 7, 3, 5])
2
MuPAD Combinat, an open source algebraic combinatorics package