Two M Terms

Berlekamp-Massey. What does it do, how much input does it need, and what does it cost?

A

It finds the shortest linear recurrence a sequence satisfies. Recovering one of order mm safely needs at least 2m2m terms, and the algorithm runs in O(mlog⁡mlog⁡n)O(m \log m \log n), jumping straight to the nn-th term by polynomial exponentiation.

B

It finds the shortest linear recurrence a sequence satisfies. Recovering one of order mm safely needs at least 2m2m terms, and the incremental algorithm runs in O(nm)O(nm), degenerating to O(n2)O(n^2) when the order is not small.

C

It finds some linear recurrence a sequence satisfies, not necessarily the shortest. Recovering one of order mm safely needs at least 2m2m terms, and the incremental algorithm runs in O(nm)O(nm), degenerating to O(n2)O(n^2) when the order is not small.

D

It finds the shortest linear recurrence a sequence satisfies. Recovering one of order mm safely needs at least mm terms, and the incremental algorithm runs in O(nm)O(nm), degenerating to O(n2)O(n^2) when the order is not small.