###################################################################### ##mDimPars Save this file as kDimPars # ## To use it, stay in the # ##same directory, get into Maple (by typing: maple ) # ##and then type: read mDimPars # ##Then follow the instructions given there # ## # ##Written by Doron Zeilberger, Rutgers University , # #zeilberg at math dot rutgers dot edu # ###################################################################### #Created: Feb. 15, 2012 print(`Created: Feb. 15, 2012`): print(` This is mDimPars `): print(`A Maple package that accompanies the article `): print(` The Number of m-Dimensional Paritions of Eleven and Twelve`): print(`by Shalosh B. Ekhad `): print(`published in the Personal Journal of Shalosh B. Ekhad`): print(` and Doron Zeilberger`): print(`available from Doron Zeilberger's website`): print(``): print(`Please report bugs to zeilberg at math dot rutgers dot edu`): print(``): print(`The most current version of this package and paper`): print(` are available from`): print(`http://www.math.rutgers.edu/~zeilberg/ .`): print(`---------------------------------------------------------------`): print(`For a list of the Story procedures type ezraS();, for help with`): print(`a specific procedure, type ezra(procedure_name); .`): print(``): print(`---------------------------------------------------------------`): print(`For a list of the SUPPORTING procedures type ezra1();, for help with`): print(`a specific procedure, type ezra(procedure_name); .`): print(``): print(`-----------------------------------------------------------`): print(`For a list of the MAIN procedures type ezra();, for help with`): print(`a specific procedure, type ezra(procedure_name); .`): print(``): print(`---------------------------------------------------------------`): with(combinat): ezraS:=proc() if args=NULL then print(` The Story procedures are: `): print(` MknStory `): else ezra(args): fi: end: ezra1:=proc() if args=NULL then print(` The supporting procedures are: `): print(`McMknSeq, MknOri, , MknSeqOri, Pnk, Qnk `): else ezra(args): fi: end: ezra:=proc() if args=NULL then print(`The main procedures are: Mkn, MknSeq, MknSeqPC `): elif nops([args])=1 and op(1,[args])=MknOri then print(`MknOri(k,n): Original, not speeded-up version!`): print(`inputs a numeric n (pos. integer) and a symbol k`): print(`and outputs the polynomial expression in k that tells you`): print(`the number of k-dimensional partitions of n. For example`): print(`to get (11.4.9), p. 190 of George Andrews's "Theory of Partitions"`): print(`type:`): print(`MknOri(k,6):`): elif nops([args])=1 and op(1,[args])=Mkn then print(`Mkn(k,n): Speeded-up version!`): print(`inputs a numeric n (pos. integer) and a symbol k`): print(`and outputs the polynomial expression in k that tells you`): print(`the number of k-dimensional partitions of n. For example`): print(`to get (11.4.9), p. 190 of George Andrews's "Theory of Partitions"`): print(`type:`): print(`Mkn(k,10):`): elif nops([args])=1 and op(1,[args])=McMknSeq then print(`McMknSeq(k,n0): the list of polynomials in k, of length n0`): print(`whose n-th item gives you the MacMahon `): print(`polynomial (in k)`): print(`that was falsely conjectured by MacMahon`): print(`to equals the number of k-th dimensional paritions of`): print(`n For example, try: `): print(`McMknSeq(k,8);`): elif nops([args])=1 and op(1,[args])=MknSeq then print(`MknSeq(k,n0): the list of polynomials in k, of length n0`): print(`whose n-th item gives you the polynomial expression in k,`): print(`that equals the number of k-th dimensional paritions with`): print(`n cells. For example, try: `): print(`MknSeq(k,8); `): elif nops([args])=1 and op(1,[args])=MknSeqPC then print(`MknSeqPC(k,n0): like MknSeq(k,n0) but if n0<=12 than it uses pre-computed values.`): print(`For example, try: `): print(`MknSeqPC(k,12); `): elif nops([args])=1 and op(1,[args])=MknStory then print(`MknStory(n0,k,K): The story of polynomial expressions in`): print(` the dimension k`); print(`of k-dimensional partitions of n for n between 1 and n0`): print(`it also lists the first n0 terms for the enumerating sequence`): print(`for the number of k-dimensional paritions for k from 1 to K`): print(`For example, try:`): print(`MknStory(8,k,10);`): elif nops([args])=1 and op(1,[args])=Pnk then print(`Pnk(n,k): all the k-dimens. Ferrers graphs with n dots`): print(`For example, try:`): print(`Pnk(3,2);`): elif nops([args])=1 and op(1,[args])=Qnk then print(`Qnk(n,k): all the k-dimens. Ferrers graphs with n dots`): print(`up to equivalence`): print(`For example, try:`): print(`Qnk(3,2);`): else print(`There is no ezra for`,args): fi: end: #ez:=proc(): print(` Nei1(v), Nei(S), Pnk(n,k) `): #print(`Image11(v,pi), Image1(Sv,pi), Qnk(n,k), AllImage1(Sv,k)`): #print(`Mkn(k,n), IsGood(v,S) `): #end: with(combinat): #Nei1(v): all the neighbors of the point v #For example, try: Nei1([4,5,2]); Nei1:=proc(v) local i: {seq([op(1..i-1,v),v[i]+1,op(i+1..nops(v),v)],i=1..nops(v))}: end: #Nei(S): given a set of vectors, finds all the neighbors of all #of all the members of S. For example, try: #Nei({[1,1,1],[1,1,2]}); Nei:=proc(S) local v: {seq(op(Nei1(v)), v in S)}: end: #IsGood(v,S): can you add the vector v to the set of Ferrers diagr. S? IsGood:=proc(v,S) local i,j,pp: for i from 1 to nops(v) do for j from 0 to v[i]-1 do pp:= [op(1..i-1,v),j,op(i+1..nops(v),v)]: if not member(pp,S) then RETURN(false): fi: od: od: true: end: #Pnk(n,k): all the k-dimens. Ferrers graphs with n dots #For example, try: #Pnk(3,2); Pnk:=proc(n,k) local gu,i,mu,mu1,mu11,mu111: if n=0 then RETURN({}): fi: if n=1 then RETURN({{[0$k]}}): fi: if k=1 then RETURN({{seq([i], i=0..n-1)}}): fi: if n{} do gu1:=gu[1]: lu:=lu union {gu1}: gu:=gu minus {seq(Image1(gu1,pi),pi in mu)}: od: lu: end: #MknOri(k,n): inputs a numeric n (pos. integer) and a symbol k #and outputs the polynomial expression in k that tells you #the number of k-dimensional partitions of n. For example #to get (11.4.9), p. 190 of George Andrews's "Theory of Partitions" #type: #MknOri(k,6): MknOri:=proc(k,n) local gu,mu,r,mu1: if n=1 then RETURN(1): fi: gu:=0: for r from 1 to n-1 do mu:=Qnk(n,r): gu:=gu+binomial(k,r)*add(nops(AllImage1(mu1,r)),mu1 in mu): od: gu:=subs(k=k+1,gu): factor(expand(gu)): end: #MknSeqOri(n0,k): the list of polynomials in k, of length n0 #whose n-th item gives you the polynomial expression in k, #that equals the number of k-th dimensional paritions with #n cells. For example, try: #MknSeqOri(8,k); MknSeqOri:=proc(n0,k) local n: [seq(MknOri(k,n),n=1..n0)]: end: #MknSeq(k,n0): the list of polynomials in k, of length n0 #whose n-th item gives you the polynomial expression in k, #that equals the number of k-th dimensional paritions with #n cells. For example, try: #MknSeq(k,8); MknSeq:=proc(k,n0) local n: if n0<=12 then print(`The pre-computed value is`): print(MknSeqPC(k,n0)): print(`but let's do it from scracth`): fi: [seq(Mkn(k,n),n=1..n0)]: end: #MknSeq1(k,n0): the list of polynomials in k, of length n0 #whose n-th item gives you the polynomial expression in k, #that equals the number of k-th dimensional paritions with #n cells. For example, try: #MknSeq1(k,8); MknSeq1:=proc(k,n0) local n: [seq(Mkn(k,n),n=1..n0)]: end: #Mkn(k,n): inputs a numeric n (pos. integer) and a symbol k #and outputs the polynomial expression in k that tells you #the number of k-dimensional partitions of n. For example #to get (11.4.9), p. 190 of George Andrews's "Theory of Partitions" #type: #Mkn(k,6): Mkn:=proc(k,n) local gu,mu,r,mu1: if n<=3 then RETURN(MknOri(k,n)): fi: gu:=binomial(k,n-1)+binomial(k,n-2)*binomial(n-1,2)+ binomial(k,n-3)*n*(n-3)*(n^2-7*n+14)/8+ binomial(k,n-4)*1/48*(n-4)*(n^5-17*n^4+109*n^3-303*n^2+338*n-192): for r from 1 to n-5 do mu:=Qnk(n,r): gu:=gu+binomial(k,r)*add(nops(AllImage1(mu1,r)),mu1 in mu): od: gu:=expand(gu): gu:=subs(k=k+1,gu): factor(expand(gu)): end: #MknStory(n0,k,K): The story of polynomial expressions in the dimension k #of k-dimensional partitions of n for n between 1 and n0 #it also lists the first n0 terms for the enumerating sequence #for the number of k-dimensional paritions for k from 1 to K #For example, try: #MknStory(8,k,10); MknStory:=proc(n0,k,K) local gu,n,k1,t0: t0:=time(): gu:=MknSeq1(k,n0): print(`Polynomial Expressions in terms of k for`): print(`The number of k-Dimensional Paritions of n for n between 1 and `, n0): print(``): print(`By Shalosh B. Ekhad (ShaloshBEkhad@gmail.com) `): print(``): for n from 1 to n0 do print(`Theorem Number`, n, `: The number of k-dimensional paritions of`, n): print(` equals `): print(gu[n]): print(`for the sake of Sloane, the first`, K ,`terms are`): print([seq(subs(k=k1,gu[n]),k1=1..K)]): od: for k1 from 1 to K do print(`The first`, n0, `terms of the sequence Number of`): print(k1, `-dimensional partitions are `): print(subs(k=k1,gu)): od: print(`To summarize, the list of polynomials whose n-th term is the `): print(`the expression for the number of k-dimensional paritions of n`): print(` is `): print(gu): print(`and in Maple input form it is`): lprint(gu): print(`This took`, time()-t0, `seconds. `): end: #MknSeqPC(k,n0): Like MknSeq(k,n0) but precomputed for n0<=12 #n cells. For example, try: #MknSeqPC(k,12); MknSeqPC:=proc(k,n0) local gu: if not type(n0,integer) or n0<1 then RETURN(FAIL): fi: if n0>12 then print(`The first argument must be <=12`): RETURN(FAIL): fi: gu:= [1, k+1, 1/2*(k+2)*(k+1), 1/6*(k+1)*(k^2+8*k+6), 1/24*(k+1)*(k^3+21*k^2+38*k+24 ), 1/120*(k+4)*(k+1)*(k^3+40*k^2+61*k+30), 1/720*(k+1)*(k^5+80*k^4+965*k^3+1810 *k^2+1824*k+720), 1/5040*(k+1)*(k^6+132*k^5+3235*k^4+13320*k^3+16864*k^2+16848* k+5040), 1/40320*(k+1)*(k^7+203*k^6+8911*k^5+82145*k^4+125944*k^3+217532*k^2+ 129744*k+40320), 1/362880*(k+1)*(k^8+296*k^7+21238*k^6+387884*k^5+1273069*k^4+ 1377404*k^3+3261852*k^2+935856*k+362880), 1/3628800*(k+1)*(k^9+414*k^8+45366*k^ 7+1464624*k^6+10983189*k^5+8292186*k^4+43268084*k^3+18819576*k^2+15104160*k+ 3628800), 1/39916800*(k+1)*(k^10+560*k^9+88980*k^8+4653120*k^7+69709773*k^6+ 152328120*k^5+98041670*k^4+1093797880*k^3-395547624*k^2+473807520*k+39916800)]: [op(1..n0,gu)]: end: #McMknSeq(k,n0): the list of polynomials in k, of length n0 #whose n-th item gives you the MacMahon #polynomial (in k) #that was falsely conjectured by MacMahon #to equals the number of k-th dimensional paritions with #n cells. For example, try: #McMknSeq(k,8); McMknSeq:=proc(k,n0) local gu,i,q: gu:=mul(1/(1-q^i)^expand(binomial(k+i-2,i-1)),i=1..n0): gu:=taylor(gu,q=0,n0+1): [seq(factor(expand(coeff(gu,q,i))),i=1..n0)]: end: