SG::Perm2Length
--
calculates the length of a permutation
SG::Perm2Length(perm)
perm | - | any list denoting a permutation |
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.
>> 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]
MuPAD Combinat, an open source algebraic combinatorics package