combinat::permute
--
permutations of a list (deprecated)
combinat::permute
(list) computes all the reorderings of the given list
list
.
combinat::permute
(n) computes all the reorderings of the
list [1,2,...,n].
combinat::permute(n)
combinat::permute(list)
combinat::permute(list,Duplicate)
n | - | a nonnegative integer |
list | - | a list |
Duplicate | - | The result may contain identical lists if there are
duplicates in the given list list . |
A list of type DOM_LIST
containing
every reordered list as an element.
Duplicate
,
all lists in the result are distinct.There are exactly two ways of ordering two elements:
>> combinat::warnDeprecated(FALSE):
combinat::permute([a,b])
[[a, b], [b, a]]
The function combinat::permute
is deprecated:
>> old_val:=combinat::warnDeprecated(TRUE):
combinat::permute([a,b]);
combinat::warnDeprecated(old_val):
Warning: combinat::permute(l) is obsolete. Please use 'combinat::permutations::list(l)' instead. [combina\ t::permute] [[a, b], [b, a]]
Here is the recommended replacement:
>> combinat::permutations::list([a,b])
[[a, b], [b, a]]
An integer argument n is equivalent to the list of the first n integers.
>> combinat::permute(3)
[[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]
Here is the recommended replacement:
>> combinat::permutations::list(3)
[[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]
By default, one gets all distinct reorderings.
>> combinat::permute([a,a,b])
[[a, a, b], [a, b, a], [b, a, a]]
Here is the recommended replacement:
>> combinat::permutations::list([a,a,b])
[[a, a, b], [a, b, a], [b, a, a]]
But if one wants to get a list with duplicated reordered entries, this is also possible.
>> combinat::permute([a,a,b],Duplicate)
[[a, a, b], [a, b, a], [a, a, b], [a, b, a], [b, a, a], [b, a, a]]
Here is the recommended replacement:
>> combinat::permutations::list([a,a,b], Duplicate)
[[a, a, b], [a, b, a], [a, a, b], [a, b, a], [b, a, a], [b, a, a]]
Sets are not allowed as an argument.
>> combinat::permute({3,4})
Error: Wrong type of 1. argument (type 'Type::Union(Type::NonN\ egInt, DOM_LIST)' expected, got argument '{3, 4}'); during evaluation of 'combinat::permute'
MuPAD Combinat, an open source algebraic combinatorics package