[Previous] [Next] [Contents]

## `SG::Perm2Desc` -- computes the list of descents of a permutation

#### Call(s)

`SG::Perm2Desc(perm <,nb,maj,comaj>)`

#### Parameters

`perm` | - | any list denoting a permutation
`nb` | - | only counts objects
`maj` | - | sum of descent positions
`comaj` | - | sum of all values

#### Introduction

The `SG::Perm2Desc` function computes the list of descents of the permutation `perm`, i.e. the list of positions i, such that `perm`[i] > `perm`[i+1].

When called with the second argument `maj`, it returns the sum of the descent positions.

When called with the second argument `comaj`, it returns the sum of all values (`n` - descent position), where `n` is equal to `nops(perm)`.

#### Example 1

    >> muEC::SG::Perm2Desc( [3,1,4,2,6,5,7] );

                                     [1, 3, 5]

    >> muEC::SG::Perm2Desc( [3,1,4,2,6,5,7], nb );

                                         3

    >> muEC::SG::Perm2Desc( [3,1,4,2,6,5,7], maj );

                                         9

    >> muEC::SG::Perm2Desc( [3,1,4,2,6,5,7], comaj );

                                        12

#### Related Functions

`Perm2Rise`

[Previous] [Next] [Contents]

MuPAD Combinat, an open source algebraic combinatorics package