# OK to post homework # Lucy Martinez, 04-12-2026, Assignment 21 with(combinat): # Question 2: # Report on the progress of your project (including that you did nothing so far) # Answer: # We have added all the procedures to the text file. # We created an overleaf shared file. # We are going to start compiling data. # Question 3: # Convince youself that # (1+x[1]*t)*(1+x[2]*t)*...*(1+x[n]*t)= 1+ e_kn(1,n,x)*t+ e_kn(2,n,x)*t^2+ e_kn(3,n,x)*t^3+...+e_kn(i,n,x) # By using Maple's commands "mul", "expand", and "coeff", # write a procedure eknVC(k,n,x) that computes ekn(k,n,x) in a very cever way eknVC:=proc(k,n,x) local f,i,t: f:=expand(mul(1+x[i]*t,i=1..n)): coeff(f,t^k): end: # Question 4: # Another important sequence of symmetric polynomials are the complete-homog. symmetric polynomials # h_k(x_1, ...,x_n) # One way of defining them is via the generating function (in the variable t) # Sum_{k=0}^{infty} h_k(x_1, ..., x_n)*t^k= 1/((1-t*x[1])*(1-t*x[2])*...*(1-t*x[n])) # Using the Maple commands "mul", "taylor", and "expand", # write a procedure hkn(k,n,x) to compute these important functions. hkn:=proc(k,n,x) local f,i,t: f:=1/(mul(1-t*x[i],i=1..n)): coeff(expand(taylor(f,t=0,k+1)),t,k): end: # Question 5: # After reading about Newton's identities, write a procedure # CheckNewton(k,n) that checks the identity for specific k and n. # Then run CheckNewton(k,n) for all 5>=n>=k>=1 # ANSWER: The following returns 0 for all 5>=n>=k>=1 #for n from 1 to 5 do # for k from 1 to n do # print(CheckNewton(k,n)): # od: #od: CheckNewton:=proc(k,n) local i: expand(k*eknC(k,n,x)-add((-1)^(i-1)*eknC(k-i,n,x)*pkn(i,n,x),i=1..k)): end: #########################From previous classes: # C21.txt, April 9, 2026 with(combinat): Help21:=proc(): print(`SubsPi(f,x,pi), IsSymS(f,x,n), IsSym(f,x,n)`): print(`Symm(f,x,n), rSymm(f,x,n), mL(x,n,L):`): print(`ekn(k,n,x), eknC(k,n,x), pkn(k,n,x)`): end: #Today, we will learn about symmetric polynomials # For any two permutations pi1 and pi2 (pi1<>pi2), a polynomial f(x1,x2,...,xn) # is symmetric if whenever f(pi1)=f(pi2) #SubsPi(f,x,pi): Inputs a polynomial f(x[1],x[2],...,x[n]) (n:=nops(pi)) # and outputs the new polynomial obtained by substituting x[i]->x[pi[i]] SubsPi:=proc(f,x,pi) local i,n: n:=nops(pi): subs({seq(x[i]=x[pi[i]],i=1..n)},f): end: #IsSymS(f,x,n): Checks that all the images of f under the symmetric group # coincide with f (that is a symmetric polynomial) IsSymS:=proc(f,x,n) local Sn,pi: Sn:=permute(n): evalb({seq(SubsPi(f,x,pi), pi in Sn)}={f}): end: #IsSym(f,x,n): Checks that f(x[1],x[2],...,x[n]) is symmetric # the Pable way: check all transpositions IsSym:=proc(f,x,n) local i: evalb({seq(subs({x[i]=x[i+1],x[i+1]=x[i]},f),i=1..n-1)}={f}): end: #Symm(f,x,n): Inputs an ARBITRARY polynomial f(x[1],x[2],...,x[n]) and # outputs the sum of all the images of f under S_n Symm:=proc(f,x,n) local Sn, pi: Sn:=permute(n): add(SubsPi(f,x,pi), pi in Sn): end: #rSymm(f,x,n): Inputs an ARBITRARY polynomial f(x[1],x[2],...,x[n]) and # outputs the sum of all the distinct images of f under S_n rSymm:=proc(f,x,n) local Sn, pi: Sn:=permute(n): convert({seq(SubsPi(f,x,pi), pi in Sn)},`+`): end: #Notice that # rSymm(x[1]*x[2],x,4)=x[1]*x[2] + x[1]*x[3] + x[1]*x[4] + x[2]*x[3] + x[2]*x[4] + x[3]*x[4] #In fact: # e_k(n):=rSymm(x[1]*x[2]*...*x[k],x,n) is called the elementary symmetric # polynomial of degree k in x[1],x[2],...,x[n] # # The monomial symmetric functions: # A basis of all polynomials of degree k in x[1],x[2],...,x[n]: # x[1]^a1*x[2]^a2*...*x[n]^an where a1+a2+...+an=k # since we want to get all the generalizations, we will impose the following # a1>=a2>=...>=an #mL(x,n,L): Inputs a variable name x, a positive integer n, and # an integer partition L, outputs the symmetrizer of # x[1]^L[1]*x[2]^L[2]*...*x[nops(L)]^L[nops(L)] #Remark: m_L(x[1],x[2],...,x[n]) is known as the monomial symmetric polynomial mL:=proc(x,n,L) local k,i: k:=nops(L): rSymm(mul(x[i]^L[i],i=1..k),x,n): end: #NOTE: # mL(x,n,[1,1,...,1]) is the elementary symmetric polynomial #ekn(k,n,x): The elementary symmetric polynomial of degree k in # x[1],x[2],...,x[n] ekn:=proc(k,n,x): rSymm(mL(x,n,[1$k]),x,n): end: #pkn(k,n,x): The power symmetric polynomial pkn:=proc(k,n,x): rSymm(mL(x,n,[k]),x,n): end: #Question: Can we construct ekn(k,n,x) recursively? Yes # Weight-enumerator of the set of subsets of {1,2,...,n} of size k # For example: # ekn(3,4,x)=x[1]*x[2]*x[3] + x[1]*x[2]*x[4] + x[1]*x[3]*x[4] + x[2]*x[3]*x[4] # We can generate all the subsets choose({1,2,...,n},k) # and then do the weight-enumerator over each of those subsets #First ingredient: # #A:=choose({1,2,3,4,5},3); #A:={{1, 2, 3}, {1, 2, 4}, {1, 2, 5}, {1, 3, 4}, {1, 3, 5},{1, 4, 5}, {2, 3, 4}, {2, 3, 5}, {2, 4, 5}, {3, 4, 5}} # If we define the following proc: #Wt:=proc(S,x) local s: #mul(x[s],s in S): #end: # And then we do the following: #add(Wt(a,x),a in A) = x[1]*x[2]*x[3] + x[1]*x[2]*x[4] + x[1]*x[2]*x[5] # + x[1]*x[3]*x[4] + x[1]*x[3]*x[5] + x[1]*x[4]*x[5] # + x[2]*x[3]*x[4] + x[2]*x[3]*x[5] + x[2]*x[4]*x[5] # + x[3]*x[4]*x[5] #Second ingredient: # binomial(n,k)=binomial(n-1,k)+binomial(n-1,k-1) # the first sum is when n belongs to it # the second sum is when n belongs to it #Therefore: #ekn(k,n,x)=ekn(k,n-1,x)+x[n]*ekn(k-1,n-1,k) #eknC(k,n,x): The elementary symmetric polynomial of degree k in # x[1],x[2],...,x[n] (the clever way) eknC:=proc(k,n,x) option remember: option remember: if k>n then RETURN(0): fi: if n=0 then if k=0 then RETURN(1): else RETURN(0): fi: fi: expand(eknC(k,n-1,x)+ x[n]*eknC(k-1,n-1,x)): end: ###################################################################### # C12.txt, March 02, 2026 Help12:=proc(): print(`Park(n,k), Par(n)`): end: #Park(n,k): The set of partitions of n into exactly k parts Park:=proc(n,k) local S,k1,S1,s1: option remember: if n