Handbook
Glossary
combinations-with-replacement-quot ( seq k quot -- seq quot' )
Vocabulary
math
.
combinatorics
.
private
Inputs
seq
an
object
k
an
object
quot
an
object
Outputs
seq
an
object
quot'
an
object
Definition
USING:
arrays
kernel
sequences
;
IN:
math.combinatorics.private
::
combinations-with-replacement-quot
( seq k quot -- seq quot' )
seq
length
:>
n n k
nCk-with-replacement
<iota>
k 0
<array>
seq quot n
'[
drop
_
[
_
nths-unsafe
@
]
keep
_
next-combination-with-replacement
]
;
inline