Function Repository Resource:

SetPartitionRefinement

Source Notebook

Refine a partition of a set

Contributed by: Jack Heimrath, Wolfram|Alpha Math Team

ResourceFunction["SetPartitionRefinement"][part,piv]

returns the refinement of the partition part by the pivot piv.

ResourceFunction["SetPartitionRefinement"][part,{piv1,piv2,}]

returns the refinement of the partition part by the pivots pivi.

Details

The argument part must be a List of lists (i.e. it should be a partition of a set).

Examples

Basic Examples (2) 

Refine a given partition of a set:

In[1]:=
ResourceFunction[
 "SetPartitionRefinement"][{{a, b}, {c, d}, {e, f, g, h}}, {a, f, g}]
Out[1]=

Use more than one pivot:

In[2]:=
ResourceFunction[
 "SetPartitionRefinement"][{{a, b}, {c, d}, {e, f, g, h}}, {{a, f}, {g}}]
Out[2]=

Applications (1) 

Create the refined partition of a set based on a collection of partitions:

In[3]:=
set = {a, b, c, d, e, f, g};
partitions = {
   {{a, b, c}, {d, e, f, g}},
   {{a}, {b, c}, {d, e, f, g}},
   {{a, b}, {c, d}, {e, f}, {g}}
   };
ResourceFunction["SetPartitionRefinement"][{set}, Flatten[partitions, 1]]
Out[5]=

Possible Issues (3) 

The first argument must be a collection of sets, not a set:

In[6]:=
ResourceFunction["SetPartitionRefinement"][{a, b, c}, {a}]
Out[6]=
In[7]:=
ResourceFunction["SetPartitionRefinement"][{{a, b, c}}, {a}]
Out[7]=

The first argument need not be a valid partition:

In[8]:=
ResourceFunction["SetPartitionRefinement"][{{a, b}, {b, c}}, {c}]
Out[8]=

If a collection of sets contains elements with non-trivial intersection, using those particular elements as pivots will return an actual partition:

In[9]:=
ResourceFunction[
 "SetPartitionRefinement"][{{a, b}, {b, c, d}, {e, f}, {c, d, g}}, {{a, b}, {b, c, d}, {c, d, g}}]
Out[9]=

Publisher

Jack Heimrath

Version History

  • 1.0.0 – 16 September 2022

Related Resources

Author Notes

To view the full source code for SetPartitionRefinement, evaluate the following:

License Information