Skip to content

Partition of a set

2 messages · Diana, Michael Bedward

#
Hi

I am new on this forum. I am searching for a function in R which provides
all partitions of a set, say for the set
{1,2,3}
you get
{{1,2,3}}
{1,{2,3}}
{2,{1,3}}
{3,{1,2}}
{{1},{2},{3}}
. The number of partitions of a set is given by Bellsche`s number. The
number of possibilities of length (this is the number of subsets included in
the partition) of the partition is given by the partition function.
But I need a list containg all possible partitions of an index set
{1,...,d}, d arbitrary.

I have already looked at the FAQs but I did not found. Sorry.

Can anybody help me?

Thanks a lot!
Diana Tichy
#
Hi Diana,

Have a look at the setparts function in the partitions package.

Michael
On 12 November 2010 20:03, Diana <d.tichy at mathematik.uni-wuerzburg.de> wrote: