combinat::chooseNK is a low level combinatorial class for choosing k elements between n without repetitions.
Superdomain
Categories
Cat::CombinatorialClass, Cat::FacadeDomain(DOM_LIST)
See Also:
Details:
A choose of k elements out of n is a list of k distinct elements of [1,...,n], in any order.
This is a low-level combinatorial class, with a simplistic interface by design.
count – number of possibilities for choosing k elements out of n without repetitions
combinat::chooseNK::count(nonnegative integer , nonnegative integer )
Returns the number of chooses of k elements out of n without repetitions, that is binomial(n,k).
generator – generator for permutations
combinat::chooseNK::generator(nonnegative integer , nonnegative integer )
Returns a generator for the choices of k elements out of n without repetitions, in lexicographic order.
list – list of all the possible choices without repetitions
combinat::chooseNK::list(nonnegative integer , nonnegative integer )
Returns the list of all the choices of k elements out of n without repetitions, in lexicographic order.
random – random choice
combinat::chooseNK::random(nonnegative integer , nonnegative integer )
Returns a random choice of k elements out of n without repetitions.
Complexity in time and memory: (Floyd's algorithm).
Here is the list of all the choices of 2 elements out of [1,2,3,4,5] without repetitions:
combinat::chooseNK(5,2)
Changes in MuPAD 4.0
New Function.