Professional Documents
Culture Documents
Discarding Algorithm For Rational Roots of Integer Polynomials PDF
Discarding Algorithm For Rational Roots of Integer Polynomials PDF
J3A3L3@gmail.com
Spain
Dedicated to Nityangi
ABSTRACT ____________________________________________________________
Let
n
p( x) an x n an 1 x n 1 a1 x a0 a j x j .
j 0
Proof ___________________________________________________________
n n n n
p( x0 ) a j x0j a0 a j x0j 0 a0 a j x0j x0 a j x0j 1
j 0 j 1 j 1 j 1
n
a0
a j x0j 1
x0 j 1
1
1.2. If x0 {1, 0, 1} is an integer root of p(x), then x0 1 is a divisor of p(+1).
Proof ___________________________________________________________
n n n n
a0 a j a x a j
j
a (x j
1)
p(1)
j 0 j 0
j 1 j 1 j 1 j 1
x0 1 x0 1 x0 1 x0 1
Let
x0k 1
qk ( x0 ) , k 1, 2, , n.
x0 1
Then,
p(1) xn 1 xn 1 1 x0 1 n
an 0 an 1 0 a1 ak qk ( x0 ),
x0 1 x0 1 x0 1 x0 1 k 1
p(1) n
ak qk ( x0 ) ~ {1, 0, 1},
x0 1 k 1
Proof ___________________________________________________________
The properties 1.2 and 1.3 can be stated in this more compact form:
2
2. Discarding Algorithm ______________________________________________
By 1.1, integer roots must divide the independent term. So, we will take as initial
candidates to integer roots the set of divisors of a0 .
The application of the discard algorithm will only be profitable if a0 has many divisors,
in which case it can reduce the number of divisions necessary to discover the whole
roots.
This algorithm, based on the three properties demonstrated in the previous section, is a
much finer “sieve” than the one based only on property 1.1, since it involves two new
criteria, determining a much more selective “filtering”; often, the integers that cross it
are only the roots of the polynomial.
The algorithm has been designed in a way that minimizes writing, and that its execution
is intuitive and mnemonic.
If a0 has d positive divisors greater than 1, also it has d negative divisors less than 1.
To apply the properties 1.2-3, these 2d divisors must be incremented by ±1, which
produces 4d other numbers to consider, and the number of divisors would be 6d.
Thus, the direct application of 1.2-3 would have the following price: it would be
necessary to make 4d "extra" tests of divisibility, and to write a threefold number of
divisors of absolute value greater than one, in exchange for avoiding a certain number
of divisions...
In order to improve the implementation of the algorithm, let's note the following
additional properties:
These last properties, although they may seem trivial, allow to reduce drastically the
amount of writing, simply extending the divisibility tests of the positive divisors:
3
In a more compact form:
p( 1)
p( x0 ) 0
x0 1
p( 1)
p( x0 ) 0
x0 1
Let
D0 { d1 , d2 , , d p 1 , d p }
p(1) p(1)
d1 d2 d p 1 d p
p(1) p(1)
Is p(1) divisible by d k 1 ?
Is p(1) divisible by d k 1 ?
Is p(1) divisible by d k 1 ?
Is p(1) divisible by d k 1 ?
When we test the divisibility by d k 1 we work with p(1) and p(1) on the left;
when we test the divisibility by d k 1 , we work with p(1) and p(1) on the right.
Whenever one of these divisibility tests is negative, we plot in the cell containing the
divisor tested, d k , the diagonal whose direction is determined by the relative position of
p(1) or p(1) with respect to d k .
4
There are four cases:
If d k 1 doesn´t divide p(1) , we must draw the main diagonal (ascending from
right to the left), since p(1) is considered to the left and above d k when is tested
d k 1 . This means that d k has been discarded.
If d k 1 doesn´t divide p(1) , we must draw the secondary diagonal (down from
right to the left), since p(1) is considered to the left and below d k when is tested
d k 1 . This means that d k has been discarded.
If d k 1 doesn´t divide p(1) , we must draw the main diagonal, since p(1) is
considered to the right and below d k when is tested d k 1 . This means that d k has
been discarded.
Discard criteria
Find the polynomial q( x) resulting from eliminating all the roots 0, 1, -1 (with any
degree of multiplicity) from p( x) and to reduce their coefficients to relatively
prime (dividing, if necessary, by the GCD of these). The Discarding algorithm is
applied to this reduced polynomial, q( x) .
5
If –1 isn´t a root of p( x) , i.e., if p(1) 0 , then q( x) p1 ( x) and q(1) p1 (1)
is the first nonzero remainder obtained during the test of the root +1.
p1 ( x) p (1)
p1 ( x) ( x 1) q( x) q( x)
q(1) 1
( x 1) 2
Thus, by this correction formula, q(1) can be calculated from p1 (1) , whose
value is simply the first nonzero remainder obtained during the test of the root +1.
q(1) is the first nonzero remainder obtained during the test of the root -1.
6
4. Example _________________________________________________________
p( x) 2 x8 50 x7 48x6 2 x5 52 x 4 96 x3 2 x 2 48 x
61232112321123211232112321y
1 25 24 -1 -26 -48 1 24
+1 1 26 50 49 23 -25 -24
1 26 50 49 23 -25 -24 0
+1 1 27 77 126 149 124
1 27 77 126 149 124 100 p1 (1) 100
1 26 50 49 23 -25 -24
-1 -1 -25 -25 -24 1 24
1 25 25 24 -1 -24 0
-1 -1 -24 -1 -23 24
1 24 1 23 -24 0 q( x) x 4 24 x 3 x 2 23x 24
-1 -1 -23 22 -45
1 23 -22 45 -69 q(1) 69
The calculations made so far are the usual ones for the search of the roots 1.
The first nonzero remainder got by iterating in the Ruffini algorithm for the root 1 is
q(1) . If p(1) 0 , i.e., 1 isn´t a root of p( x) , then q(1) p1 (1) ; but in this case
1 is a root of p( x) , with order of multiplicity = 2; therefore, we will apply the
above formula of correction:
p1 (1) 100
q(1) 2 25 q(1) 25
2 2
7
So, the schema for the discarding algorithm is the following:
25 25
2 3 4 6 8 12 24
69 69
+3 +4 +8 +12 +24
25 25
2 3 4 6 8 12 24
69 69
-3 -6 -8 -12
+3 +4 +6 +8 +12 +24
25 25
2 3 4 6 8 12 24
69 69
-2 -3 -6 -8 -12
In this case, by the application of the discarding algorithm have been avoided 11
divisions by the Ruffini algorithm, in exchange for the simple scheme,
25 25
2 3 4 6 8 12 24
69 69
whose construction only involves operations that are carried out quickly and without
difficulty: subtract or add the unit and apply criteria of divisibility.
8
It only remains to prove by division or theorem of the rest whether 2, 4, 24 are
roots of q( x) :
1 24 1 23 -24
+2 2 52 106 258
1 26 53 129 234
1 24 1 23 -24
-4 -4 -80 316 258
1 20 -79 339 -1380
1 24 1 23 -24
-24 -24 0 -24 24
1 0 1 -1 0
Factoring q( x) ,
q( x) x4 24 x3 x2 23x 24 ( x 24)( x3 x 1)
93 1 3 93 1
x 3
18 2 18 2
1 3 93 1 3 93 1 1 31 3 3 3 31 3 3
x i 3 .
2 18 2 18 2 2 2 2
9
5. FRACTIONARY RATIONAL ROOTS _______________________________
Fortunately, the polynomials with which we use to work are usually not as hostile as the
q( x) of the previous example.
However, the applications of the discard algorithm are not limited to the search for
integer roots. In fact, since any polynomial can be transformed by a change of variable
into another polynomial whose rational roots are all integers, the discarding algorithm is
apt to be applied for the discarding of fractional rational roots.
a
If the irreducible fraction is a root of p( x) , we have:
b
n n 1
a a a a
p an an 1 a1 a0 0 ,
b b b b
an
an
b
an 1a n 1 an 2a n 2b a1abn 2 a0bn 1 ,
and being b prime relative with a, so will be with a n ; therefore, we conclude that b
must divide the coefficient an .
Otherwise,
bn a bn
p an a n 1 an 1a n 2b a1b n 1 a0 0,
a b a
and
bn
a0 an a n 1 an 1a n 2b a1b n 1 .
a
A reasoning analogous to the previous one, proves that a, that doesn´t divide b n , has to
divide a0 .
10
Thus, we can state the following necessary condition for fractional rational roots:
Therefore, a polynomial with integer coefficients can´t have fractional rational roots if
the coefficient of the highest degree (leading coefficient) is 1, i.e., if the polynomial is
monic.
The result we have reached is the so-called Gauss' Lemma for Monic Polynomials [2].
5.2. Transformed to integer polynomial whose rational roots are all integers.
p( x) an x n an 1 x n 1 a1 x a0
y
q( y ) ann 1 p y n an 1 y n 1 ann 2 a1 x ann 1a0
an
an
1
an
1
an0
an 1 an 1
a1n
an 2 an an 2
an2
an2 an 3 q( y ) y n a y n 1
p( x) an 3 n 1 ann 2 a1 x ann 1a0
an 4 an3
an3an 4
ann2
a1 an a1
n2
an n1
a0 ann 1a0
11
The fractional roots of the primitive polynomial p( x) are obtained by dividing the
integer roots of the transformed polynomial q( y ) by the leading coefficient an :
yi
xi
an
6. Example _________________________________________________________
p( x) 3x5 x 4 2 x3 12 x 8
61232112321123211232112321y
Monic transformed of p( x) :
y
y 3x q( y) 34 p q( y) y 5 y 4 6 y 3 324 y 648
3
Applying the traditional method of testing the divisors of 648 in increasing order, we
would get:
1 1 -6 0 -324 648
+1 1 2 -4 -4 -328
1 2 -4 -4 -328 320
1 1 -6 0 -324 648
-1 -1 0 6 -6 330
1 0 -6 6 -330 978
1 1 -6 0 -324 648
+2 2 6 0 0 -648
1 3 0 0 -324 0
Certainly we have been fortunate to find a root so soon, since 648 2334 has
2(3 1)(4 1) 40 divisors!.
2
Hence, x is a rational root of p( x) .
3
12
After removing the root y = 2 in q( y ) , we have the polynomial r ( y) y 4 3 y 3 324 .
If we´d try to find an integer root of r ( y ) , we would not be so lucky, because it would
be necessary to make 28 divisions! to prove exhaustively that r ( y ) has no integer roots.
Let's see that the discarding algorithm only filters one candidate to integer root, which
in this case supposes an economy of 27 divisions:
{2, 3, 4, 6, 9, 12, 18, 27, 36, 54, 81, 108, 162, 324} .
q(1) 320
r ( 1) 320
q( y ) 1 2 1
Calculation of r (1) and r (1) : r ( y )
x2 q(1) 978
r (1) 326
1 2 3
Discarding of divisors:
320 320
326 326
The discard algorithm has only filtered one of the 28 divisors: 3 ; therefore, only it is
necessary to divide r ( y ) by y 3 to complete the test:
1 3 0 0 -324
-3 -3 0 0 0
1 0 0 0 -324
2
So, p( x) has only one rational root, x .
3
[1] https://www.cut-the-knot.org/Generalization/RationalRootTheorem.shtml
[2] https://www.cut-the-knot.org/arithmetic/algebra/GaussLemma.shtml
13