For a given periodic sequence of length $N$ for which minimal polynomial is being constructed. Does the Berlekamp-Massey algorithm take the input of $2N$, i.e., the repeated input sequence or just the input sequence itself? The doubt arise because by taking the original sequence $S$ of length $N$, and the sequence $S \| S$ (concatenation) of length $2N$, I found that the minimal polynomial value changes but I am unable to understand why the minimal polynomial should change.
SageMath
Example 1:
If I consider the sequence to be s=0101110
and then it repeats. Then by using BerlekampâMassey function in SageMath gives the minimal polynomial $$x^3+x+1$$
code:
berlekamp_massey([GF(2)(0), 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0])
(Here I have to repeat the sequence because the length must be even)
Example 2:
If I consider the sequence to be s=011101
and then it repeats then by using BerlekampâMassey function in SageMath gives the minimal polynomial $$x^3+x^2+1$$
code:
berlekamp_massey([GF(2)(0), 1, 1, 1, 0, 1])
(since the length is even the berlekamp massey function accepts this)
Example 3:
If I consider the sequence to be s=011101 and then it repeats; then by using BerlekampâMassey function in SageMath gives the minimal polynomial $$x^5+x^4+x^3+x^2+1$$
code:
berlekamp_massey([GF(2)(0), 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1])
(Here I intentionally repeated this)
So, My question is how to actually compute the linear complexity of sequence in SageMath using BerlekampâMassey function? which of the above examples are correct and which are incorrect?