SG::Perm2Code
--
calculates the code of a permutation
SG::Perm2Code(perm)
perm | - | any list denoting a permutation |
The SG::Perm2Code
function calculates the Lehmer code of a permutation.
Let [c1, c2, ...] be the code of perm
, then
ci is equal to the number of
indices j>i such that
perm
[j]<perm
[i].
>> muEC::SG::Perm2Code( [4,1,5,2,3] );
[3, 0, 2, 0, 0]
>> muEC::SG::Code2Perm( % );
[4, 1, 5, 2, 3]
MuPAD Combinat, an open source algebraic combinatorics package