Macaulay2 » Documentation
Packages » Posets :: setPartition
next | previous | forward | backward | up | index | toc

setPartition -- computes the list of set-partitions of size $n$

Synopsis

Description

A set-partition of a List is a partitioning of the list into a finite number of non-empty disjoint pieces whose union is the original list.

i1 : setPartition {2,3,5}

o1 = {{{2, 3, 5}}, {{2, 3}, {5}}, {{2, 5}, {3}}, {{2}, {3, 5}}, {{2}, {3},
     ------------------------------------------------------------------------
     {5}}}

o1 : List

The set-partitions of $n$ is the collection of set-partitions of the set $\{1,\ldots,n\}$.

i2 : setPartition 4

o2 = {{{1, 2, 3, 4}}, {{1, 2, 3}, {4}}, {{1, 2, 4}, {3}}, {{1, 2}, {3, 4}},
     ------------------------------------------------------------------------
     {{1, 2}, {3}, {4}}, {{1, 3}, {2, 4}}, {{1, 3, 4}, {2}}, {{1, 3}, {2},
     ------------------------------------------------------------------------
     {4}}, {{1, 4}, {2, 3}}, {{1}, {2, 3, 4}}, {{1}, {2, 3}, {4}}, {{1, 4},
     ------------------------------------------------------------------------
     {2}, {3}}, {{1}, {2, 4}, {3}}, {{1}, {2}, {3, 4}}, {{1}, {2}, {3}, {4}}}

o2 : List

See also

Ways to use setPartition :

For the programmer

The object setPartition is a method function.