#Please do not post homework #Caroline Cote, March 29th, 2026, Assignment 16 HelpHW16:= proc(): print(`AntiRS(Pair)`): end: read "C16.txt": with(combinat): #Problem 1 #AntiRS(Pair): inputs a members SYTpairs(n) = [P,Q] and # outputs a permutation pi of {1,...,n} such that RS(pi) = [P,Q] AntiRS:= proc(Pair) local P, Q, n, i, j, k, eaea, pi, c: P:= Pair[1]: Q:= Pair[2]: n:= 0: for j from 1 to nops(P) do n:= n + nops(P[j]): od: i := n: while i >0 do for k from 1 to nops(Q) while Q[k][-1] <> i do od: eaea:= AntiRS1(P,k): P:= eaea[1]: pi[i]:= eaea[2]: if nops(Q[k])=1 then Q:= [op(1.. k-1, Q), op(k+1..nops(Q), Q)]: else Q:= [op(1..k-1, Q), [op(1..nops(Q[k]) -1, Q[k])], op(k+1.. nops(Q), Q)]: fi: i := i- 1: od: [seq(pi[i], i=1..n)]: end: #AntiRS1(Y, i): opposite of RS1 so inputs a row where the last element can be removed then unbumps #until the first row and then outputs the tableau without the number from row 1 AntiRS1:= proc(Y, i) local k,int,NewY, j, lucy: k:= nops(Y): int:= Y[i][-1]: if nops(Y[i]) = 1 then NewY:= [op(1..i-1, Y), op(i+1.. k, Y)]: else NewY:= [op(1.. i-1, Y), [op(1.. nops(Y[i])-1, Y[i])], op(i+1..k, Y)]: fi: j:= i-1: while j > 0 do lucy:= AntiRS11(NewY[j], int): NewY:= [op(1.. j-1, NewY), lucy[1], op(j+1 .. nops(NewY), NewY)]: int := lucy[2]: j:= j-1: od: NewY, int: end: #AntiRS11(L, i): inputs an increasing list L and integer i and finds the rightmost entry # that is < i then bump it for i and outputs the new row and the bumpee AntiRS11 :=proc(L,i) local j,k: k:= nops(L): j:= k: while L[j] >= i do j:= j-1: od: [op(1..j-1, L), i , op(j+1.. k, L)], L[j]: end: {seq(seq(evalb(AntiRS(RS(pi))= pi), pi in permute(n)),n=2..7)}; # {true} {seq(seq(evalb(RS(AntiRS(s))=s), s in SYTpairs(n)), n = 2..7)}; # {true} #problem 2 #inverse permutation with ListTools with(ListTools): {seq(seq(evalb(RS(InversePermutation(pi)) = [RS(pi)[2], RS(pi)[1]]), pi in permute(n)), n=1..7)}; # {true}