Assessment 2 knuth book

# Thus the large factor f can be removed for the price

• Notes
• 27

This preview shows pages 5–8. Sign up to view the full content.

Thus, the (large) factor f~/~ can be removed for the price of computing ~ and performing some divisions, and it remains only to remove the (relatively small) content of G. In other cases, such as the primitive PRS algorithm (Section 3.3), if ~ does not divide fk, we may compute G directly from the formula G = OF~/f~. Alternatively, 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.

Euclid's Algorithm and Computation of Polynomial GCD' s 483 dividing the numerator and denominator of this expression by h = gcd (fk, .0), we obtain G = ((O/h)Fk)/(f,/h). Since (fk/h) and O/h) are relatively prime, it follows that (f,/h) divides Fk. Hence, we may obtain G by computing H = F,/(~/h), and then G = pp(H). We are now prepared to present Algorithm C for computing G' = gcd(Fl', F~') : (1) Set cl = cont(Fl'), c2 = cont(F2'), c = gcd(o, c2). (2) Set Fi = F~' /o , F2 = F2' /c2 . (3) Set f, = lc(F,),f2 = lc(F2), 0 = gcd(f~,f~). (4) Construct a PRS, F1, F2, • • • , Fk. (5) If 0(Fk) = 0, set G' = c, and return. (6) Set G = Fk/(fk/O) or oFk/fk as appropriate. (7) Set G = pp(G) = G/cont (G). (8) Set G' = cG, and return. 3. Constructing a PRS 3.1 INTRODUCTION. We turn now to the problem of constructing a PRS, as re- quired in Step 4 of Algorithm C. Let F1, F2, • • • , Fk be a PRS in ~[x]. Let di = a(F~), for i = 1, • • • , k, and note that dl > d2 > d3 > ... ~ dk > 0. Let ~i -- dl - d~+~ fori = 1, ... ,k -- 1, andnote that ~ > 0, while ~ > 0 for i > 1. If ~ = 1 for all i > 1, the PRS is called normal; otherwise it is called abnormal. Finally, let f~ denote the leading coefficient of Fi. Referring to (7), we shall always choose ~i = ji-1 , i = 3, "",k, (8) so that ~F~ = prem(Fi_2, F~_i), i = 3, ..., k. (9) When a method for choosing the f~ is given, this equation and the terminating con- dition prem(Fk_l, F~) = 0 (10) together provide an algorithm for constructing the PRS. We shall consider several different methods for choosing the fl~. 3.2 THE EUCLIDEAN PRS ALGORITHM. If we choose ~i = 1 for i = 3, • • • , k, then Fi = prem(Fi_2, F~_~) for i = 3, ... , k. Collins calls this the Euclidean PRS algorithm because it is the most obvious generalization of Euclid's algorithm to polynomials over a unique factorization domain that is not a field. Returning to the example (4), the Euclidean PRS is 1, 0, 1, 0, -3, -3, 8, 2, -5 3, 0, 5, 0, -4, -9, 21 -15, 0, 3, 0, -9 15795, 30375, -59535 1254542875143750, - 1654608338437500 12593338795500743100931141992187500. ( 11 ) Journal of the Association for Computing Machinery, Vol. 18, No. 4, October 1971
484 w.s. BROWN Although the Euclidean PRS algorithm is easy to state, it is thoroughly impractical since the coefficients grow exponentially as we proceed through the sequence. The only comparably bad method with any surface plausibility would be to work over the field of quotients of 9, as in (5), but without simplification. 3.3 THE PRIMITIVE PRS ALGORITHM. To obtain a PRS with minimal coefficient growth, we choose ~i = cont (prem(Fi_2, Fi_l)) for i = 3, • • • , k, so that Fa, • .. , Fk are primitive. This is called the primitive PRS algorithm. In the example (4), it yields the sequence 1, 0, 1, 0, -3, -3, 8, 2, -5 3, 0, 5, 0, -4, -9, 21 5,0, -1,0,3 13, 25, -49 4663, - 6150 1. (12) Unfortunately, it is necessary to calculate one or more GCD's of coefficients at each step, and these become progressively harder as the coefficients grow. However, since the growth is essentially linear (Section 3.5), these GCD's would be well worth the effort if the Euclidean PRS algorithm were the only alternative.

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

This is the end of the preview. Sign up to access the rest of the document.
• Spring '13
• MRR
• Math, Coefficient, F~

{[ 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