0

Looking for some help with an upcoming exam, this is a question from the review. Seeing if someone could restate a) so I might be able to better understand what it is asking.

So it wants me to instead of using extra multiplications maybe obtain some of the terms in the answer (PQ) by subtracting and adding already multiplied terms. Such as Strassen does in his algorithm to compute the product of 2x2 matrices in 7 multiplications instead of 8.

a) Suppose P(x) and Q(x) are two polynomials of (even) size n.
Let P1(x) and P2(x) denote the polynomials of size n/2 determined by the first n/2 and last n/2 coefficients of P(x). Similarly define Q1(x) and Q2(x), i.e., P = P1 + x^(n/2)P2. and Q = Q1 + x^(n/2) Q2.
Show how the product PQ can be computed using only 3 distinct multiplications of polynomials of size n/2.

b) Briefly explain how the result in a) can be used to design a divide-and-conquer algorithm for multiplying two polynomials of size n (explain what the recursive calls are and what the bootstrap condition is).

c) Analyze the worst-case complexity of algorithm you have given in part b). In particular derive a recurrence formula for W(n) and solve. As usual, to simplify the math, you may assume that n is a power of 2.

  • could that be "only *4* distinct multiplications of polynomials of size n/2"-- not 3? You can't calculate (a+bx)(p+qx) by 3 multiplications only unless there's some known relation between the coefficients. – ashley Nov 27 '12 at 23:02
  • That is the question directly from the review. There is a way, if you were to multiply out each term to get another term Pi*Qi = Ri, then some of the Ri's might be able to be used to find other Ri's by subtracting them or adding them. –  Nov 28 '12 at 03:25
  • that takes a known relationship between the coefficients. – ashley Nov 28 '12 at 04:02
  • In the answer below calpis explains it. Pg 12 explains it the best. –  Nov 28 '12 at 04:23

1 Answers1

0

Here is a link I found which does polynomial multiplication.

http://algorithm.cs.nthu.edu.tw/~course/Extra_Info/Divide%20and%20Conquer_supplement.pdf

Notice here that if we do polynomial multiplication the way we learned in high school, it would take big-omega(n^2) time. The question wants you to see that there is a more efficient algorithm out there by first preprocessing the polynomials, by dividing it into two pieces. This lecture gives a pretty detailed explanation of how to do this. Especially, look at page 12 of the link. It shows you explicitly how a 4 multiplication process can be done in 3 when multiplying polynomials.

masotann
  • 901
  • 10
  • 29
  • To answer @ashley...(I'll do it here since I can't comment yet) (a+bx)(p+qx) = ap + (aq+bp)x + bqx^2 We can do this by using 3 multiplications. a*p, b*q, and (a+q)*(b+p). Note that (a+q)(b+p) yields (ab + ap + qb + qp). If we subtract the products ap and bq which we already have.. We successfully obtain aq+bp, which is our middle term! now we can substitute polynomials in for the coefficients, which should give you a good idea for part a. – masotann Nov 28 '12 at 03:40
  • On page 3, it starts with "convolutions" what is that? I have never even seen that in math. So A(x) and B(x) is the sum of every term where each term is = AiX^i and the same for B. C(x) is the quotient. Ck is the kth term in C(x) right? And the summation adds the partial terms from the multiplication to get a certain term? I am not sure how to describe how that summation works? –  Nov 28 '12 at 03:46
  • Nevermind, I see what is happening now! I am pretty sure! thanks! –  Nov 28 '12 at 03:54