Re: Re: Removing constant multiples from polynomials
- To: mathgroup at smc.vnet.net
- Subject: [mg73444] Re: [mg73417] Re: [mg73383] Removing constant multiples from polynomials
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Fri, 16 Feb 2007 05:20:39 -0500 (EST)
- References: <200702150955.EAA04553@smc.vnet.net> <200702160553.AAA15305@smc.vnet.net>
If I understood the question correctly than the answers given by most posters (which only removed the rational numeric factor from the polynomial) all missed the point of the question, which was, I believe, how to obtain a monic polynomial in the given variables, given an arbitrary polynomial. This is exactly what GroebnerBasis does, e.g. First[GroebnerBasis[2/3*(x-1)(y-2),{x,y}]] y x-2 x-y+2 First[GroebnerBasis[Pi*(x-1)(y-2),{x,y}]] y x-2 x-y+2 If you want GroebnerBasis to work also with symbolic coefficients we need to use the option CefficientDomain->RationalFunctions First[GroebnerBasis[a*(x-1)(y-2),{x,y},CoefficientDomain- >RationalFunctions]] y x-2 x-y+2 The only other solutions that I have seen, which work in all these cases, rather than just for the specific example given by Chris, are Adrianno Pescoletti's: (#1/Coefficient[#1, x*y, 1] & )[a*(x-1)(y-2)] (x-1) (y-2) and mine: Times @@ (Power @@@ DeleteCases[ FactorList[a*(x - 1)(y - 2)], _?(FreeQ[#, x | y] &)]) (x-1) (y-2) Andrzej Kozlowski On 16 Feb 2007, at 06:53, Andrzej Kozlowski wrote: > On 15 Feb 2007, at 10:55, Azumanga wrote: > >> I am working on an algorithm which manipulates sets of polynomials. >> Often it produces (after an application of FullSimplify) polynomials >> like: >> >> 1276(x-1)(y-2)/397 >> >> I'm only interested in the solutions to the polynomial, so to me this >> is "equivalent" to: >> >> (x-1)(y-2) >> >> As a short-term solution I call "GroebnerBasis" on the single >> polynomial, which seems to perform this simplification. However is >> there a simpler method? >> >> Thank you, >> >> Chris >> >> > > GroebnerBasis does it because it outputs a reduced Groebner basis of > the polynomial ideal containing your polynomial(s). I can't imagine > what you can possibly mean by a "simpler method" in this case? Both > in terms of the length of the code you need to write and of the > actual algorithm that is used I don't think there is any genuinely > "simpler way". Of course there is a practically countless number of > programs you could write that yourself that will do it; for example: > > Times @@ (Power @@@ DeleteCases[ > FactorList[1276(x - 1)(y - 2)/3], _?(FreeQ[#, x | y] &)]) > > but you can hardly call this "simpler". > > Andrzej Kozlowski >
- References:
- Removing constant multiples from polynomials
- From: "Azumanga" <4zumanga@gmail.com>
- Re: Removing constant multiples from polynomials
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Removing constant multiples from polynomials