A Young rectangle is a specialization of a Young tableau. It consists of an rectangular arrangement of the integers such that each row is increasing from left to right and each column from top to bottom. In a permutation of the integers precedes if and only if in the inverse permutation . Consequently, specifying that means that, in all the inverse permutations, the value in position is less than that in position .
Label the cells of a 3x2 matrix as shown.
If an inverse permutation meets the requirement of the Young rectangle, the corresponding relations are
Construct the iterator; use the inverse option to generate the inverse permutations.
Generate and display the results as Matrices. Use ArrayTools[Alias] to create a 3x2 Matrix representation of the Vector output.
Assign a procedure that counts Young rectangles of a given size.
>
|
YoungNum := proc(m::nonnegint,n::nonnegint)
local i,j,pos,rels,Y;
pos := (i,j) -> (i-1)*n+j;
rels := {seq(seq(pos(i,j) < pos(i,j+1), j=1..n-1), i=1..m),
seq(seq(pos(i,j) < pos(i+1,j), i=1..m-1), j=1..n)
};
Y := Iterator:-TopologicalSorts(m*n, rels);
add(1, y=Y);
end proc:
|