#Sowmya Srinivasan hw9.txt 20 February 2014 #read C6.txt #ApplyUmbra(P,x,U,m) inputs a polynomial P in variable x and an expression #U in discrete variable m, and outputs, for each term a[i]*x^i in P, U(i) with(PolynomialTools) : ApplyUmbra:=proc(P,x,U,m) local L,i,s : L:=CoefficientList(P,x) : for i from 0 to nops(L)-1 do s[i]:=L[i+1]*subs(m=i,U) : od : add(s[i],i=0..nops(L)-1): end: #PnG(n,x,U,m) inputs a nonnegative integer n, variable name x, #expression U in discrete variable m, and outputs the monic polynomial P #of degree n st U applied to P*x^i=0 for i=0..n-1 PnG:=proc(n,x,U,m) local P,i,a,eqs,vars : P:=x^n+add(a[i]*x^i,i=0..n-1) : vars:={seq(a[i],i=0..n-1)} : eqs:={seq( ApplyUmbra(P*x^i,x,U,m)=0,i=0..n-1) } : sort(subs(solve(eqs,vars),P)): end: #I checked that PnG(n,x,1/(m+1),m) agrees with Pn(n,x) for n=0..10 . #GuessCoeff(n,i,U,m) GuessCoeff:=proc(n,i,U,m) local L,j,x : L:=[seq(coeff(PnG(j,x,U,m),x^(j-i)),j=1..2*i+10)] : GuessRF(L,n) : end: #I don't know how to fix my GuessCoeff function. In particular I'm not sure #if the way I defined the list L is correct.