I tried the following (inspired by the answer here)
myList = {a, b, c};
Needs["Combinatorica`"];
SetPartitions[myList]
and I got this answer,
{{{a, b, c}}, {{a}, {b, c}}, {{a, b}, {c}}, {{a,c}, {b}}, {{a}, {b}, {c}}}
I checked the documentation of KSetpartitions also.
- But where and how do I specify it if I say want only partitions in say parts of size 2 (Wick's theorem!) ? (..of course it will have to give a null result if the total number of elements of the starting set is an odd number..)
Partition[myList, 2]? – wxffles May 16 '13 at 01:55