#OK to post #Soham Palande, Assignment 25, 12/13/2020 #PART 1 #Draw the Ferrers diagram of the partition [9,6,5,3,1,1,1]. What is its conjugate partition? The Ferrers diagram is: * * * * * * * * * * * * * * * * * * * * * * * * * * The corresponding conjugate partition is [7,4,4,3,3,2,1,1,1] #PART 2 The number of partitions into (exactly) 𝑘 parts equals the number of partitions with greatest part 𝑘 pnk(151,10) 79811865 #PART 3 - [[6,4,2,2,2,2,],0] BZ([[6,5,3,1,1,1,1,1],-1]) [[6, 4, 2, 2, 2, 2, 2], 0] This matches what I got by hand. #PART 4 Using pnFast(10000) directly gives an error message because, pnFast is a recursive function and is based on the values of pnFast(n- j*(3*j+1)/2) and pnFast(n- j*(3*j-1)/2). So to calculate pnFast(n) it needs to first compute previous some previous values. So using a very high number causes Maple to complain since it has too many levels of recursion. *Note: Running pnFast(10000) directly did not give an error on multiple trials (while it did on a few) #I was able to run pnFast(20000) directly as well. seq(pnFast(i),i=1..20000)[20000] 252114813812529697916619533230470452281328949601811593436850314108034284423801564956623970731689824369192324789351994903016411826230578166735959242113097 #PART 5 pnFastMod:=proc(n,m) local x,y: x:=seq(pnFast(i),i=1..n)[n]: y:= x mod m: y end proc: pnFastMod(100000,101) 89 #PART 6 #Works Perfectly #Writing helper procedure InvGlashier1:=proc(L) local i: for i from 1 to nops(L)-1 while L[i]<>L[i+1] do od: if i=nops(L) then RETURN(L): else #otherwise we add the two duplicate elements and sort it RETURN(sort([op(1..i-1,L),L[i]+L[i+1],op(i+2..nops(L),L)],`>`)): fi: end: InvGlashier:=proc(L) local L1,L2,L3: L1:=L: L2:=InvGlashier1(L1): while L1<>L2 do L3:=InvGlashier1(L2): L1:=L2: L2:=L3: od: L2: end: #Example: InvGlashier(Glashier([9,6,5,3,2])) [9, 6, 5, 3, 2] Glashier(InvGlashier([9,5,3,3,3,1,1])) [9, 5, 3, 3, 3, 1, 1] #PART 7 #Almost works perfectly there is a minor bug I did not catch #InvSyl(L): Sylvester's bijection from distinct partitions to odd partitions InvSyl:=proc(L) local i,r,m,L1,M1,a1,d1,d2,M2: option remember: #If L is the empty partition, we return the empty partition if nops(L)=0 then RETURN([]): fi: #If L only consists of 1 element we return the odd partition consisting of m 1's if nops(L)=1 and (L[1] mod 2=0)then RETURN([1$L[1]]): fi: #We find r, m, d1 and d2 d1:=L[1]: d2:=L[2]: m:=d1-d2-1: r:=nops(L)-1: a1:=d2-r+1: #We construct the distinct partition obtained by removing the first two parts L1:=[seq(L[i],i=3..nops(L))]: #We call the procedure recursively M1:=InvSyl(L1): #We add 2 to every element M1:=[seq(M1[i]+2,i=1..nops(M1))]: #We restore the stuff that we lost by putting at the front [(2*a1)+1 and appending #1$m] [(2*(a1))+1,op(M1),1$m]: end: