Saturday, January 9, 2016

abstract algebra - Polynomial division: an obvious trick? [reducing mod textitsimpler multiples]



The following question was asked on a high school test, where the students were given a few minutes per question, at most:




Given that,

P(x)=x104+x93+x82+x71+1


and,
Q(x)=x4+x3+x2+x+1

what is the remainder of P(x) divided by Q(x)?







The given answer was:





Let Q(x)=0. Multiplying both sides by x1:
(x1)(x4+x3+x2+x+1)=0x51=0x5=1


Substituting x5=1 in P(x) gives x4+x3+x2+x+1. Thus,
P(x)0(modQ(x))







Obviously, a student is required to come up with a “trick” rather than doing brute force polynomial division. How is the student supposed to think of the suggested method? Is it obvious? How else could one approach the problem?



Answer



The key idea employed here is the method of simpler multiples - a very widely used technique. Note that Q has a "simpler" multiple QR=x51, so we can first reduce P modulo x51 via modx51: x51xr+5q|xr(x5)qxr, then finally reduce that modQ, i.e.



PmodQ=(PmodQR)modQ



This idea is ubiquitous, e.g. we already use it implicitly in grade school in radix 10 to determine integer parity: first reduce mod 10 to get the units digit, then reduce the units digits mod 2, i.e.



Nmod2=(Nmod25)mod2 



i.e. an integer has the same parity (even / oddness) as that of its units digit. Similarly since 71113=103+1 we can compute remainders mod 7,11,13 by using 1031, e.g. mod13: d0+d1103+d2(103)2+ d0d1+d2+, and, similar to the OP, by 941271=1051 we can compute remainders mod 41 and 271 by using 1051




Nmod41=(Nmod1051)mod41



for example mod41: 10000200038 (105)2+2105+381+2+38410



Such "divisibility tests" are frequently encountered in elementary and high-school and provide excellent motivation for this method of "divide first by a simpler multiple of the divisor" or, more simply, "mod first by a simpler multiple of the modulus".



This idea of scaling to simpler multiples of the divisor is ubiquitous, e.g. it is employed analogously in the method of rationalizing denominators and in Gauss's algorithm for computing modular inverses.



For example, to divide by an algebraic number we can employ its norm as a simpler multiple, e.g. for w=a+bn we use

ww=(a+bn)(abn)=a2nb2=cQ (0 by nQ), which reduces division by an algebraic to simpler division by a rational, i.e. v/w=vw/(ww), e.g.



1a+bn=1a+bnabnabn=abna2nb2=1c(abn)



so-called rationalizing the
denominator
. The same idea works even with nilpotents



tn=0  1at=an1++tn1antn=an(an1++tn1)


Another example is Gauss' algorithm, where we compute fractions modm by iteratively applying this idea of simplifying the denominator by scaling it to a smaller multiple. Here we scale ABANBN by the least N so that BNm, reduce mod m, then iterate this reduction, e.g.




mod 13: 7914181531532211481



Denominators of the reduced fractions decrease 9>5>2> so reach 1 (not 0 else the denominator would be a proper factor of the prime modulus; it may fail for composite modulus)



See here and its 25 linked questions for more examples similar to the OP (some far less trivial).



Worth mention: there are simple
algorithms
for
recognizing cyclotomics (and products of such), e.g. it's shown
there that x16+x14x10x8x6+x2+1 is cyclotomic (a factor of x601), so we can detect when the above methods apply for arbitrarily large degree divisors.



No comments:

Post a Comment

analysis - Injection, making bijection

I have injection f:AB and I want to get bijection. Can I just resting codomain to f(A)? I know that every function i...