combinat::permutations::descents --
descents of permutations
IntroductionFunctions related to descents of permutations.
Details
descents(permutation p <, FinalDescent>)p, that is, the list of integers i such that
p[i]>p[i+1].
descentsNumber(permutation p <, FinalDescent>)p.
majorIndex(permutation p <, FinalDescent>)p,
that is the sum of the descents of p.
descentPolynomial(permutation p, variable z)p in
the variable z. It is the product of the monomials
z[p[1]]z[p[2]]...z[p[i]] for all descents i of the
permutation p.
descentsToMin(list or set s <, integer n>)s.n, when provided, specifies the size of the
returned permutation.
descentsToMax(list or set s <, integer n>)s.n, when provided, specifies the size of the
returned permutation.
descentsCompositionToMin(composition s)s.
Note that this minimal size corresponds to the sum of the entries of
s.
descentsCompositionToMax(composition s)s.
Note that this minimal size corresponds to the sum of the entries of
s.
fromDescents(list or set s <, integer n>)s.
Note that this minimal size corresponds to the greatest element in
s.n, when provided, specifies the size of the
returned permutation.
fromDescentsComposition(composition s)s.
Note that this minimal size corresponds to the sum of the entries of
s.
Example 1The descents of a permutation are computed as:
>> combinat::permutations::descents([2, 1, 6, 4, 7, 3, 5])
[1, 3, 5]
The sum of the descents is called the major index:
>> combinat::permutations::majorIndex([2, 1, 6, 4, 7, 3, 5])
9
It is the total degree of the descent polynomial, that is always a monomial on permutations:
>> combinat::permutations::descentPolynomial([2, 1, 6, 4, 7, 3, 5],z)
2 3 2
z[1] z[2] z[4] z[6] z[7]
Example 2To compute the smallest element of a descent class, you can use:
>> combinat::permutations::descentsToMin([2, 1, 5, 9], 12)
[3, 2, 1, 4, 6, 5, 7, 8, 10, 9, 11, 12]
To get the same result using ribbon shapes, one can write:
>> combinat::permutations::descentsCompositionToMin([1, 1, 3, 4, 3])
[3, 2, 1, 4, 6, 5, 7, 8, 10, 9, 11, 12]
To compute the greatest element of a descent class, you can use:
>> combinat::permutations::descentsToMax([2, 1, 5, 9], 12)
[12, 11, 8, 9, 10, 4, 5, 6, 7, 1, 2, 3]
To get the same result using ribbon shapes, one can write:
>> combinat::permutations::descentsCompositionToMax([1, 1, 3, 4, 3])
[12, 11, 8, 9, 10, 4, 5, 6, 7, 1, 2, 3]
Example 3To compute the list of permutations that have a given descent set, you can use:
>> combinat::permutations::fromDescents([3, 5, 1])
[[2, 1, 4, 3, 5], [2, 1, 5, 3, 4], [3, 1, 4, 2, 5],
[3, 1, 5, 2, 4], [3, 2, 4, 1, 5], [3, 2, 5, 1, 4],
[4, 1, 3, 2, 5], [4, 1, 5, 2, 3], [4, 2, 3, 1, 5],
[4, 2, 5, 1, 3], [4, 3, 5, 1, 2], [5, 1, 3, 2, 4],
[5, 1, 4, 2, 3], [5, 2, 3, 1, 4], [5, 2, 4, 1, 3],
[5, 3, 4, 1, 2]]
To get the same result using ribbon shapes, one can write:
>> combinat::permutations::fromDescentsComposition([1, 2, 2])
[[2, 1, 4, 3, 5], [2, 1, 5, 3, 4], [3, 1, 4, 2, 5],
[3, 1, 5, 2, 4], [3, 2, 4, 1, 5], [3, 2, 5, 1, 4],
[4, 1, 3, 2, 5], [4, 1, 5, 2, 3], [4, 2, 3, 1, 5],
[4, 2, 5, 1, 3], [4, 3, 5, 1, 2], [5, 1, 3, 2, 4],
[5, 1, 4, 2, 3], [5, 2, 3, 1, 4], [5, 2, 4, 1, 3],
[5, 3, 4, 1, 2]]
MuPAD Combinat, an open source algebraic combinatorics package