Re: Any ideas on expanded results for SetPartitions in discrete-combinatoria
- To: mathgroup at smc.vnet.net
- Subject: [mg67062] Re: Any ideas on expanded results for SetPartitions in discrete-combinatoria
- From: Peter Pein <petsie at dordos.net>
- Date: Thu, 8 Jun 2006 04:53:55 -0400 (EDT)
- References: <e66600$n62$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Ike schrieb:
> Looking for suggestions...
>
> SetPartitions drops partitions that have "overlaps", any ideas on how to
> modify or recreate a SetPartitions function that doesn't drop these?
>
> For example
>
> SetPartitions[{A,B,C}]
>
> Generates:
>
>
> {{{A, B, C}}, {{A}, {B, C}}, {{A, B}, {C}}, {{A, C}, {B}}, {{A}, {B}, {C}}}
>
>
> What it is missing (for my needs) are the following:
>
> {{A,B}, {B, C}}, {{A,C}, {B, C}}, {{A,B}, {A, C}}, {{A,B}, {B, C},{A,C}}
>
> I have tried doing this:
>
> SetPartitions[{A,A,B,B,C,C}] which adds them but then I need a quick way
> to delete the subsets that have duplicate elemenets.
>
>
> Either way will get me where I need to be. But I can not figure it out.
>
> Thanks in advance for any help.
>
> Ike
> wde at pdx.edu
>
Hi Ike,
does
In[1]:=
Map[Union, SetPartitions[{A, A, B, B, C, C}], {0, 2}]
Out[1]=
{{{A, B, C}}, {{A}, {B, C}}, {{A}, {A, B, C}}, {{B}, {A, C}}, {{B}, {A, B, C}}, {{C}, {A, B}},
{{C}, {A, B, C}}, {{A, B}, {A, C}}, {{A, B}, {B, C}}, {{A, B}, {A, B, C}}, {{A, C}, {B, C}},
{{A, C}, {A, B, C}}, {{B, C}, {A, B, C}}, {{A}, {B}, {C}}, {{A}, {B}, {A, C}}, {{A}, {B}, {B, C}},
{{A}, {B}, {A, B, C}}, {{A}, {C}, {A, B}}, {{A}, {C}, {B, C}}, {{A}, {C}, {A, B, C}},
{{A}, {A, B}, {B, C}}, {{A}, {A, C}, {B, C}}, {{A}, {B, C}, {A, B, C}}, {{B}, {C}, {A, B}},
{{B}, {C}, {A, C}}, {{B}, {C}, {A, B, C}}, {{B}, {A, B}, {A, C}}, {{B}, {A, C}, {B, C}},
{{B}, {A, C}, {A, B, C}}, {{C}, {A, B}, {A, C}}, {{C}, {A, B}, {B, C}}, {{C}, {A, B}, {A, B, C}},
{{A, B}, {A, C}, {B, C}}, {{A}, {B}, {C}, {A, B}}, {{A}, {B}, {C}, {A, C}}, {{A}, {B}, {C}, {B, C}},
{{A}, {B}, {C}, {A, B, C}}, {{A}, {B}, {A, C}, {B, C}}, {{A}, {C}, {A, B}, {B, C}},
{{B}, {C}, {A, B}, {A, C}}}
give the desired result?
Peter