# OK to post homework # Aurora Hiveley, 3/5/26, Assignment 13 Help:=proc(): print(`IsSuperDistinct(L,d), SuperDistinctPars(n,d), ParMod(n,a,A), NuSYT(L) `): end: ### Problem 1 # A partition is d-super-distinct if the difference between two consecituve parts is >=d. # The usual distinct partitions are 1-distinct. # IsSuperDistinct(L): inputs a partition (a member of Par(n), written in the usual way as weakly decreasing list # of integers) and outputs true iff for all i, between 1 and nops(L)-1, L[i]-L[i+1]>=d IsSuperDistinct := proc(L,d) local i: for i from 1 to nops(L)-1 do if L[i] - L[i+1] < d then RETURN(false): fi: od: true: end: # SuperDistinctPars(n,d): outputs the subset of Par(n) consisting of d-super-distinct partitions SuperDistinctPars := proc(n,d) local S,s: S := {}: for s in Par(n) do if not IsSuperDistinct(s,d) then S := S union {s}: fi: od: S: end: ### Problem 2 # ParMod(n,a,A): inputs a positive integer n, another positive integer a, and a subset, A, of {0,1, .., a-1} # and outputs the subset of Par(n) consisting of those partitions all whose entries mod a belong to A. # this was in homework 10 as CompsMod(n,a,S). so i've copied that code below ParMod := proc(n,a,A) : CompsMod(n,a,A): end: ## copied from hw10AuroraHiveley.txt CompsMod := proc(n,a,S) local A,i,s: A := { seq( seq(a*i+s,i=0..trunc(n/a)), s in S) } minus {0}: # 0 causes recursion error CompsG(n,A): end: ## copied from C10.txt #CompsG(n,A): The set of compositions of n whose entries are from the set A/ CompsG:=proc(n,A) local S,i,S1,s1: option remember: if n<0 then RETURN({}): fi: if n=0 then RETURN({[]}): fi: S:={}: for i in A do S1:=CompsG(n-i,A): S:=S union {seq([i,op(s1)],s1 in S1)}: od: S: end: ### Problem 3 # What OEIS sequence is {nops(SuperDistinct(n,2)) }? # What OEIS sequence is {nops(ParMod(n,5,{1,4})) }? # {seq(nops(SuperDistinctPars(n,2)) , n=1..10)}; # returns: {0, 1, 2, 3, 5, 8, 12, 18, 25, 36} --> oeis sequence A039899 # {seq(nops(ParMod(n,5,{1,4})), n=1..10 )}; # returns: {1, 2, 3, 5, 7, 10, 15, 23} --> oeis sequence A261081 ### Problem 4 # Eventually nops(SYT(L)) will be impractical, since the sets SYT(L) gets very big. # Adapt procedure SYT(L) to write a procedure # NuSYT(L): inputs an integer partition L, and outputs the NUMBER of Standard Young Tableaux of shape L. # For example NuSYT([2,2]); should output 2, and NuSYT([3,3,3]); should output 42. (REMEMBER TO HAVE option rememeber) NuSYT:=proc(L) local i,k,n,count,L1: option remember: k:=nops(L): n:=add(L[i],i=1..k): if not IsSuperDistinct(L,0) then # checks if L is a legal YT shape (if not, number of SYT is 0) RETURN(0): fi: if k<=0 then RETURN(0): elif k=1 then RETURN(1): fi: count := 0: #Look for all legal rows where Mr. or Ms. n can place themselves for i from 1 to k-1 do if L[i]>L[i+1] then L1:=[op(1..i-1,L),L[i]-1,op(i+1..k,L)]: count := count + NuSYT(L1): fi: od: if L[k]>1 then L1:=[op(1..k-1,L),L[k]-1]: count := count + NuSYT(L1): else L1:=[op(1..k-1,L)]: count := count + NuSYT(L1): fi: count: end: ### Problem 5 # Conjecture an explicit expression for NuSYT([a,b]) (alias nops(SYT([a,b])) for all a ≥ b ≥ 0 ## get some data: # T := [[]$10]: # for a from 1 to 10 do # T[a] := [seq( NuSYT([a,b]), b=1..a), 0$(10-a)]: # od: # matrix(T); # [ 1 0 0 0 0 0 0 0 0 0] # [ ] # [ 2 2 0 0 0 0 0 0 0 0] # [ ] # [ 3 5 5 0 0 0 0 0 0 0] # [ ] # [ 4 9 14 14 0 0 0 0 0 0] # [ ] # [ 5 14 28 42 42 0 0 0 0 0] # [ ] # [ 6 20 48 90 132 132 0 0 0 0] # [ ] # [ 7 27 75 165 297 429 429 0 0 0] # [ ] # [ 8 35 110 275 572 1001 1430 1430 0 0] # [ ] # [ 9 44 154 429 1001 2002 3432 4862 4862 0] # [ ] # [10 54 208 637 1638 3640 7072 11934 16796 16796] # conjecture: NuSYT([a,b]) = NuSYT([a-1,b]) + NuSYT([a,b-1]) where NuSYT([a,b]) = 0 if b > a ### Problem 6 # Conjecture an explicit expression for NuSYT([a,b,c]) (alias nops(SYT([a,b,c])) for all a ≥ b ≥ c ≥ 0 # conjecutre: NuSYT([a,b,c]) = NuSYT([a-1,b,c]) + NuSYT([a,b-1,c]) + NuSYT([a,b,c-1]) ### copied from C13.txt #C13.txt Help13:=proc(): print(` PFG(L), SYT(L), PSYT(n) `): end: Help12:=proc(): print(`Park(n,k), Par(n), ParN(n,k)`): end: ParN:=proc(n,k) local s,S,T: S:=Par(n):T:={}: for s in S do if s[1]=k then T:=T union {s}: fi: od: T: end: #Park(n,k): The set of partitions of n into exactly k parts Park:=proc(n,k) local S,k1,S1,s1: option remember: if nL[i+1] then L1:=[op(1..i-1,L),L[i]-1,op(i+1..k,L)]: S1:=SYT(L1): S:=S union {seq( [op(1..i-1,s1),[op(s1[i]),n],op(i+1..k,s1)] ,s1 in S1)}: fi: od: if L[k]>1 then L1:=[op(1..k-1,L),L[k]-1]: S1:=SYT(L1): S:=S union {seq( [op(1..k-1,s1),[op(s1[k]),n]] ,s1 in S1)}: else L1:=[op(1..k-1,L)]: S1:=SYT(L1): S:=S union {seq( [op(1..k-1,s1), [n]] ,s1 in S1)}: fi: S: end: #PSYT(Y): prints the SYT Y PSYT:=proc(Y) local i: for i from 1 to nops(Y) do lprint(op(Y[i])): od: end: