#OK to post #Rebecca Embar, Homework 12 read `C12.txt`: #2 CheckFMBM:=proc(n,K) local f: f:=RG(n,K): EqualEntries(f,FM(BM(f,n),n)): end: CheckBMFM:=proc(n,K) local f: f:=RG(n,K): EqualEntries(f,BM(FM(f,n),n)): end: #3 #From observation, I believe the answer here is that Maple is #treating each table as a distinct object. In the real world, #if I put the same exact items in two different boxes, I would #still consider them to be different boxes. Here Maple is saying #that although two tables may contain the same exact entries, #they are still different tables. # #Although this may seem pedantic, this is actually an important #distinction. For example, if I define, #f := table([1=1]); #g := f; #evalb(eval(f)=eval(g)); #This will output true, becase f and g refer to the same "box" #If I then add an item to this table, for example, #f[2] := 2 #eval(g) will now return table([1=1,2=2]). This is because g #refers to the same "box" as f. #However, if I define, #f := table([1=1]); #g := table([1=1]); #evalb(eval(f)=eval(g)); #This will return false. This time, if I add an item to f, #f[2] := 2; #eval(g) will still return table([1=1]). This is because g refers #to a different "box" # #The correct function to use here is EqualEntries(f,BM(FM(f,n),n)) #4 CheckSuperAdditivity:=proc(f,n) local PN,S,SC,PSC,T,i: PN := powerset(n): for S in PN do SC := {seq(i,i=1..n)} minus S: PSC := powerset(SC): for T in PSC do if f[S union T] < f[S]+f[T] then return false: fi: od: od: true: end: #Ran CheckSuperAdditivity(FM(RG(5,20),5),5) a decent amount of times #and it output true every time #5 Too difficult to type up as txt, attached as separate pdf