math.combinatorics vocabulary - Factor Documentation (original) (raw)

Summary
Permutations and combinations

Metadata

Parents: math
Tags: math
Authors: Slava Pestov, Doug Coleman, Aaron Schaefer

Words

Tuple classes

Class Superclass Slots
combinations tuple seq k length
k-permutations tuple length skip k seq
permutations tuple length seq

Ordinary words

Word Stack effect
( seq k -- combinations )
( seq k -- permutations )
( seq -- permutations )
all-combinations ( seq k -- seq' )
all-combinations-with-replacement ( seq k -- seq' )
all-combinations-with-replacement? ( ... seq k quot: ( ... elt -- ... ? ) -- ... ? )
all-combinations? ( ... seq k quot: ( ... elt -- ... ? ) -- ... ? )
all-permutations ( seq -- seq' )
all-permutations? ( ... seq quot: ( ... elt -- ... ? ) -- ... ? )
all-selections ( seq n -- seq' )
all-selections? ( seq n -- ? )
all-subsets ( seq -- subsets )
all-unique-combinations ( seq n -- seq' )
all-unique-permutations ( seq -- seq' )
combination ( m seq k -- seq' )
each-combination ( ... seq k quot: ( ... elt -- ... ) -- ... )
each-combination-with-replacement ( ... seq k quot: ( ... elt -- ... ) -- ... )
each-permutation ( ... seq quot: ( ... elt -- ... ) -- ... )
each-selection ( ... seq n quot: ( ... elt -- ... ) -- ... )
each-unique-permutation ( ... seq quot: ( ... elt -- ... ) -- ... )
factorial ( n -- n! )
filter-combinations ( ... seq k quot: ( ... elt -- ... ? ) -- ... newseq )
filter-combinations-with-replacement ( ... seq k quot: ( ... elt -- ... ? ) -- ... newseq )
filter-permutations ( ... seq quot: ( ... elt -- ... ? ) -- ... newseq )
filter-selections ( ... seq n quot: ( ... elt -- ... newelt ) -- ... newseq )
find-combination ( ... seq k quot: ( ... elt -- ... ? ) -- ... elt/f )
find-combination-with-replacement ( ... seq k quot: ( ... elt -- ... ? ) -- ... elt/f )
find-permutation ( ... seq quot: ( ... elt -- ... ? ) -- ... elt/f )
find-selection ( ... seq n quot: ( ... elt -- ... ? ) -- ... elt/f )
inverse-permutation ( seq -- permutation )
map-combinations ( ... seq k quot: ( ... elt -- ... newelt ) -- ... newseq )
map-combinations-with-replacement ( ... seq k quot: ( ... elt -- ... newelt ) -- ... newseq )
map-permutations ( ... seq quot: ( ... elt -- ... newelt ) -- ... newseq )
map-selections ( ... seq n quot: ( ... elt -- ... newelt ) -- ... newseq )
map>assoc-combinations ( ... seq k quot: ( ... elt -- ... key value ) exemplar -- ... assoc )
map>assoc-combinations-with-replacement ( ... seq k quot: ( ... elt -- ... key value ) exemplar -- ... assoc )
nCk ( n k -- nCk )
nPk ( n k -- nPk )
next-permutation ( seq -- seq )
permutation ( n seq -- seq' )
reduce-combinations ( ... seq k identity quot: ( ... prev elt -- ... next ) -- ... result )
reduce-combinations-with-replacement ( ... seq k identity quot: ( ... prev elt -- ... next ) -- ... result )
reduce-permutations ( ... seq identity quot: ( ... prev elt -- ... next ) -- ... result )
reduce-selections ( ... seq n identity quot: ( ... prev elt -- ... next ) -- ... result )

Class predicate words

Word Stack effect
combinations? ( object -- ? )
k-permutations? ( object -- ? )
permutations? ( object -- ? )

Files

resource:basis/math/combinatorics/combinatorics.factor
resource:basis/math/combinatorics/combinatorics-docs.factor
resource:basis/math/combinatorics/combinatorics-tests.factor

Metadata files

resource:basis/math/combinatorics/authors.txt
resource:basis/math/combinatorics/summary.txt
resource:basis/math/combinatorics/tags.txt

Children from resource:extra

Vocabulary Summary
math.combinatorics.bits Bitwise permutations