#Please do not post HW #Caroline Cote, March 29th, 2026, Assignment 17 HelpHW17:= proc(): print(``): end: read "C17.txt": #problem 1 #RandSYT(L): inputs a partition L and outputs a uniformly-at-random standard Young Tableau of #shape L, by implementing the Greene-Nijenhuis-Wilf proof of the Hook-Lenght formula RandSYT := proc(L) local n, c, L1,Y,i : if L = [] then RETURN([]): fi: n:= add(L[i], i=1..nops(L)): c := OneTrial(L): L1:= RemoveCorner(L, c): Y := RandSYT(L1): i := c[1]: if i <= nops(Y) then Y:= [op(1..i-1, Y), [op(Y[i]), n], op(i+1.. nops(Y), Y)]: else Y:= [op(Y), [n]]: fi: Y: end: #Corners(L): inputs shape L and outputs the corners Corners:= proc(L) local i,k, S: k:= nops(L): S:={}: for i from 1 to k-1 do if L[i] > L[i+1] then S:= S union {[i, L[i]]}: fi: od: S:= S union {[k , L[k]]}: S: end: #OneTrial(L): starts at a random cell and continues until a corner cell is reached OneTrial := proc(L) local c, cells, H, H1: cells := [op(Cells(L))]: c:= cells[rand(1..nops(cells))()]: while not member(c, Corners(L)) do H:= Hook(L,c): H1:= [op(H minus {c})]: c:= H1[rand(1..nops(H1))()]: od: c: end: #RemoveCorner(L,c): inputs L and corner c and returns L with c removed RemoveCorner := proc(L,c) local L1, i: i:= c[1]: if i = nops(L) then if L[i] = 1 then L1:= [op(1..i-1, L)]: else L1:= [op(1..i-1, L), L[i] -1]: fi: else L1:= [op(1..i-1, L), L[i] - 1, op(i+1.. nops(L), L)]: fi: L1: end: #problem 2 co:= 0: for i from 1 to 10000 do Y:= RandSYT([5$5]): if Y[1][2] = 2 then co:= co + 1: fi: od: co; # 4977 The estimated probability is 49.77 percent.