# OK to post homework # Aurora Hiveley, 4/10/26, Assignment 21 Help:=proc(): print(`eknVC(n,k,x), hkn(k,n,x), CheckNewton(k,n)`): end: ### Problem 2 # Report on the progress of your project (including that you did nothing so far) # lucy and i read through the articles linked on the class webpage which are relevant to our project. # we also began work on a code package which, so far, contains copies of all procedures written in class which # may be useful to us. we also wrote a few procedures of our own which calculate some statistic of a given permutation # so that we may begin testing on bootstrap samples next week. ### Problem 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+... # for n from 1 to 6 do # f := expand(mul((1 + x[i]*t), i=1..n)): # g := 1 + add(ekn(k,n,x)*t^k, k=1..n): # expand(f-g); # od: ## calculation: # 1 + ekn(1,n,x)*t + ... + ekn(n,n,x)*t^n = (1 + x[1]*t) * ... * (1 + x[n]*t) # 1 + ekn(1,n-1,x)*t + ... + ekn(n-1,n-1,x)*t^(n-1) = (1 + x[1]*t) * ... * (1 + x[n-1]*t) # ekn(k,n,x)*t^k - ekn(k,n-1,x)*t^(k-1) # = LHS(n) - LHS(n-1) # = RHS(n) - RHS(n-1) # = ( (1 + x[1]*t) * ... * (1 + x[n]*t) ) - ((1 + x[1]*t) * ... * (1 + x[n-1]*t)) # = ( (1 + x[n]*t) - 1 ) * ((1 + x[1]*t) * ... * (1 + x[n-1]*t)) # = (x[n]*t) * (1 + ekn(1,n,x)*t + ... ekn(n-1,n,x)*t) # so ek(k,n,x) = ekn(k,n-1,x) + x[n]*( 1 + ekn(1,k,n,x) + ... + ekn(n-1,n,x) ) # = ekn(k,n-1,x) + x[n]*ekn(k-1,n-1,x) # eknVC(k,n,x): computes ekn(k,n,x) in a very clever way eknVC:=proc(k,n,x) local i: 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(eknVC(k,n-1,x) + x[n]*eknVC(k-1,n-1,x)): end: ## Problem 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 ) # 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 i: coeff(expand(taylor( 1/mul((1-t*x[i]), i=1..n),t )),t,k); end: ### Problem 5 # CheckNewton(k,n): checks the identity for specific k and n. CheckNewton := proc(k,n) local i: evalb(k*ekn(k,n,x) = expand(add( (-1)^(i-1)*ekn(k-i,n,x)*pkn(i,n,x), i=1..k ) )): end: # Then run CheckNewton(k,n) for all 5>=n>=k>=1 # {seq(seq(CheckNewton(k,n), n=k..5), k=1..5)}; # {true} ### copied from C21.txt #C21.txt, April 9, 2026 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) , ekn(k,n,x), pkn(k,n,x) `): print(`eknC(k,n,x)`): end: with(combinat): #SubsPi(f,x,pi): inputs a polynomial f(x[1], ..., x[n]) (n:=nops(pi)) #and ouputs the new polynomial obtaine by substituting x[i]->x[pi[i]] SubsPi:=proc(f,x,pi) local n,i: 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[n]) is symmetric the Pablo way 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[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[n]) and #outputs the sum of all the distinct images rSymm:=proc(f,x,n) local Sn,pi: Sn:=permute(n): convert({seq(SubsPi(f,x,pi), pi in Sn)}, `+`): 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 nn 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: