Vocabularymath.
combinatoricsInputsm | a non-negative integer |
seq | a sequence |
k | a non-negative integer |
OutputsWord descriptionOutputs the
mth lexicographical combination of
seq choosing
k elements.
NotesCombinations are 0-based and a bounds error will be thrown if
m is larger than
seq length k nCk.
ExamplesUSING: math.combinatorics sequences prettyprint ;
6 7 <iota> 4 combination .
{ 0 1 3 6 }
USING: math.combinatorics prettyprint ;
0 { "a" "b" "c" "d" } 2 combination .
{ "a" "b" }
Definition