Help:=proc(): print(`GF2(x,y,t), GF2p(x,t,p), GF2pMoa(x,y,t,p)`):end: #GF2(x,y,t): the weight-enumerator of the set #of all words in {[1,0],[-1,0],[0,-1],[0,1]} where the weight of #a word is t^lenght(w)*x^(current nubmber of #)*y^(#of E's) GF2:=proc(x,y,t) local fD,fmD,fE,fmE,sol: #F=1+(x+1/x+y+1/y)*t*F sol:= solve({ fD=t*x+ fD*t*x+ fmD*t*x+fE*t*x+fmE*t*x, fmD=t/x+ fD*t/x+ fmD*t/x+fE*t/x+fmE*t/x, fE=t*y+ fD*t*y+ fmD*t*y+fE*t*y+fmE*t*y, fmE=t/y+ fD*t/y+ fmD*t/y+fE*t/y+fmE*t/y }, {fD,fmD,fE,fmE}); factor(normal(1+subs(sol,fD)+subs(sol,fmD)+ subs(sol,fE)+subs(sol, fmE) )); end: #GF2p(x,y,t,p): the weight-enumerator of the set #of all words in {[1,0],[-1,0],[0,-1],[0,1]} where the weight of #a word is t^lenght(w)*x^(current nubmber of #)*y^(#of E's) GF2p:=proc(x,y,t,p) local fD,fmD,fE,fmE,sol: #F=1+(x+1/x+y+1/y)*t*F sol:= solve({ fD=t*x*p[1]+ fD*t*x*p[1]+ fmD*t*x*p[1]+fE*t*x*p[1]+fmE*t*x*p[1], fmD=t/x*p[-1]+ fD*t/x*p[-1]+ fmD*t/x*p[-1]+fE*t/x*p[-1]+fmE*t/x*p[-1], fE=t*y*p[2]+ fD*t*y*p[2]+ fmD*t*y*p[2]+fE*t*y*p[2]+fmE*t*y*p[2], fmE=t/y*p[-2]+ fD*t/y*p[-2]+ fmD*t/y*p[-2]+fE*t/y*p[-2]+fmE*t/y*p[-2] }, {fD,fmD,fE,fmE}); factor(normal(1+subs(sol,fD)+subs(sol,fmD)+ subs(sol,fE)+subs(sol, fmE) )); end: #GF2pMoa(x,y,t,p): the weight-enumerator of the set #of all words in {[1,0],[-1,0],[0,-1],[0,1]} where the weight of #a word is t^lenght(w)*x^(current nubmber of #)*y^(#of E's) #Moa's hopeful colleague's way GF2pMoa:=proc(x,y,t,p) local fD,fmD,fE,fmE,sol,q: q:=(1-p)/3; sol:= solve({ fD=t*x*p+ fD*t*x*p+ fmD*t*x*q+fE*t*x*q+fmE*t*x*q, fmD=t/x*q+ fD*t/x*q+ fmD*t/x*p+fE*t/x*q+fmE*t/x*q, fE=t*y*q+ fD*t*y*q+ fmD*t*y*q+fE*t*y*p+fmE*t*y*q, fmE=t/y*q+ fD*t/y*q+ fmD*t/y*q+fE*t/y*q+fmE*t/y*p }, {fD,fmD,fE,fmE}); factor(normal(1+subs(sol,fD)+subs(sol,fmD)+ subs(sol,fE)+subs(sol, fmE) )); end: