#OK to post homework #Kent Mei, 12/13/20, Assignment 25 #--------------------------------- #Part 1 #Ferrers diagram is where we have L[i] # of dots in the ith row. # [9,6,5,3,1,1,1] # ********* # ****** # ***** # *** # * # * # * #The conjugate partition is looking at the number of dots by column #So, in this case, the conjugate partition is [7,4,4,3,3,2,1,1,1] #--------------------------------- #Part 2 #The number of partitions of 151 with exactly 10 parts is equivalent to #the number of partitions of 151 with largest part 10. #pnk(151,10); #79811865 partitions have exactly 10 parts. #--------------------------------- #Part 3 #[[6,5,3,1,1,1,1,1],-1] #t = 8 #j = -1 #t + 3j = 5 < 6 #L[1]-3j-t-1 = 6 + 3 - 8 - 1 = 0 1s at the end. #So, the image is [[6,4,2,2,2,2,2],0] #BZ([[6,5,3,1,1,1,1,1],-1]); #[[6,4,2,2,2,2,2],0] which is equal to the result found by hand. #--------------------------------- #Part 4 #I don't get an error message when I type pnFast(10000); #36167251325636293988820471890953695495016030339315650422081868605887952568754066420592310556052906916435144 #However, I think this is because of the option remember used in the procedure. #Normally, when running the procedure in a new session, there would be too many levels of recursion trying to get from the top at 10000 all the way to the bottom at 0. #I also don't get an error message when I use [seq(PnFast(i),i=1..10000)][10000]; #36167251325636293988820471890953695495016030339315650422081868605887952568754066420592310556052906916435144 #This method is not going to produce an error message because it finds the #answer to PnFast(n) for all numbers starting from 1 and goes to 10000, which #is basically a bottom-up approach. With the help of dynamic programming, all #the answers to the smaller queries are stored as the procedure runs which #prevents too many levels of recursion from occurring. #[seq(pnFast(i),i=1..20000)][20000]; #252114813812529697916619533230470452281328949601811593436850314108034284423801564956623970731689824369192324789351994903016411826230578166735959242113097 #It seems to stop working as well when we get to 100000, probably because the amount of data being stored is getting to be too much for what's allocated to Maple. #--------------------------------- #Part 5 pnFastMod:=proc(n,m): pnFast(n) mod m: end: #pnFastMod(10^5,101); #89 #--------------------------------- #Part 6 InvGlashier:=proc(M) local i, L, curr, n, count: if nops(M) <= 1 then return M: fi: L := []: curr := M[1]: count := 1: for i from 2 to nops(M) do if M[i] = curr then count := count + 1: else while count > 0 do n := floor(log[2](count)): L := [op(L), curr * 2^n]: count := count - 2^n: od: curr := M[i]: count := 1: fi: od: while count > 0 do n := floor(log[2](count)): L := [op(L), curr * 2^n]: count := count - 2^n: od: sort(L, `>`): end: #--------------------------------- #Part 7 InvSyl:=proc(D) local r, m, a, L, L1: if nops(D) = 0 then return D: fi: if nops(D) = 1 then return [1$D[1]]: fi: L := []: if nops(D) = 2 then r := 0: m := D[1] - D[2] - 1: a := D[1] - m: L := [2 * a - 1, 1$m]: return L: fi: L1 := InvSyl([seq(D[i], i = 3..nops(D))]): r := nops(L1) + 1: m := D[1] - D[2] - 1: a := D[1] - r - m: L := [2*a+1, seq(L1[i] + 2, i = 1..nops(L1)), 1$m]: end: