Re: PolynomialMod
- To: mathgroup at smc.vnet.net
- Subject: [mg121346] Re: PolynomialMod
- From: Daniel Lichtblau <danl at wolfram.com>
- Date: Mon, 12 Sep 2011 04:19:02 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
----- Original Message -----
> From: "Artur" <grafix at csl.pl>
> To: mathgroup at smc.vnet.net
> Sent: Sunday, September 11, 2011 6:28:34 AM
> Subject: PolynomialMod
> Dear Mathematica Gurus,
>
> Who is able help me to write Mathematica procedure which will be
> improovment of recent PolynomialMod.
>
> If we do
> PolynomialMod[ 1 + 3 #1 + 5 #1^2 + 5 #1^3 + 5 #1^4 + 3 #1^5 + #1^6, -1
> +
> 2 #1^2 + #1^3]
> result is OK
> 1 + 6 #1 + 6 #1^2
>
> But if we do
> PolynomialMod[1 + 3 #1 + 5 #1^2 + 5 #1^3 + 5 #1^4 + 3 #1^5 + #1^6, -1
> +
> (-(3/2) - (I Sqrt[23])/2) #1 + (3/2 - (I Sqrt[23])/2) #1^2 + #1^3]
> Result is wrong
> good should be
> -2 + (-(1/2) - (I Sqrt[23])/2) x + x^2
>
> Who is able to write good one procedure e.g. PolMod to automatic
> reduction of any degree polynomials by polynomial smaller degree?
>
> Best wishes
> Artur Jasinskii
Actually a correct result should be zero. PolynomialRemainder, among other functions, can be used for this.
In[256]:= p1 = (1 + 3 #1 + 5 #1^2 + 5 #1^3 + 5 #1^4 +
3 #1^5 + #1^6) &[x]
Out[256]= 1 + 3*x + 5*x^2 + 5*x^3 + 5*x^4 + 3*x^5 + x^6
In[257]:= m1 = (-1 + (-(3/2) - (I*Sqrt[23])/2)*#1 + (3/
2 - (I*Sqrt[23])/2)*#1^2 + #1^3 & )[x]
Out[257]= -1 + (-(3/2) - (I*Sqrt[23])/2)*x + (3/2 - (I*Sqrt[23])/2)*
x^2 + x^3
In[272]:= PolynomialQuotientRemainder[p1, m1, x]
Out[272]= {-1 + (-(3/2) + (I*Sqrt[23])/2)*x + (3/2 + (I*Sqrt[23])/2)*
x^2 + x^3, 0}
Daniel Lichtblau
Wolfram Research