Introduction to Algorithms
Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
Question
Book Icon
Chapter 30, Problem 1P

a.

Program Plan Intro

To multiply two linear polynomials ax+b and cx+d using only three multiplications.

a.

Expert Solution
Check Mark

Explanation of Solution

Multiply two linear polynomials ax+b and cx+d using only 3 multiplications as follows:

  (a+b)(c+d)=ac+cb+ad+cd

Thus, the product of two polynomials is as follows:

  acx2+((a+b)(c+d)accd)x+cd

b.

Program Plan Intro

To provide two divide-and-conquer algorithms for multiplying two polynomials of degree-bound n in Θ(nlg3) time.

b.

Expert Solution
Check Mark

Explanation of Solution

Method 1(for dividing the input polynomial coefficients into a high half and low half):

Take two polynomials be P1 and P2 such that, P1(x)=j=1n1aj,1xj and P2(x)=j=1n1aj,2xj .

Now, assume that two polynomials are to be multiplied. Then,High half will be Hi(x)=j=n/2n1aj,ixj and Low half will be Li(x)=j=n/2n/21aj,ixj wherei =1,2….and so on.

Since, it is known that Pi(x)=Hi(x)xn/2+Li(x) wherei =1,2…and so on.Therefore, by multiplication of two polynomials following is obtained:

  P1(x)P2(x)=(H1(x)H2(x))xn+(H1(x)+L1(x))(H2(x)+L2(x))

  (H1(x)H2(x)L1(x)L2(x))xn/2+L1(x)L2(x)

Now on using master’s theorem the recurrence for above is calculatedto be as follows:

  T(n)=3T(n/2)+θ(n)

  θ(nlg(n))

Method2(for dividingthe input polynomial coefficients based onif the index is even or odd the procedure):

Assume the odd index beOiand even index be Eisuch that Oi(x)=j=0n/21a2j+1,jxj and Ei(x)=j=0n/21a2j,jxj where i goes from 1,2, 3… and so on.

Then, Pi=xO(x2)+Ei(x2)

Therefore,

  P1(x)P2(x)=x2(O1(x2)O2(x2))+x(O1(x2)+E1(x2))(O2(x2)+E1(x2))(O1(x2)O2(x2)E1(x2)E2(x2))+E1(x2)E2(x2)

Now on using master’s theorem the recurrence for above is calculatedto be as follows:

  T(n)=3T(n/2)+θ(n)

  θ(nlg(n))

c.

Program Plan Intro

To show methodto multiply two n-bit integers in O(nlg3) steps.

c.

Expert Solution
Check Mark

Explanation of Solution

To multiply two n-bit integers in O(nlg3) steps, take two integers P1 and P2 such that

  P1=k=0lg(A1)ak,12k and P2=k=0lg(A2)ak,22k .

The generalization of the polynomial can be given as f1=k=0lg(Ai)ak,ixi .

The two n-bit integers can be taken as P1nP1n1........P1 and P2nP2n1........P2 where 0P1i10 and 0P2i10 . The value P1i and P2i represent the number on every digit i = {1,2,3…n}

  P1n10n1+P1n110n2+.+P1210+P11

  P2n10n1+P2n110n2++P2210+P21

These two algorithms are developed to solve the multiplication problem of polynomialwith run time of O(nlg3) by using divide and conquer. Each operationdeal with either P1or P2, they are of 1bit values.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
Question: Finding the smallest element and its row index and column index in 2D Array: 1. Write a public Java class min2D. 2. In min2D, write a main method. 3. In the main method, create a 2-D array myArray with 2 rows and 5 columns: {{10, 21, 20, 13, 1}, {2, 6, 7, 8, 14}}. 4. Then, use a nested for loop to find the smallest element and its row index and column index. 5. Print the smallest element and its row index and column index on Java Console
(using R)The iris data set in R gives the measurements in centimeters of the variables sepal length and width andpetal length and width, respectively, for 50 flowers from each of 3 species of iris, setosa, versicolor, andvirginica. Use the iris data set and the t.test function, test if the mean of pepal length of iris flowers isgreater than the mean of sepal length.The iris data set in R gives the measurements in centimeters of the variables sepal length and width andpetal length and width, respectively, for 50 flowers from each of 3 species of iris, setosa, versicolor, andvirginica. Use the iris data set and the t.test function, test if the mean of pepal length of iris flowers isgreater than the mean of sepal length.
Recognizing the Use of Steganography in Forensic Evidence (4e)Digital Forensics, Investigation, and Response, Fourth Edition - Lab 02
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L