combinat::chooseNK – Low level combinatorial class for the choices of k elements out of n without repetitions

combinat::chooseNK is a low level combinatorial class for choosing k elements between n without repetitions.

→ Examples

Superdomain

Dom::BaseDomain

Categories

Cat::CombinatorialClass, Cat::FacadeDomain(DOM_LIST)

See Also:

combinat::permutations

Details:

count – number of possibilities for choosing k elements out of n without repetitions

combinat::chooseNK::count(nonnegative integer math, nonnegative integer math)

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 math, nonnegative integer math)

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 math, nonnegative integer math)

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 math, nonnegative integer math)

Returns a random choice of k elements out of n without repetitions.

Complexity in time and memory: math (Floyd's algorithm).

Example 1:

Here is the list of all the choices of 2 elements out of [1,2,3,4,5] without repetitions:

    combinat::chooseNK(5,2)

math

Changes in MuPAD 4.0

New Function.