Re: finding the weighted degree of a polynomial
- To: mathgroup at smc.vnet.net
- Subject: [mg79726] Re: finding the weighted degree of a polynomial
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Thu, 2 Aug 2007 04:02:22 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <f8pk97$2pg$1@smc.vnet.net>
Arnaud Dagnelies wrote:
> Let p(x,y) be a polynomial in x,y expressed in its expanded form, i.e.
> as a sum of terms as follows:
>
> p(x,y) = sum c_ij x^i y^j
>
> I want to find the (a,b)-weighted degree of this polynomial defined as
>
> wdeg(p, {a,b}) = max (ai + bj) with c_ij != 0
>
> (where a and b are given fixed values)
>
> help is welcome,
> thanks
First, we convert the polynomial into a list, then change the values of
x and y by provided by the parameters, and finally apply the function
*Max* to the resulting list of numeric values.
In[1]:=
wdeg[poly_, {a_, b_}] := Max[List @@ poly /. {x -> a, y -> b}]
p = x^10 + 10*x^9*y + 120*x^7*y^3 + 210*x^6*y^4 + 252*x^5*y^5 +
120*x^3*y^7 + 45*x^2*y^8 + 10*x*y^9 + y^10;
wdeg[p, {3, 5}]
Out[3]= 253125000
Regards,
Jean-Marc