ACE BN BNA CG CLG COMP FM FREE HEKA IDCA NCA NCSF PART SFA SG SGA SP SYMF TAB TYP

FUNCTION: ListPerm - generate all permutations

CALLING SEQUENCE:

ListPerm(n)
ListPerm(l)
SG[ListPerm](n)
SG[ListPerm](l)

PARAMETERS:

n = any positive integer denoting the degree of a symmetric group
l = any list or set of elements

SYNOPSIS:

EXAMPLES:


> with(SG):
> ListPerm([2,2,4]);
 
                      [[2, 2, 4], [2, 4, 2], [4, 2, 2]]
 
> ListPerm(3, 'cixel');
 
     [[3, 2, 1], [2, 3, 1], [3, 1, 2], [1, 3, 2], [2, 1, 3], [1, 2, 3]]
 
> ListPerm(3, 'level');
 
                   [[[1, 2, 3]], [[1, 3, 2], [2, 1, 3]],
 
                    [[3, 1, 2], [2, 3, 1]], [[3, 2, 1]]]
 
> ListPerm(3, 'level', 'code');
 
                   [[[0, 0, 0]], [[0, 1, 0], [1, 0, 0]],
 
                    [[2, 0, 0], [1, 1, 0]], [[2, 1, 0]]]
 
> ListPerm(4, 'vexillary', 'nb');
 
                                  23
 
> ListPerm(5, 'vexillary', 'nb', 'level');
 
                    [1, 4, 6, 11, 16, 18, 18, 15, 9, 4, 1]
 
> ListPerm(5, 'nb', 'level');
 
                    [1, 4, 9, 15, 20, 22, 20, 15, 9, 4, 1]
 

SEE ALSO: GenPerm TYP[IsPerm]