Handbook
Glossary
<combinations> ( seq k -- combinations )
Vocabulary
math
.
combinatorics
Inputs
seq
a
sequence
k
a non-negative integer
Outputs
combinations
a
sequence
Word description
An efficient sequence containing the combinations of
seq
choosing
k
elements.
Definition
USING:
kernel
sequences
;
IN:
math.combinatorics
:
<combinations>
( seq k -- combinations )
2dup
[
length
]
[
nCk
]
bi*
combinations
boa
;