Vocabularymath.
combinatoricsInputsOutputsWord descriptionOutputs the
nth lexicographical permutation of
seq.
NotesPermutations are 0-based and a bounds error will be thrown if
n is larger than
seq length factorial 1 -.
ExamplesUSING: math.combinatorics prettyprint ;
1 { 0 1 2 } permutation .
{ 0 2 1 }
USING: math.combinatorics prettyprint ;
5 { "apple" "banana" "orange" } permutation .
{ "orange" "banana" "apple" }
Definition