[Previous] [Next] [Contents]

SG::Perm2ListInv -- calculates the set of inversions of a permutation

Call(s)


SG::Perm2ListInv(perm)

Parameters

perm- any list denoting a permutation

Introduction

The SG::Perm2ListInv function calculates the list of all inversions of a permutation. The result is in lexicographic ordering.

The set of inversions is a set of pairs of positions (i,j) such that i<j and perm[j]<perm[i].

Example 1

>> muEC::SG::Perm2ListInv( [4,1,3,2] );
                     [{1, 2}, {1, 3}, {1, 4}, {3, 4}]

Related Functions

Perm2Length

[Previous] [Next] [Contents]


MuPAD Combinat, an open source algebraic combinatorics package