Wolfram Research

HookLengths

Contributed by: George Beck

Source Notebook

Get the list of lists whose entries are the hook lengths of the entries of a Young diagram

ResourceFunction["HookLengths"][p]

gives a list of lists of lengths p, for a partition p, where an entry is the hook length of the corresponding cell in the Young diagram of p.

Details and Options

In the Young diagram of shape p, the hook for a cell c is the set of cells containing c, the cells to the right of c and the cells below c.
The hook length of a cell c is the number of cells in the hook of c.

Examples

Basic Examples

Here is a partition :

In[1]:=
p = {5, 3, 1, 1};

This is its Ferrers diagram:

In[2]:=
Grid[Table["\[FilledCircle]", #] & /@ p]
Out[2]=

These are the hook lengths for the shape p:

In[3]:=
ResourceFunction["HookLengths"]@p
Out[3]=

This is used to format a Young diagram:

In[4]:=
formatyoungdiagram[p_] := Module[
  {mat, mmax, nmax},
  mat = PadRight[Table[1, #] & /@ p];
  {mmax, nmax} = Dimensions@mat;
  Frame -> {None, None, Select[Flatten[
      Table[{m, n} -> mat[[m, n]] == 1, {m, mmax}, {n, nmax}]], True == Last@# &]}
  ]

The Young diagram with shape p:

In[5]:=
Grid[Table[" ", #] & /@ p, formatyoungdiagram@p]
Out[5]=

A hook of length 5:

In[6]:=
Grid[PadRight@{{" ", "x", "x", "x", "x"}, {" ", "x", " "}, {" "}, {" "}} /. 0 -> "", formatyoungdiagram@p]
Out[6]=

The hook lengths of p:

In[7]:=
Grid[PadRight@ResourceFunction["HookLengths"]@p /. 0 -> "", formatyoungdiagram@p]
Out[7]=

Applications

The number of standard Young tableaux for the diagram of shape p:

In[8]:=
Total[p]!/Times @@ Flatten[ResourceFunction["HookLengths"]@p]
Out[8]=

Resource History