#OK to Post #Mingjia Yang, Math 640 (Fall 2016) homework #18 Help:=proc(): print(`hni(n,i,x),Hni(n,i,x),hL(x,L,n),hTom(n),mToh(n),pL(x,L,n),pTom(n),mTop(n),TransMatrix(n,base1,base2,m,e,h,p),T(A,j,l),Weight(A,j,l)`): end: with(linalg): with(LinearAlgebra): #######Problem 1######## #hni(n,i,x) outputs hi(x1,..xn) which is the sum of mL(x1,..xn) over all partitions L of i hni:=proc(n,i,x) local P: P:=partition(i): add(mL(x,L,n),L in P): end: #######Problem 2######## #Hni(n,i,x) using the definition that hi(x1,..,xn) is the coefficient of t^i in the #Taylor expansion (about t=0) of 1/((1-x1*t)..(1-xn*t)). Hni:=proc(n,i,x): expand(coeff(taylor(1/mul(1-x[j]*t,j=1..n),t=0,i+1),t,i)): end: #######Problem 3######## #hL(x,L,n) is the h-analog of eL(x,L,n). hL:=proc(x,L,n) local i: mul(hni(n,L[i],x),i=1..nops(L)): end: #hTom(n) inputs a positive integer n and outputs a nops(P(n)) by #nops(P(n)) matrix, call it MAT, such that MAT[i][j] is the coefficient #of mL[P[j]] in hL(x,P[i],n). hTom:=proc(n) local MAT: Matrix(nops(P(n)),nops(P(n)), [seq([seq(coeff(ToM(expand(hL(x,P(n)[i],n)),x,n,M),ToM(mL(x,P(n)[j],n),x,n,M)), j=1..nops(P(n)))],i=1..nops(P(n)))]): end: #mToh(n) is inverse of hTom(n). mToh:=proc(n): inverse(hTom(n)): end: #######Problem 4######## #pL(x,L,n) is the p-analog of eL(x,L,n) pi:=proc(x,i,n) local j: add(x[j]^i,j=1..n): end: pL:=proc(x,L,n): mul(pi(x,L[i] ,n),i=1..nops(L)): end: #pTom(n) is the p-analog of eTom(n) pTom:=proc(n) local MAT: Matrix(nops(P(n)),nops(P(n)), [seq([seq(coeff(ToM(expand(pL(x,P(n)[i],n)),x,n,M),ToM(mL(x,P(n)[j],n),x,n,M)), j=1..nops(P(n)))],i=1..nops(P(n)))]): end: #mTop(n) is inverse of pTom(n). mTop:=proc(n): inverse(pTom(n)): end: #######Problem 5######## #TransMatrix(n,base1,base2,m,e,h,p) where base 1, base 2 are members of the set {m,e,h,p} #and outputs the transition matrix from the base 1 basis to the base 2 basis. TransMatrix:=proc(n,base1,base2,m,e,h,p) local L,k,MAT,L1: if base1=base2 then RETURN(IdentityMatrix(nops(P(n)))): fi: L:=[[m,e],[e,m],[m,h],[h,m],[m,p],[p,m],[e,h],[h,e],[e,p],[p,e],[h,p],[p,h]]: for k from 1 to 12 do if L[k]=[base1,base2] then break: fi: od: L1:=[[mL,eL],[eL,mL],[mL,hL],[hL,mL],[mL,pL],[pL,mL],[eL,hL],[hL,eL],[eL,pL],[pL,eL],[hL,pL],[pL,hL]]: Matrix(nops(P(n)),nops(P(n)), [seq([seq(coeff(ToM(expand(L1[k][1](x,P(n)[i],n)),x,n,M),ToM(expand(L1[k][2](x,P(n)[j],n)),x,n,M)), j=1..nops(P(n)))],i=1..nops(P(n)))]): end: #######Problem 6######## #T(A,j,l) is the map between the the pairs in A(n,k) in Dr.Z's proof of Newton's identities T:=proc(A,j,l): if member(j,A) then RETURN((A minus {j},j,l+1)): else (A union {j}, j,l-1): fi: end: #Weight(A,j,l) is the weight of the pair (A,j^l). For example Weight({1,3,5},2,3)=(-1)^3x1x2x3x2^3 Weight:=proc(A,j,l) local x: (-1)^(nops(A))*mul(x[i],i in A)*x[j]^l: end: #It is clear from the definition of T that it is indeed an involution and #Weight(T(A,j,l))=-Weight(A,j,l) checks out experimentally. #############Code from C15################## #C15.txt: ExpMath, Rutgers, Oct. 27, 2016, Bases of the alg. of Symmetric Polynomials Help:=proc(): print(`P(n), ApplyPi(f,x,n,pi), Sym(f,x,n), mL(x,L,n)`): print(`IsSym(f,x,n), ToM(f,x,n,M), ei(x,i,n), eL(x,L,n) `): end: with(combinat): #Rev(L): reverse of L Rev:=proc(L) local n,i: n:=nops(L): [seq(L[n-i+1],i=1..n)]: end: #P(n): the list of (integer) partitons of n in non-increasing order P:=proc(n) local S,i: S:=partition(n): Rev([seq(Rev(S[i]),i=1..nops(S))]): end: #ApplyPi(f,x,n,pi): inputs f, x, n, pi, where f is an expression in x[1],...,x[n] #pos. integer n, letter x, and a permutation pi of {1, ...,n}, applies x[i]->x[pi[i]] #to f ApplyPi:=proc(f,x,n,pi) local i: if nops(pi)<>n then RETURN(FAIL): fi: subs({seq(x[i]=x[pi[i]],i=1..n)},f): end: #Sym(f,x,n): the symmetrizer of f Sym:=proc(f,x,n) local pi,S: S:=permute(n): convert({seq(ApplyPi(f,x,n,pi), pi in S)},`+`): end: #mL(x,L,n): The monomial symmetric function m_L(x1,..., xn) where n>=nops(L) mL:=proc(x,L,n) local i: if n0 then RETURN(false): fi: od: true: end: KickZ:=proc(L) local i: for i from 1 to nops(L) while L[i]<>0 do od: [op(1..i-1,L)]: end: #ToM(f,x,n,M): inputs a symmetric polynomial f in x[1]..., x[n] #outputs it as a linear combination of M[L] ToM:=proc(f,x,n,M) local F,f1,mono,L,c,i: if not IsSym(f,x,n) then RETURN(FAIL): fi: #This part added after class if not type(f,`+`) then c:=normal(f/mul(x[i],i=1..n)): if not type(c,integer) then RETURN(FAIL): else RETURN(c*M[[1$n]]): fi: fi: #end part added after class f1:=f: F:=0: while f1<>0 do mono:=op(1,f1): L:=[seq(degree(mono,x[i]),i=1..n)]: c:=normal(mono/mul(x[i]^L[i],i=1..nops(L))): L:=KickZ(sort(L,`>`)): F:=F+c*M[L]: f1:=expand(f1-c*mL(x,L,n)): od: F: end: #ei(x,i,n): the elementary symmetric function e_i(x[1], ..., x[n]) ei:=proc(x,i,n) : if i>n then 0: else mL(x,[1$i],n): fi: end: #eL(x,L,n): the mul(e_L[i], i=1..n) eL:=proc(x,L,n) local i: mul(ei(x,L[i] ,n),i=1..nops(L)): end: eTom:=proc(n) local Pn,k,A,B,M,i,M1,j,x: Pn:=P(n): k:=nops(Pn): A:=[seq(M[Pn[i]],i=1..k)]: B:=[seq(ToM(expand(eL(x,Pn[i],n)),x,n,M),i=1..k)]: M:=[]: for i from 1 to nops(A) do M1:=[seq(coeff(B[i],A[j]),j=1..nops(A))]: M:=[op(M),M1]: od: end: #mToe(n): the transition matrix from the m-basis to the e-basis mToe:=proc(n) inverse(eTom(n)): end: