Assessment 2 knuth book

# X 9 x 8 x 7 x 6x 5 x 4 x 3 x x 1 and ilab 0 ila ilb

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

x 9+ x 8+ x 7 +x 6+x 5- x 4- x 3- x ~- x- 1, and il(AB) = 0 < il(A) + il(B) = log 5. In this latter example, A acts as a first difference operator. The effect may be exhibited more dramatically by taking A (x) = (x -- 1) ~ for some n > l, and choosing B so that the nth differences of its coefficients are all equal to ±1. In spite of these exceptions, the author believes that assumption (A3) will lead to simpler and more realistic bounds than would otherwise be attainable. 5.3 INTEGER OPERATIONS. Let Tz(op) denote the maximum computing time for the integer operation op, and let x~ denote an integer of length Ii > 0. 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
498 w.s. BROWN For addition and subtraction it is easy to show that Ti (x3 ~- xl ::i= x2) ~ ll + 12, (60) while for classical multiplication T1 (x3 ~ XlX2 ) ~'~ lll2. (61) Turning to division and assuming ll > 12, we find Ti (x3 ~-- xl/x2 , x4 ~ Xl mod xe) ~ l: (11 - le ), (62) since this involves essentially the same work as computing the product xex3. In studying the computation of x3 = gcd(Xl, x:) by Euclid's algorithm (Section 1.4), we again assume 11 > le, and we view each division step as a sequence of sub- traction steps. Since the total number of subtraction steps is bounded by 2 (11 - 13), and the work in each of these steps is dominated by l:, we have T1 (x3 ~ gcd (Xl, x~) ) ~ l~(ll -- 13). (63) The bound is achieved when the IRS is a Fibonacci sequence. Finally we consider the Chinese remainder algorithm (CRA) for integers, using the notation of Section 4.8. Let l~ and le be the lengths of ~n~ and m2, respectively. By (63), the time to compute c in Step (1) is codominant with l~le. Since Steps (2) and (3) can also be performed within this bound, we have T, (CRA) ~ l~le. (64) 5.4 POLYNOMIAL OPERATIONS. Let Tp(op) denote the maximum computing time for the polynomial operation op, and let Fi denote a polynomial in v variables with dimension vector (li, di), where l~ > 0. Clearly the number of terms in F~ is at most (d~ ~ 1)~, and this bound is not codominant with d~ ". For addition and subtraction it is easy to show that Tp (F3 ~- F1 ± F~) ~ ll (d~ + 1 )~ -/- le (d~ + 1 )~, (65) while for classical multiplication Te (F3 ~-- FiFe ) ~ l~le (dl -~- 1 )v (de + 1 )~. (66) Turning to division, if Fel F1, we find Te (F3 ~ F1/F~ ) ~ lel3 (de + 1 )" (d3 + 1 )*', (67) since this involves essentially the same work as computing the product F2F3. If Fe ~ F1, division yields to pseudo-division (Section 2.3), which is more expen- sive because of coefficient growth. In this case, suppose that F1 and Fe have degrees dl and de, respectively, in the main variable, and that their coefficient polynomials (in the v -- 1 auxiliary variables) have dimension vectors bounded by (l, d). Let (l', d') bound the dimension vectors of the polynomial coefficients of the pseudo- quotient, Q, and note that the degree of Q in the main variable is ~ = d~ - de. Since pseudo-division (PDIV) involves essentially the same work as computing the product QFe, we have by (66) T~(PDIV) ~ (~ + 1)(d2 + 1)U'(d + 1)~-~(d' + 1) ~-~. (68) Journal of the Association for Computing Machinery, Vol. 18, No. 4, October 1971
Euclid's Algorithm and Computation of Polynomial GCD's 499 Now it can be shown that d' < (8 al- l' _< (~ + 2)l. On the other hand, for l' > l, and 8 = 1. Hence Tp (PDIV) ~, l 2 (d2 -4- Tp (PDIV) ~ l 2 (d~ -4-

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