Function Repository Resource:

FerrersVennDiagram

Source Notebook

Generate a Venn-like diagram to compare the Ferrers diagrams of two integer partitions

Contributed by: George Beck

ResourceFunction["FerrersVennDiagram"][{x,y}]

gives the Ferrers-Venn diagram of the two integer partitions x and y.

Details

A partition of n is a list of weakly decreasing positive integers that add up to n. For instance, written compactly, these are the five partitions of 4: 4, 31, 2, 2 211, 1111.
The function FerrersVennDiagram is useful in visualizing bijections of sets of partitions.

Examples

Basic Examples

Here is a pair of integer partitions:

In[1]:=
{x, y} = {{6, 4, 3}, {5, 4, 3, 2}};

Here are their Ferrers diagrams:

In[2]:=
ResourceFunction[
ResourceObject[<|"Name" -> "FerrersDiagram", "ShortName" -> "FerrersDiagram", "UUID" -> "ff9f6ee9-e173-4868-997b-754fe2a50d9a", "ResourceType" -> "Function", "Version" -> "1.0.0", "Description" -> "Display the Ferrers diagram of a partition with dots", "RepositoryLocation" -> URL[
     "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"], "SymbolName" -> "FunctionRepository`$cfb969414cd645eaa8530fdec3494798`FerrersDiagram", "FunctionLocation" -> CloudObject[
     "https://www.wolframcloud.com/obj/bfd1afa3-668c-4583-9ee4-516df50e49c8"]|>, ResourceSystemBase -> Automatic]]@x
Out[2]=
In[3]:=
ResourceFunction[
ResourceObject[<|"Name" -> "FerrersDiagram", "ShortName" -> "FerrersDiagram", "UUID" -> "ff9f6ee9-e173-4868-997b-754fe2a50d9a", "ResourceType" -> "Function", "Version" -> "1.0.0", "Description" -> "Display the Ferrers diagram of a partition with dots", "RepositoryLocation" -> URL[
     "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"], "SymbolName" -> "FunctionRepository`$cfb969414cd645eaa8530fdec3494798`FerrersDiagram", "FunctionLocation" -> CloudObject[
     "https://www.wolframcloud.com/obj/bfd1afa3-668c-4583-9ee4-516df50e49c8"]|>, ResourceSystemBase -> Automatic]]@y
Out[3]=

Dots belong to x and empty circles to y:

In[4]:=
ResourceFunction["FerrersVennDiagram"]@{x, y}
Out[4]=

Here the order of the two partitions is reversed:

In[5]:=
ResourceFunction["FerrersVennDiagram"]@{y, x}
Out[5]=

Publisher

George Beck

Requirements

Wolfram Language 13.0 (December 2021) or above

Version History

  • 1.0.0 – 25 March 2024

Related Resources

License Information