[Previous] [Next] [Contents]

SG::RandPerm -- returns a random permutation

Call(s)


SG::RandPerm(n <,type>)

Parameters

n- degree of a symmetric group (positive integer)

Options

type=dominant,grassmannian-

Introduction

The SG::RandPerm function generates a random permutation belonging to the symmetric group of degree n.

SG::RandPerm(n, dominant) returns a random dominant permutation.

SG::RandPerm(n, grassmannian) returns a random grassmannian permutation.

Example 1

>> muEC::SG::RandPerm( 7 );
                           [7, 4, 2, 3, 5, 1, 6]
>> muEC::SG::RandPerm( 20, dominant );
      [14, 11, 10, 12, 9, 6, 7, 5, 3, 4, 2, 8, 13, 15, 1, 16, 17,
      
         18, 19]
>> muEC::SG::Perm2Code( % );
        [13, 10, 9, 9, 8, 5, 5, 4, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0]

Related Functions

Perm2Code

[Previous] [Next] [Contents]


MuPAD Combinat, an open source algebraic combinatorics package