#Oct. 31, 2016, Dr. Z.'s Exp.Math. class C16.txt Help:=proc(): print(` IaB(L,a) , OneStepRS(T,a), RSK(pi), RSKv(pi), SameT(n)`): end: with(combinat): #IaB(L,a): inputs a (weakly) increasing sequence of positive integers, L, #and another integer a, places a in its right place,and outputs the #bumped entry or 0 (if a>=max(L)) [NewRow,BumpedEntry] IaB:=proc(L,a) local i: for i from 1 to nops(L) while L[i]nops(T2) then T2:=[op(T2),[i]]: else T2:=[op(1..richard-1,T2),[op(T2[richard]),i],op(richard+1..nops(T2),T2)]: fi: T1:=T1[1]: od: [T1,T2]: end: #RSKv(pi): Verbose version of RSK(pi) #applies the famous Robinson-Schensted (Knuth) correspondence to #to the perm. pi. The output is a pair [T1,T2] of Standard Young Tableaux of the #same shape RSKv:=proc(pi) local i,T1,T2,n,a,richard: n:=nops(pi): T1:=[]: T2:=[]: for i from 1 to n do print(`Right now T1 is`, T1): print(`and its shape is`, Shape(T1)): a:=pi[i]: T1:=OneStepRS(T1,a): richard:=T1[2]: if richard>nops(T2) then T2:=[op(T2),[i]]: else T2:=[op(1..richard-1,T2),[op(T2[richard]),i],op(richard+1..nops(T2),T2)]: fi: T1:=T1[1]: od: [T1,T2]: end: #Shape(T):The shape of the tableau Shape:=proc(T) local i: [seq(nops(T[i]),i=1..nops(T))]: end: #SameT(n): inputs a pos. integer n, and output the set of permutations that output [T1,T1] SameT:=proc(n) local S1,S2,pi: S1:=permute(n): S2:={}: for pi in S1 do if RSK(pi)[1]=RSK(pi)[2] then S2:=S2 union {pi}: fi: od: S2: end: