Question

[2 marks]Describe how to multiply two n-degree polynomials together in O(n logn) time, using the Fast...

[2 marks]Describe how to multiply two n-degree polynomials together in O(n logn) time, using the Fast Fourier Transform (FFT). You do not need to explain how FFT works – you may treat it as a black box.

In this part we will use the Fast Fourier Transform (FFT) algorithm described in class to multiply multiple polynomials together (not just two).

Suppose you have K polynomials P1, . . . , Pk so that

degree(P1) +···+ degree(PK) =S

(i)[6 marks]Show that you can find the product of these K polynomials in O(K SlogS)time.

Hint: How many points do you need to uniquely determine an S-degree polynomial?

(ii)[12 marks]Show that you can find the product of these K polynomials in O(S logS logK)time.

Hint: consider using divide-and-conquer; a tree which you used in the previous assignment might be helpful here as well. Also, remember that if x, y, z are all positive, then log(x+y)

0 0
Add a comment Improve this question Transcribed image text
Answer #1
FFT(a){
n = length(a) // a is the input coefficient vector
if n = 1
  then return a

// wn is principle complex nth root of unity.
wn = e^(2*pi*i/n)
w = 1

// even indexed coefficients
A0 = (a0, a2, ..., an-2 )

// odd indexed coefficients
A1 = (a1, a3, ..., an-1 ) 

y0 = Recursive_FFT(A0) // local array
y1 = Recursive-FFT(A1) // local array

for k = 0 to n/2 - 1

  // y array stores values of the DFT 
  // of given polynomial. 
  do y[k] = y0[k] + w*y1[k]  
     y[k+(n/2)] = y0[k] - w*y1[k]
     w = w*wn
return y
}
Add a comment
Know the answer?
Add Answer to:
[2 marks]Describe how to multiply two n-degree polynomials together in O(n logn) time, using the Fast...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT