SG::RandPerm
--
returns a random permutation
SG::RandPerm(n <,type>)
n | - | degree of a symmetric group (positive integer) |
type=dominant,grassmannian | - |
The SG::RandPerm
function generates a random permutation
belonging to the symmetric group of degree n
.
returns a random dominant permutation.
SG::RandPerm
(n, dominant)
returns a random grassmannian permutation.
SG::RandPerm
(n, grassmannian)
>> 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]
MuPAD Combinat, an open source algebraic combinatorics package