Блог пользователя duckladydinh

Автор duckladydinh, история, 36 часов назад, По-английски

Hi

I am learning FFT. ChatGPT told me that FFT could assist in solving self-convolution form like Catalan number where the (n+1)-th element is some convolution of the first n elements. For example:

c[n + 1] = sum(c[i][n — i]) for i in 0..n

Unfortunately, no matter where I look (and how hard I press ChatGPT), I couldn't find a single website/book/paper detailing this approach.

My Question: Is it actually possible to compute the first n elements of a self-convolution form like Catalan using FFT in, for example, O(nlogn) or less than O(n^2)?

Thanks a lot

  • Проголосовать: нравится
  • +16
  • Проголосовать: не нравится

»
36 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by duckladydinh (previous revision, new revision, compare).

»
36 часов назад, # |
  Проголосовать: нравится +18 Проголосовать: не нравится

On Codeforces (and in competitive programming) this is usually known as 'Online FFT'. You should be able to find CF blog posts on this topic solving it in $$$O(n\log^2{n})$$$.

»
23 часа назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Suppose we have

$$$a_0=c,\quad a_{n+1}=\sum_{i=0}^{n}a_i b_{n-i}$$$

Then the generating function A(x) satisfies A=ABx+c and therefore we may invert 1-Bx to find a in O(nlogn).