Docsity

Efficient Polynomial Multiplication Algorithms, Study Guides, Projects, Research of Data Structures and Algorithms

Toggle sidebar
bg1
Rensselaer Polytechnic Institute
Computer Science Department
Fall 2000
Computer Science 2300
Data Structures and Algorithms
Project 3
Handed Out: October 16, 2000 Due: November 9, 2000
The following project concerns efficient multiplication of polynomials. Suppose that we
wish to mutiply the polynomials

and

; the answer is

 "!#%$ 
  &
You can verify this result using the “algorithm” that you were given in high-school algebra
for polynomial mutliplication. The goal of this project is to be able to obtain results like the
above one in an efficient way. In order to do so, we will initially analyze the “high-school
algorithm” for polynomial multiplication, and then slowly move towards the more efficient
method. Along the way, many side issues will arise.
Before posing any problems, it is worth reviewing some notation.
Polynomial Definition
Apolynomial in the variable
is a function

that can be represented as
(' )+*
,-
.0/21
-
-
We call
354
the degree of the polynomial, and we call the values
1
/768898:6
1
')+*
the co-
efficients of the polynomial. It is assumed that the highest coefficient,
1
' )+*
, is nonzero;
otherwise, the polynomial’s degree would be lower. The coefficients are taken to be real
numbers.
Coefficient Representation
There are two representations of polynomials which will be useful to us: the coefficient rep-
resentation and the point-value representation. The coefficient representation of a poly-
1
pf3
pf4
pf5

Partial preview of the text

Download Efficient Polynomial Multiplication Algorithms and more Study Guides, Projects, Research Data Structures and Algorithms in PDF only on Docsity!

Rensselaer Polytechnic Institute Computer Science Department Fall 2000 Computer Science 2300 Data Structures and Algorithms Project 3 Handed Out: October 16, 2000 Due: November 9, 2000

The following project concerns efficient multiplication of polynomials. Suppose that we wish to mutiply the polynomials ^    ^ and  ^   ^ ; the answer is   (^)   "!# %$     &

You can verify this result using the “algorithm” that you were given in high-school algebra for polynomial mutliplication. The goal of this project is to be able to obtain results like the above one in an efficient way. In order to do so, we will initially analyze the “high-school algorithm” for polynomial multiplication, and then slowly move towards the more efficient method. Along the way, many side issues will arise. Before posing any problems, it is worth reviewing some notation.

Polynomial Definition A polynomial in the variable  is a function ^ that can be represented as

(' ,-)+* .0/

We call 354  the degree of the polynomial, and we call the values 1 /768898:6^1 ' )+* the co- efficients of the polynomial. It is assumed that the highest coefficient, 1 (^) ' )+* , is nonzero; otherwise, the polynomial’s degree would be lower. The coefficients are taken to be real numbers.

Coefficient Representation There are two representations of polynomials which will be useful to us: the coefficient rep- resentation and the point-value representation. The coefficient representation of a poly-

nomial ^ ' )+*

of degree 3 4  is a vector of 3 coefficients

1

A polynomial has a unique coefficient representation. As an example, take the polynomial ^ ^  ^ ; the coefficient representation of is the vector 1

 ^6 ^6 %^.

Point-Value Representation The point-value representation of a polynomial ^ with degree 3 4  is a set of 3 point-value pairs   (^) / 76 %/  6  (^) * 6  (^)  6 898896  (^) ' )+ 6  (^) ' )+* 

such that all of the ^ are distinct and

    7

for ^6 ^6 9888^634 . A polynomial has many different point-value representations, since any set of 3 distinct points  /^76  ^6 988896^  ')+ can be used as a basis for the representation.  As an example, once again take the polynomial  ^  ^ ^ . Then noting that , ^ ^ 7^ , and ^  ^ , one possible point-value representation for ^ is   6 ^6  6 7^  6  6  

