Assessment 2 knuth book

# Nomials is the product of the gcd of their contents

This preview shows pages 12–15. Sign up to view the full content.

nomials is the product of the GCD of their contents and the GCD of their primitive parts. 4.3 ALGORITHM 5I. Let Z denote the domain of integers, and let Zp denote the field of integers modulo a prime p. Let Fi' and F ' 2 be given nonzero polynomials in Z[Xl, ... , xo]. Algorithm M computes their GCD, G', and their cofactors, H~' = FI'/G' and H'2 = F2'/G', making essential use of Algorithm P (Section 4.5), which computes the GCD and cofactors of given nonzero polynomials in Zp[Xl, .." , Xv]. Each of these algorithms obtains the cofactors for the essential purpose of verifying the GCD; however, they are frequently a very welcome byproduct of the computa- tion. Let c~ = cont(F~'), c2 = cont(F2'), and c = gcd(o, c2). Also, let F1 = Fi'/O, F2 = F2'/c2, G = gcd (F~, F2), H~ = F~/G, and H2 = F2/G. Then G' = cG, H~' = (cl/c)H1, and H2' = (c~/c)H2. Let f~, f2, g, h~, and h2 be the leading coefficients of F~, F~, G, H1, and H2, re- spectively. As in Section 2.4, define ~ = gcd(f~, f~) and G = ((O/g)G. Also, define fil = oF~, F~ = OF2, tt~ = gH~, and/42 = gH2, so that fi~ = G/41 and F~ = ¢//~. Note thatpp(G) = G, lc(G) = g, lc(/41) = gh~ = fl, and lc(/4:) = gh~ = f~. Observe that fl, f2, and ¢ can easily be obtained at the beginning of the computation, while g cannot be known until the end. Let d = i) (G). Although d cannot be determined until the end of the computation, it is evident that d _< min (1) (F1), ~ (F~)). At any given time in the execution of Algorithm M, there is a set of odd primes pi, " " , p~ that have been used and not discarded. Furthermore, for i = 1, • • • , n, the algorithm has computed /~(~) = fi~ mod p~, (31) 1 P(~) F~ mod p~, 2 and three polynomials G(~), ~(~) ~(~) t/~ , and///: satisfying = • gcd (/~'~ , ,. e ) (32) and 1 ~(~) ~(~)~) (33) 2 ---- in Z~,[xl, ... , xv], where ~(1) = ~ rood pl. (34) Since the GCD in (32) is unit normal (in this case, monic) by definition, it follows that lc (~(i)) = ~)(i). Since G I F1 and G l F2 in Z[xl, ". , xv], we have Gv~ I F~", Gvi ] P~'), and therefore Gpi [ G (~) in Zp~[xl, ... , xv], where Gv~ = G mod pl. It follows immediately that Journal of the Association for Computing Machinery, Vol. 18, No. 4, October 1971

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
490 w.s. BROWN i) (G C~) ) >__ 0 (Gv~) = 0 (G) = d. The algorithm keeps only those pl for which ~) (~c,)) is minimal to date; hence, we always have 0 (G(o) = e _> d. If e > d, the algorithm will discover the fact (for proof, see Section 4.4) and start over. Eventually, e = d, and G (~) ~ G mod p~, H~) ~ /71 mod pl, (35) ~o ~_ /t2 mod p~, fori = 1, ...,n. Instead of preserving all of the quadruples (pl, G (~), H~), ~o), we maintain only the integer q = l~ P~, (36) i~l and the unique polynomials G*, Hi*, and H2* with integer coefficients of magnitude less than q/2, such that G* ~- G (~) mod pi, Hi* ------ H~') mod pi, (37) H2* ------ ~(~) • ~2 mod p~, for i = 1, • • • , n. Now as soon as e = d, we see from (35) and (37) that G* -= G mod q, Hi* --- /tl mod q, (38) H2* -= //2 mod q. When we also achieve q> ~ = 2 max [¢l, where ~k ranges over the coefficients of G,/tz, and/~, it follows that (39) G* ~ G, HI S -~ /~1, (40) H2* = IIi2. To obtain the final results, we then use the relations G = pp(G), H1 = ttl/g, (41) H2 = t72/g, and G' = cG, HI ' = (Cl/C)H1, H2'= (c2/c)H2, all of which were derived earlier. (42) Journal of the Association for Computing Machinery, Vol. 18, No. 4, October 1971
Euclid's Algorithm and Computation of Polynomial GCD's 491 In order to guarantee that the coefficients of G*, Hi*, and H2* converge to the correct signed integers, we shall assume throughout that the integers modulo r

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern