03 - Polynomial Multiplication

03 - Polynomial Multiplication - Part I Divide and Conquer...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Part I: Divide and Conquer Lecture 3: The Polynomial Multiplication Problem Lecture 3: The Polynomial Multiplication Problem Part I: Divide and Conquer
Background image of page 1

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

View Full DocumentRight Arrow Icon
Objective and Outline Objective : Show the general form of divide-and-conquer, and an second example of divide-and-conquer Outline: The general form of divide-and-conquer The polynomial multiplication problem A brute force algorithm A first divide-and-conquer algorithm An improved divide-and-conquer algorithm Remarks Lecture 3: The Polynomial Multiplication Problem Part I: Divide and Conquer
Background image of page 2
The general form of Divide-and-Conquer Divide Divide a given problem into subproblems (ideally of approximately equal size) No longer only two subproblems Conquer Solve each subproblem (directly or recursively ) Combine Combine the solutions of the subproblems into a global solution Lecture 3: The Polynomial Multiplication Problem Part I: Divide and Conquer
Background image of page 3

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

View Full DocumentRight Arrow Icon
Outline Outline: The general form of divide-and-conquer The polynomial multiplication problem A brute force algorithm A first divide-and-conquer algorithm An improved divide-and-conquer algorithm Remarks Lecture 3: The Polynomial Multiplication Problem Part I: Divide and Conquer
Background image of page 4
The Polynomial Multiplication Problem Definition (Polynomial Multiplication Problem) Given two polynomials A ( x ) = a 0 + a 1 x + ··· + a n x n B ( x ) = b 0 + b 1 x + ··· + b m x m Compute the product A ( x ) B ( x ) Example A ( x ) = 1 + 2 x + 3 x 2 B ( x ) = 3 + 2 x + 2 x 2 A ( x ) B ( x ) = 3 + 8 x + 15 x 2 + 10 x 3 + 6 x 4 Assume that the coefficients a i and b i are stored in arrays A [0 . . . n ] and B [0 . . . m ] Cost : number of scalar multiplications and additions Lecture 3: The Polynomial Multiplication Problem Part I: Divide and Conquer
Background image of page 5

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

View Full DocumentRight Arrow Icon
Define A ( x ) = n i =0 a i x i B ( x ) = m i =0 b i x i C ( x ) = A ( x ) B ( x ) = n + m k =0 c k x k Then c k = X 0 i n , 0 j m , i + j = k a i b j , for all 0 k m + n Definition The vector ( c 0 , c 1 , . . . , c m + n ) is the convolution of the vectors ( a 0 , a 1 , . . . , a n ) and ( b 0 , b 1 , . . . , b m ) We need to calculate convolutions. This is a major problem in
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/18/2009 for the course COMP 271 taught by Professor Arya during the Spring '07 term at HKUST.

Page1 / 21

03 - Polynomial Multiplication - Part I Divide and Conquer...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online