Problem 5.Polynomial multiplication. A polynomial (x) on the variable x is a formal sum a(x) = i=o ;xi, where n 0 and the a3's are real numbers called the coefficients of (). The degree of () is the largest i such that i 0. Thus the degree of a is at most n with equality if a 0.
2
polynomial c() = ()b() of degree at most 2n, where the ith coefficient ci of c() is given by
Ci = abi-k k=0
i.e,
x=
abi-k k=0...,n;0i-kn
(1
For example
32+9x+22+5 +7=314+ (91+3 53+21 +95+372 +(2 5 + 9 7) + 2 7 ++89++,=
We store a degree-n polynomial in an array of size n + 1 where the ith coefficient of the polynomial is stored in the (i + 1)th entry of the array. Consider the Polynomial multiplication problem:
Input: two polynomials () and b() of degree at most n each stored in an array of size n + 1.
Output: an array of size (2n + 1) containing the coefficients of the polynomial c() = ()b().
Assume in what follows that arithmetic operations on real numbers are doable in O(1) time.
a) Translate (1) into an algorithm for the polynomial multiplication problem. What is the running time of the algorithm? You are supposed to give a pseudocode.
b) Show how to multiply two degree-1 polynomials ax + b and cr + d using only three multiplications. (Hint: One of the multiplications is ( + b)(c + d)). c) Use the the idea in (b) to design a O(nlog3) = O(n1.59..) time divide-and-conquer algorithm for the polynomial multiplication problem based on dividing the coefficients of each of the input polynomials into a high half and low half. You are supposed to give: the key idea of the algorithm, an English description or a high level pseudocode description of the algorithm, and a time analysis of the algorithm starting with a recurrence. To simplify the analysis, you can restrict n to any infinite subset of integers.