Function Repository Resource:

FerrersDiagram

Source Notebook

Display the Ferrers diagram of a partition with dots

Contributed by: Wolfram Staff

ResourceFunction["FerrersDiagram"][p]

gives a ragged array of dots, with the number of dots in each row equal to a corresponding part of the integer partition p.

Details and Options

An integer partition of a positive integer n is a weakly decreasing list of positive integers that sum to n.

Examples

Basic Examples (2) 

Rows 1 to 4 have 5, 4, 2, 2 dots:

In[1]:=
ResourceFunction["FerrersDiagram"][{5, 4, 2, 2}]
Out[1]=

Here is a random choice of one of the 204,226 partitions of 50:

In[2]:=
Framed@ResourceFunction["FerrersDiagram"]@
  RandomChoice[IntegerPartitions@50]
Out[2]=

Publisher

George Beck

Version History

  • 1.0.0 – 23 May 2019

Related Resources

License Information