0
$\begingroup$

I do not understand this statement "reduce the coefficient modulo 5 and take remainder"?

Is the following Maple command to reduce the coefficient modulo 5 , which coefficient to reduce?

rem(6*x^2*y-5*x^2-x*y^3+7*y^2+13, pmod(6*x^2*y-5*x^2-x*y^3+7*y^2+13,5)); 

And why use 5 and 7 ? where do these integer come from?

I find a statement divide each coefficient by $q$ and take the remainder but type command according to this statement is not correct

rem(6*x^2*y-5*x^2-x*y^3+7*y^2+13, quo(6*x^2*y-5*x^2-x*y^3+7*y^2+13, 5)); 

The following two also not equal x^2y-xy^3+2y^2-2

rem(pmod(6*x^2*y-5*x^2-x*y^3+7*y^2+13, 5), 6*x^2*y-5*x^2-x*y^3+7*y^2+13) rem(6*x^2*y-5*x^2-x*y^3+7*y^2+13, pmod(6*x^2*y-5*x^2-x*y^3+7*y^2+13, 5))/5 

What is the difference between mod and rem in Maple? Aren't they both remainder?

  • 0
    Please reject my su$g$gested edit $f$or this; I did not notice it's maple code...2011-11-21

1 Answers 1

3

I assume you meant modp (which is one variant of the mod operator in Maple) instead of pmod (which does not exist in my version of Maple, or in the MapleSoft online help system).

The difference between rem and mod is that rem does polynomial division, while mod simply does ordinary integer division on the coefficients. For example:

p := expand( (x-1)*(x+9)*(x^2-23) ); 

$p := x^4 - 32 x^2 + 8 x^3 - 184 x + 207 $

p mod 10; 

$x^4 + 8 x^2 + 8 x^3 + 6 x + 7 $

rem(p, x-1, x);  # x-1 is a factor of p 

$0$

r := rem(p, x^3-1, x); 

$r := 215 - 32 x^2 - 183 x$

q := quo(p, x^3-1, x); 

$q := x + 8$

expand(q * (x^3-1) + r);  # reconstruct p from q and r 

$x^4 - 32 x^2 + 8 x^3 - 184 x + 207$

  • 0
    i guess my book's example is wrong, as another book's example is using pmod or modp that is correct2011-11-22