setparts(4) # all partitions of a set of 4 elements
setparts(c(3,3,2)) # all partitions of a set of 8 elements
# into sets of sizes 3,3,2.
listParts(c(2,2,1)) # all 15 ways of defining subsets of
# {1,2,3,4,5} with sizes 2,2,1
jj <- restrictedparts(5,3)
setparts(jj) # partitions of a set of 5 elements into
# at most 3 sets
listParts(jj) # The induced equivalence classes
jj <- restrictedparts(6,3,TRUE)
setparts(jj) # partitions of a set of 6 elements into
ncol(setparts(jj)) # _exactly_ 3 sets; cf StirlingS2[6,3]==90
setparts(conjugate(jj)) # partitions of a set of 5 elements into
# sets not exceeding 3 elements
setparts(diffparts(5)) # partitions of a set of 5 elements into
# sets of different sizes
Run the code above in your browser using DataLab