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 x−1:
(x−1)(x4+x3+x2+x+1)=0⟹x5−1=0⟹x5=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=x5−1, so we can first reduce P modulo x5−1 via modx5−1: x5≡1⇒xr+5q|≡xr(x5)q≡xr, 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=(Nmod2⋅5)mod2
i.e. an integer has the same parity (even / oddness) as that of its units digit. Similarly since 7⋅11⋅13=103+1 we can compute remainders mod 7,11,13 by using 103≡−1, e.g. mod13: d0+d1103+d2(103)2+⋯ ≡d0−d1+d2+⋯, and, similar to the OP, by 9⋅41⋅271=105−1 we can compute remainders mod 41 and 271 by using 105≡1
Nmod41=(Nmod105−1)mod41
for example mod41: 10000200038 ≡(105)2+2⋅105+38≡1+2+38≡41≡0
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+b√n we use
ww′=(a+b√n)(a−b√n)=a2−nb2=c∈Q (≠0 by √n∉Q), which reduces division by an algebraic to simpler division by a rational, i.e. v/w=vw′/(ww′), e.g.
1a+b√n=1a+b√na−b√na−b√n=a−b√na2−nb2=1c(a−b√n)
so-called rationalizing the
denominator. The same idea works even with nilpotents
tn=0 ⇒ 1a−t=an−1+⋯+tn−1an−tn=a−n(an−1+⋯+tn−1)
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 AB→ANBN by the least N so that BN≥m, reduce mod m, then iterate this reduction, e.g.
mod 13: 79≡1418≡15≡315≡32≡2114≡81
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+x14−x10−x8−x6+x2+1 is cyclotomic (a factor of x60−1), so we can detect when the above methods apply for arbitrarily large degree divisors.
No comments:
Post a Comment