PartitionsAndPermutations¶
partperm.spad line 1 [edit on github]
PartitionsAndPermutations contains functions for generating streams of integer partitions, and streams of sequences of integers composed from a multi-set.
- conjugates: Stream List Integer -> Stream List Integer
conjugates(lp)
is the stream of conjugates of a stream of partitionslp
.
- distinct_partitions: (Integer, Integer, Integer) -> Stream List Integer
distinct_partitions(p, l, n)
is the stream of partitions ofn
into distinct numbers whose number of parts is no greater thanp
and whose largest part is no greater thanl
.
- distinct_partitions: Integer -> Stream List Integer
distinct_partitions(n)
is the stream of all partitions ofn
into distinct numbers.
- odd_partitions: (Integer, Integer, Integer) -> Stream List Integer
odd_partitions(p, l, n)
is the stream of partitions ofn
into odd numbers whose number of parts is no greater thanp
and whose largest part is no greater thanl
.
- odd_partitions: Integer -> Stream List Integer
odd_partitions(n)
is the stream of all partitions ofn
into odd numbers.
- partitions: (Integer, Integer) -> Stream List Integer
partitions(p, l)
is the stream of all partitions whose number of parts and largest part are no greater thanp
andl
.
- partitions: (Integer, Integer, Integer) -> Stream List Integer
partitions(p, l, n)
is the stream of partitions ofn
whose number of parts is no greater thanp
and whose largest part is no greater thanl
.
- permutations: Integer -> Stream List Integer
permutations(n)
is the stream of permutations formed from1, 2, 3, ..., n
.
- sequences: (List Integer, List Integer) -> Stream List Integer
sequences(l1, l2)
is the stream of all sequences that can be composed from the multiset defined from two lists of integersl1
andl2
. For example, the pair([1, 2, 4], [2, 3, 5])
represents multi-set with 12
, 23
's
, and 45
's
.
- sequences: List Integer -> Stream List Integer
sequences([l0, l1, l2, .., ln])
is the set of all sequences formed froml0
0's
,l1
1's
,l2
2's
, …,ln
n
's
.