Assessment 2 knuth book

# 10 setn n 1 11 if n 1 set q p g g h q h2 q otherwise

This preview shows pages 17–20. Sign up to view the full content.

(10) Setn= n+ 1. (11) If n = 1, set q = p, G* = G, H,* = /q, , H2* = ~q~ . Otherwise, update the quadruple (q, G*, H~*, H2*) to include (p, G, /7,, H~) by using the Chinese re- mainder algorithm (Section 4.8) (which in this ease is a form of interpolation [1, p. 430]) with moduli mi = q and m~ = Xv -- b to extend (53) (coefficient by co- efficient), and then replaeing q by q(x~ -- b) to extend (52). (12) Ifn < ~, go baek to Step (6). Otherwise, we now know thatn > ~ > ~,so (40) holds unless e > d. To exclude this unlikely possibility, it suffiees to prove the relations G'Hi* = ff~ and * * G H~ = ~0~, which hold modulo q by (33), (49), (52), and (53). (13) IfOv(G*) + O~(H,*) ~ ~,or 0,(G*) + O~(H~*) ~ ~, seth = 0 and go back to Step (6). Otherwise we have q] (G*H~* - ~,) and 0,, (q) = n > ~ >_ h >_ Ov (G'Hi* - 1~,), and therefore G'H,* = fla. Similarly, G*Hz* = fi~, and therefore (40) is established. H * (14) Set G pp(G*), g = le(G), H~ = H~ /g, H2 = ~ /g. (15) Set G' = cG, H; = (o/c)H~, H~' = (c~/c)H~, and return. 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
Euclid's Algorithm and Computation of Polynomial GCD ' s 495 4.6 UNLUCKY b-VALUES. We shall call the integer b C Zp chosen in Step (6) of Algorithm P lucky if e = d, and unlucky otherwise. In Theorem 4 we shall prove that all of the unlucky b-values are roots (in Zp) of a polynomial o- (in 9 = Zp[x~]), which depends only on F~ and F~. Using this result, Theorem 5 bounds the total number u of unlucky b-values, thereby establishing the fact that the algorithm terminates. If b is chosen at random from the elements of Zv, the probability of its being un- lucky is u/p. If p is large (as suggested in Section 4.4), this probability is exceed- ingly small. Thus if F~ and F2 are relatively prime, we can expect to prove it with only a single b-value. Otherwise the expected number of b-values to determine the GCD and the cofactors is fi = p + 1 = max (0v(F1), 0v(/~2)) -t- ]. THEORE_U 4. Let F~ and F2 be given nonzero polynomials in 9[x~, ..., x,-1], where ~ = Zp[x~]. Let G = ged(F~, F2), and let di= O~(G). Also, let S}~) (F~, F:) denote the jth subresultant of F1 and F2 viewed as univa','iale polynomials in x~ , with eoeficients in ~[xl, -.. , xi_~, x~+~, ... , x~_~], and let ai be the content (in ~) of S(~) (F~ F2 ) viewed as a polynomial in 9Ix,, , x~_l]. (Here di is the degree of G di , " " " in X~, and not, as in Seclion 3.5, the degree of the ith polynomial in a PRS.) Finally, let v--1 = II,,~. (55) i=l Then every unlucky b-value is a root (in Zp) of a. PROOF. The proof is analogous to the proof of Theorem 1. THEOREM 5. Let u be the total number of unlucky b-values, let and let Finally, let V--1 m = ½ max (Oi(F~) + O~(F2)), (56) i=I e = max (0~ (F1), 0~ (F2)). (57) (ss) = 2me(v- 1). Then u < ~. PROOF. Let P = 1~ (xv -- b), where the product is taken over all unlucky b-values. Since P 1 cr by Theorem 4, we have u = 0v (P) < 0~ (~) = ~ 0v (~i). But by (20), 0" (gi) < 2me, sou < 2me(v - 1), aswas to be shown. 4.7 ALGORITHM U. Let F1 and F2 be given nonzero polynomials in Zv[x], where p is a fixed prime. Algorithm U computes G = gcd(F1, F2). Since Zp is a field, G must be monic in order to satisfy the requirement of unit normality. Also since Zp is a field, we may use the rational algorithm of Section 2.2. In the example (4) with p = 13, the monic PRS which mirrors (6) is 1, 0, 1, 0, --3, -3, --5, 2, --5 1, 0, 6, 0, 3, --3, --6 1,0,5,0, --2 1, --3 1. (59) Journal of the Association for Computing Machinery, Vol. 18, No. 4, October 1971
496 w.s. BROWN This proves that F1 and F~ are relatively prime in Zl~[x], and hence also in Z[x].

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