How to come up with the Polynomials in FFT Problems?

Revision en6, by Archie1101, 2022-07-25 09:32:15

I have recently learned FFT and how we can multiply polynomials in n * logn. I sometimes struggle in coming up with the polynomials and how they should be multiplied in the context of the problem. For example in this problem. https://open.kattis.com/problems/kinversions we have to calculate the inversions.

We have to multiply polynomials but how to come up with the polynomial and whether the second polynomial should be inverted/rotated/shifted before being multiplied?

Like something these for the polynomials multiplied

0 1 0 1 _ _ _ _

_ _ _ _ 0 1 0 1

or

0 1 0 1 _ _ _ _

_ _ _ _ 1 0 1 0

or

0 1 0 1 _ _ _ _

1 0 1 0 _ _ _ _

where 0 is B and 1 is A.

Thanks!!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en6 English Archie1101 2022-07-25 09:32:15 4 Tiny change: '\n\nwhere 1 is B and 0 is A.\n\n' -> '\n\nwhere 0 is B and 1 is A.\n\n'
en5 English Archie1101 2022-07-25 09:31:42 56
en4 English Archie1101 2022-07-25 09:31:02 44
en3 English Archie1101 2022-07-25 09:30:20 53
en2 English Archie1101 2022-07-25 09:29:21 104
en1 English Archie1101 2022-07-25 09:28:24 761 Initial revision (published)