The time complexity to multiply two polynomials of degree ๐ using Fastโฆ
2019
The time complexity to multiply two polynomials of degreeย ๐ย using Fast Fourier transform method is:
Answer: A. \(๐(๐\lgโก๐) \) โ Answer: ฮธ(n log n) Explanation: Pad the two coefficient sequences to length N, where N is a power of two at least 2n+1. This ensures N = ฮ(n). Compute the FFTโฆ
- A.
\(๐(๐\lgโก๐) \) - B.
\(๐(๐^2) \) - C.
\(๐(๐) \) - D.
\( ๐(lg \ โก๐)\)
Attempted by 108 students.
Show answer & explanation
Correct answer: A
Answer: ฮธ(n log n)
Explanation:
Pad the two coefficient sequences to length N, where N is a power of two at least 2n+1. This ensures N = ฮ(n).
Compute the FFT of both sequences. Each FFT takes O(N log N), so two FFTs cost O(N log N).
Multiply the transformed values pointwise. This step is O(N).
Compute the inverse FFT to interpolate the product coefficients. This is another O(N log N) step.
Total time: O(N log N) + O(N) = O(N log N). Since N = ฮ(n), the complexity is ฮ(n log n).
Note: The naive coefficient-by-coefficient multiplication takes ฮ(n^2), so the FFT-based method gives a substantial improvement for large n.
A video solution is available for this question โ log in and enroll to watch it.