However, as was explained above, this choice is not unique. For another possibility, use the fact that ^4 ^4 , ^ %(^ +^ ^ , and again that ^   ^. A second point-value representation is thus   4

Obviously, there are an infinite number of choices.

Roots of Unity This material will not be used until problem 6. Suppose we wish to solve the following equation for  :  '

given a particular value of 3. Obviously, one solution is   . If 3 is even, then another solution will be   4 . In general, however, there are 3 distinct solutions ' /769888^6 ' ')+* , which may be written  ' 

   ^ ' 6   6 988896 3 4 

where   4 . These are referred to as the  roots of unity.

are asked to calculate the complexity of the relevant algorithms. Problem 4 looks briefly at a scheme for converting back from point-value representation to coefficient representaion. Problem 5 takes a second stab at an algorithm for polynomial mutliplication. Problem 6 describes a more efficient algorithm for conversion from coefficient to point-value repre- sentation. Problem 7 takes a third stab at polynomial multiplication. The complexity here may be compared to that derived in problem 1.

Problem 1: Basic Multiplication Given are three polynomials: ^ ,  ^ , and their product  ^  ^  ^. and  are of degree 3 4 . Let the coefficient representations of and  be 1

^ 

^ ')+*  and^  /768988:6^ ' )+*  respectively. Let the coefficient representation of be   /96888:6^  (^) )+* .

  1. What is  4 , i.e., what is the degree of ?
  2. What is  in terms of 1 and ? That is, find the expression for each 

,   ^6 888^6  04 ,

in terms of 1 /76889896^1 ' )+* and /76888:6^ ' )+*.

  1. What is the complexity of the operation to find , as a function of 3?

Problem 2: Multiplication with Point-Value Representations Given are three polynomials: ^ ,  ^ , and their product  ^  ^  ^. and  are of degree 3 4 . Let the point-value representations of ,  be

 ^ /^76 ^ /^6 898896^ ^ )+* 6 ^ )+*  and

 ^ /^96 ^ /^6 888^6 ^ )+* 6 ^ )+* , respectively, where  is the value from problem 1.1. Note that while it is only necessary to specify 3 values, since and  are degree 3 4 , it is necessary to specify  values for  , since it is of degree  4 . Furthermore, assume that 



(^) for all   (^6) 888:6 (^)  4 .

  1. Express the point-value representation for  ,

 ^ /^96 ^ /^6 888:6^ ^ )+* 6 ^ )+* ^ , in terms of the point-value representations of 1 and .

  1. What is the complexity of this operation as a function of 3?

Problem 3: Conversion from Coefficient Representation to Point-Value Representation In order to convert a particular polynomial from coefficient representation to point-value representation, we must calculate

 ^ 



for  ^6 988896^34 .

  1. The following algorithm is used: CONVERT(

 1

,

  ^ ) for   to 3 4      for    to 3 4      ^ 1

* POWER( ,  )

return

   P OWER ( , 3 ) for  = 1 to 3 = *  return Suppose that each addition and each multiplication are  ^. What is the complexity of this conversion as a function of 3? Explain.

  1. You can lower the complexity of this algorithm simply by avoiding redundant multi- plications. Write pseudo-code for an algorithm which implements this faster conver- sion, but only requires  ^ more storage (that is, it will not need another 3 -element array).
  2. What is the complexity of this algorithm?

(a) evaluating / and * at   for  ^6 988896^34  (b) combining the results according to equation (1). Recall that there are many point-set representations for a given polynomial; any set of 3 distinct points

 ^ may be used. The idea is to pick a clever choice of the

  ^ in order to enable the divide and conquer approach to work. In particular, we will use the roots of unity: let    ' . Througout this problem, you may assume that 3 is a power of 2, i.e. 3   for some . This is useful for the divide and conquer algorithm, which will constantly be dividing into

  1. Using the properties of roots of unity given in the preamble, prove that '  '    ' .

  2. Using the properties of roots of unity given in the preamble, prove that '   ' .

  3. Based on your answer in (6.1) and (6.2), how many distinct numbers are there amongst the set

 ' /^6 ' ^6 8988:6^ ' ' )+ ?

  1. Using your results from (6.2) and (6.3), and the method for calculating /  ^ using and *^ given above, write pseudo-code for an efficient divide and conquer algorithm to convert from coefficient representation to point-value representation.
  2. Write a recursion for the running time of the algorithm, and solve it. What is the complexity?

Problem 7: Polynomial Multiplication, Part III Suppose that we use the algorithm outlined in problem 5, but this time we use the method in problem 6 for converting from coefficient representation to point-value representation. Furthermore, suppose that there is an equally efficient method for converting in the other direction, from point-value representation to coefficient representation. What is the com- plexity of multiplying two degree 3 4  polynomials with this method?