[Previous] [Next] [Contents]

## `SG::Perm2Length` -- calculates the length of a permutation

#### Call(s)

`SG::Perm2Length(perm)`

#### Parameters

`perm` | - | any list denoting a permutation

#### Introduction

The `SG::Perm2Length` function calculates the length of the permutation `perm`, that is its number of inversions. This is also the minimal length of an expression of the permutation as a product of simple transpositions, as well as the sum of the components of its code.

#### Example 1

    >> muEC::SG::Perm2Length( [5,3,2,1,4] );

                                         7

    >> muEC::SG::Perm2Rd( [5,3,2,1,4] );

                               [4, 3, 2, 1, 3, 2, 3]

    >> muEC::SG::Perm2Code( [5,3,2,1,4] );

                                  [4, 2, 1, 0, 0]

#### Related Functions

`Perm2Code`, `Perm2Rd`

[Previous] [Next] [Contents]

MuPAD Combinat, an open source algebraic combinatorics package