Help:=proc() : print(`G(m,n,q) , RatM(M,N,q), G1(m,n,q) `): end: #[a[1],a[2], ..., a[M]] #N>=a[1]>=...>=a[M]>=0 #G(M,N,q):The generating polynomial whose coeff. of q^n #is the number of ways of arranging #n chocolate pieces that fit into an M by N box #(left-justified and top-justified) G:=proc(M,N,q) option remember: if M=0 or N=0 then 1: elif M<0 or N<0 then 0: else #Case 1: top-right piece has been eaten sort(expand(G(M,N-1,q)+ #case 2: top-right has not (yet) been eaten q^N*G(M-1,N,q))): fi: end: RatM:=proc(M,N,q): normal(G(M,N,q)/G(M-1,N,q)):end: RatMN:=proc(M,N,q): normal(RatM(N,N,q)/RatM(N-1,M,q)):end: #G(M,2)=(1-q^(M+2))*(1-q^(M+1))/(1-q)/(1-q^2): #G(M,3)=(1-q^(M+3))*(1-q^(M+2))*(1-q^(M+1))/(1-q)/(1-q^2)/(1-q^3) G1:=proc(M,N,q) local i: normal(mul((1-q^(M+i))/(1-q^i),i=1..N)): end: #N>=a1 >= a2>= ... >= aM>=0 #v= v= v= #N>=b1>= b2>= ... >= bM>=0 # #PP2(M,N,q): the gen. poly for 2 by M by N (two-layered) #choc. box # PP2:=proc(M,N,q): expand(add(add( PP2a(a1,b1),a1=0..N),b1=0..a1)): end: