How can I factor the polynomial $x^8+x^4+x^3+x^2+x+1$ over $F_2$ [closed]












0












$begingroup$


I read a solution in a book and here are the steps in it.
!enter image description here!enter image description here!enter image description here



but I don't understand how $g_i(x)$ is got.So how did he get it or is there some other ways to find the answer?










share|cite|improve this question











$endgroup$



closed as unclear what you're asking by Namaste, Andrew, Eevee Trainer, Leucippus, KReiser Dec 29 '18 at 2:54


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • 1




    $begingroup$
    Welcome to Maths SX! What does your question title have to do with its body?
    $endgroup$
    – Bernard
    Dec 28 '18 at 17:40






  • 1




    $begingroup$
    @Bernard Looks like an example run of Berlekamp's algorithm (or some variant). As usual, the answerers only proffer ad hoc methods. Well, the question is not very clear, so I cannot blame them. To be honest, with such a low degree polynomial I might do the same.
    $endgroup$
    – Jyrki Lahtonen
    Dec 28 '18 at 18:30












  • $begingroup$
    Micky, in my answer I said that row operations are used to find the general solution of the homogeneous system. I now realized that the author of your source writes the matrix $A$ (and later $B$) to the right of the vector of the unknowns. This means that you will be doing elementary column operations instead. A case in point is the first column of $B$. All zeros. This is to be expected because $g(x)=1$ is always a solution of the congruence $g(x)^2equiv g(x)pmod{f(x)}$.
    $endgroup$
    – Jyrki Lahtonen
    Jan 1 at 13:57


















0












$begingroup$


I read a solution in a book and here are the steps in it.
!enter image description here!enter image description here!enter image description here



but I don't understand how $g_i(x)$ is got.So how did he get it or is there some other ways to find the answer?










share|cite|improve this question











$endgroup$



closed as unclear what you're asking by Namaste, Andrew, Eevee Trainer, Leucippus, KReiser Dec 29 '18 at 2:54


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • 1




    $begingroup$
    Welcome to Maths SX! What does your question title have to do with its body?
    $endgroup$
    – Bernard
    Dec 28 '18 at 17:40






  • 1




    $begingroup$
    @Bernard Looks like an example run of Berlekamp's algorithm (or some variant). As usual, the answerers only proffer ad hoc methods. Well, the question is not very clear, so I cannot blame them. To be honest, with such a low degree polynomial I might do the same.
    $endgroup$
    – Jyrki Lahtonen
    Dec 28 '18 at 18:30












  • $begingroup$
    Micky, in my answer I said that row operations are used to find the general solution of the homogeneous system. I now realized that the author of your source writes the matrix $A$ (and later $B$) to the right of the vector of the unknowns. This means that you will be doing elementary column operations instead. A case in point is the first column of $B$. All zeros. This is to be expected because $g(x)=1$ is always a solution of the congruence $g(x)^2equiv g(x)pmod{f(x)}$.
    $endgroup$
    – Jyrki Lahtonen
    Jan 1 at 13:57
















0












0








0





$begingroup$


I read a solution in a book and here are the steps in it.
!enter image description here!enter image description here!enter image description here



but I don't understand how $g_i(x)$ is got.So how did he get it or is there some other ways to find the answer?










share|cite|improve this question











$endgroup$




I read a solution in a book and here are the steps in it.
!enter image description here!enter image description here!enter image description here



but I don't understand how $g_i(x)$ is got.So how did he get it or is there some other ways to find the answer?







ring-theory finite-fields factoring






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Dec 28 '18 at 17:52









Pratyush Sarkar

2,8001227




2,8001227










asked Dec 28 '18 at 17:22









MickyZrMickyZr

92




92




closed as unclear what you're asking by Namaste, Andrew, Eevee Trainer, Leucippus, KReiser Dec 29 '18 at 2:54


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









closed as unclear what you're asking by Namaste, Andrew, Eevee Trainer, Leucippus, KReiser Dec 29 '18 at 2:54


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 1




    $begingroup$
    Welcome to Maths SX! What does your question title have to do with its body?
    $endgroup$
    – Bernard
    Dec 28 '18 at 17:40






  • 1




    $begingroup$
    @Bernard Looks like an example run of Berlekamp's algorithm (or some variant). As usual, the answerers only proffer ad hoc methods. Well, the question is not very clear, so I cannot blame them. To be honest, with such a low degree polynomial I might do the same.
    $endgroup$
    – Jyrki Lahtonen
    Dec 28 '18 at 18:30












  • $begingroup$
    Micky, in my answer I said that row operations are used to find the general solution of the homogeneous system. I now realized that the author of your source writes the matrix $A$ (and later $B$) to the right of the vector of the unknowns. This means that you will be doing elementary column operations instead. A case in point is the first column of $B$. All zeros. This is to be expected because $g(x)=1$ is always a solution of the congruence $g(x)^2equiv g(x)pmod{f(x)}$.
    $endgroup$
    – Jyrki Lahtonen
    Jan 1 at 13:57
















  • 1




    $begingroup$
    Welcome to Maths SX! What does your question title have to do with its body?
    $endgroup$
    – Bernard
    Dec 28 '18 at 17:40






  • 1




    $begingroup$
    @Bernard Looks like an example run of Berlekamp's algorithm (or some variant). As usual, the answerers only proffer ad hoc methods. Well, the question is not very clear, so I cannot blame them. To be honest, with such a low degree polynomial I might do the same.
    $endgroup$
    – Jyrki Lahtonen
    Dec 28 '18 at 18:30












  • $begingroup$
    Micky, in my answer I said that row operations are used to find the general solution of the homogeneous system. I now realized that the author of your source writes the matrix $A$ (and later $B$) to the right of the vector of the unknowns. This means that you will be doing elementary column operations instead. A case in point is the first column of $B$. All zeros. This is to be expected because $g(x)=1$ is always a solution of the congruence $g(x)^2equiv g(x)pmod{f(x)}$.
    $endgroup$
    – Jyrki Lahtonen
    Jan 1 at 13:57










1




1




$begingroup$
Welcome to Maths SX! What does your question title have to do with its body?
$endgroup$
– Bernard
Dec 28 '18 at 17:40




$begingroup$
Welcome to Maths SX! What does your question title have to do with its body?
$endgroup$
– Bernard
Dec 28 '18 at 17:40




1




1




$begingroup$
@Bernard Looks like an example run of Berlekamp's algorithm (or some variant). As usual, the answerers only proffer ad hoc methods. Well, the question is not very clear, so I cannot blame them. To be honest, with such a low degree polynomial I might do the same.
$endgroup$
– Jyrki Lahtonen
Dec 28 '18 at 18:30






$begingroup$
@Bernard Looks like an example run of Berlekamp's algorithm (or some variant). As usual, the answerers only proffer ad hoc methods. Well, the question is not very clear, so I cannot blame them. To be honest, with such a low degree polynomial I might do the same.
$endgroup$
– Jyrki Lahtonen
Dec 28 '18 at 18:30














$begingroup$
Micky, in my answer I said that row operations are used to find the general solution of the homogeneous system. I now realized that the author of your source writes the matrix $A$ (and later $B$) to the right of the vector of the unknowns. This means that you will be doing elementary column operations instead. A case in point is the first column of $B$. All zeros. This is to be expected because $g(x)=1$ is always a solution of the congruence $g(x)^2equiv g(x)pmod{f(x)}$.
$endgroup$
– Jyrki Lahtonen
Jan 1 at 13:57






$begingroup$
Micky, in my answer I said that row operations are used to find the general solution of the homogeneous system. I now realized that the author of your source writes the matrix $A$ (and later $B$) to the right of the vector of the unknowns. This means that you will be doing elementary column operations instead. A case in point is the first column of $B$. All zeros. This is to be expected because $g(x)=1$ is always a solution of the congruence $g(x)^2equiv g(x)pmod{f(x)}$.
$endgroup$
– Jyrki Lahtonen
Jan 1 at 13:57












3 Answers
3






active

oldest

votes


















3












$begingroup$

Describing what is going on as the other answerers seem to totally ignore the question body (for the reason that it is a bit lacking in explaining where the image came from).



A main idea in Berlekamp's algorithm, when trying to factor a polynomial $f(x)inBbb{Z}_2[x]$, is to look for solutions $g(x)$ of the congruence
$$
g(x)^2equiv g(x)pmod{f(x)}.qquad(*)
$$

Because we are in characteristic two this congruence is a homogeneous system of linear equations in the unknown coefficients of $g(x)=g_0+g_1x+g_2x^2+cdots +g_7x^7$, in spite of appearances to the contrary! This follows from the characteristic two freshman's dream, $g(x)^2=sum_j g_jx^{2j}$.



Assume that the factorization of $f(x)$ is
$$
f(x)=prod_{j=1}^kp_j(x)^{a_j},
$$

where $p_j(x)$ are distinct irreducible polynomials. By the Chinese remainder theorem $(*)$ is equivalent to a system of congruences
$$
g(x)^2equiv g(x)pmod{p_j(x)^{a_j}},quad j=1,2,ldots,k. qquad(**)
$$

Now, any individual congruence in the system $(**)$ only has the trivial solutions
$g(x)equiv0$ and $g(x)equiv1$ modulo the appropriate modulus. This is because only one of the factors of
$g(x)^2-g(x)=g(x)(g(x)+1)$ can be divisible by $p_j(x)$, and hence has to be divisible by $p_j(x)^{a_j}$ for this congruence to hold.



Anyway, CRT says that any combination of solutions of the individual congruences can be lifted to a global solution of $(*)$. In particular, the solution space of $(*)$ has dimension $k$.



So the answer to OP's first question is that the polynomials $g_1,g_2,g_3$ were found by solving a linear homogeneous system of equations. The methods for doing that should be familiar to you from linear algebra. Basically a lot of row operations and such.



How to proceed? Well, if a polynomial $g(x)neq0,1$ is in the solution space, then we can find a non-trivial factor of $f(x)$! This is because, in view of the above, we must have $g(x)equiv0$ modulo some factor $p_j(x)^{a_j}$ and $g(x)equiv1$ modulo some other factor. This means that $gcd(g(x),f(x))$ is a non-trivial factor of $f(x)$. I don't remember whether Berlekamp had even more efficient ideas at this point, but we can, at the very least, use the Euclidean algorithm to calculate $gcd(g(x),f(x))$ for all
non-constant polynomials $g(x)$ in the solution space.



Let's see, $g_2(x)=x^2(x^3+x+1)$, so as $f(x)$ is not divisible by $x$, we can conclude that $gcd(g_2(x),f(x))$ must be equal to $x^3+x+1$. Similarly with $g_3(x)=x^7+x^4+x^2+x$ a run of Euclid reveals that
$$
gcd(g_3(x),f(x))=x^3+x^2+x+1=(x+1)^3.
$$

Last but not least
$$
gcd(g_2(x)+g_3(x),f(x))=x^2+x+1.
$$

That's it, all the factors accounted for!





Currently my favorite algorithm for factoring polynomials over a finite field is Cantor-Zassenhaus. See this post by yours truly for an annotated run of C-Z for something similar. Berlekamp's method is older, and IIRC has the benefit of being deterministic even if a bit slower in the average.



Cantor-Zassenhaus requires the polynomial to be factored to be square-free. That is easy to arrangeas a preliminary step, because any factor $p_j$ with multiplicity $a_j>1$ is a common factor of $f(x)$ and the formal derivative $f'(x)$. In the present case
$$
f'(x)=x^2+1=(x+1)^2,
$$

and we easily see that this time actually $f'(x)mid f(x)$, readily implying that $(x+1)^3$ must be a factor of $f(x)$.






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Okay, I would never have discerned by myself that was what was going on in the OP's images.
    $endgroup$
    – Henning Makholm
    Dec 29 '18 at 0:25



















8












$begingroup$

Trial and error works well on this small example.



A polynomial over $mathbb F_2$ is a multiple of $x+1$ iff it has an even number of nonzero terms. So for a start we can divide out factors of $x+1$ as long as we can:
$$ begin{align} & x^8 + x^4 + x^3+x^2+x+1 \
={}& (x+1)(x^7+x^6+x^5+x^4+x^2+1) \
={}& (x+1)^2(x^6+x^4+x+1) \
={}& (x+1)^3(x^5+x^4+1) end{align} $$

Now if $x^5+x^4+1$ has further factors, they must be irreducible of degree $2$ and $3$, respectively, because we've already dealt with all possible factors of degree $1$ (namely $x+1$, and $x$ which is obviously not a factor).



So all that remains now is trying the irreducible polynomials of degree $2$ -- of which there is only one, namely $x^2+x+1$ (since $x^2+1$ is a multiple of $x+1$).



But by direct division we find that
$$x^5+x^4+1=(x^2+x+1)(x^3+x+1)$$
so
$$ x^8 + x^4 + x^3+x^2+x+1 = (x+1)^3(x^2+x+1)(x^3+x+1) $$






share|cite|improve this answer











$endgroup$













  • $begingroup$
    For factoring that quintic you can also use this trick.
    $endgroup$
    – Jyrki Lahtonen
    Dec 28 '18 at 18:34



















2












$begingroup$

$$x^8+x^4+x^3+x^2+x+1=x^3(x^5-x^2+x^2+x+1)+x^2+x+1=$$
$$=(x^2+x+1)(x^3(x^2(x-1)+1)+1)=$$
$$=(x^2+x+1)(x^6-x^5+x^3+1)=$$
$$=(x^2+x+1)(x^6+x^5+x^3+1)=$$
$$=(x^2+x+1)(x^2+1)(x^4-x^2+1+x^3)=$$
$$=(x^2+x+1)(x^2+1)(x+1)(x^2(x-1)+x^2-x+1)=$$
$$=(x^2+x+1)(x+1)^3(x^3-x+1)=(x^2+x+1)(x+1)^3(x^3+x+1).$$






share|cite|improve this answer











$endgroup$




















    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3












    $begingroup$

    Describing what is going on as the other answerers seem to totally ignore the question body (for the reason that it is a bit lacking in explaining where the image came from).



    A main idea in Berlekamp's algorithm, when trying to factor a polynomial $f(x)inBbb{Z}_2[x]$, is to look for solutions $g(x)$ of the congruence
    $$
    g(x)^2equiv g(x)pmod{f(x)}.qquad(*)
    $$

    Because we are in characteristic two this congruence is a homogeneous system of linear equations in the unknown coefficients of $g(x)=g_0+g_1x+g_2x^2+cdots +g_7x^7$, in spite of appearances to the contrary! This follows from the characteristic two freshman's dream, $g(x)^2=sum_j g_jx^{2j}$.



    Assume that the factorization of $f(x)$ is
    $$
    f(x)=prod_{j=1}^kp_j(x)^{a_j},
    $$

    where $p_j(x)$ are distinct irreducible polynomials. By the Chinese remainder theorem $(*)$ is equivalent to a system of congruences
    $$
    g(x)^2equiv g(x)pmod{p_j(x)^{a_j}},quad j=1,2,ldots,k. qquad(**)
    $$

    Now, any individual congruence in the system $(**)$ only has the trivial solutions
    $g(x)equiv0$ and $g(x)equiv1$ modulo the appropriate modulus. This is because only one of the factors of
    $g(x)^2-g(x)=g(x)(g(x)+1)$ can be divisible by $p_j(x)$, and hence has to be divisible by $p_j(x)^{a_j}$ for this congruence to hold.



    Anyway, CRT says that any combination of solutions of the individual congruences can be lifted to a global solution of $(*)$. In particular, the solution space of $(*)$ has dimension $k$.



    So the answer to OP's first question is that the polynomials $g_1,g_2,g_3$ were found by solving a linear homogeneous system of equations. The methods for doing that should be familiar to you from linear algebra. Basically a lot of row operations and such.



    How to proceed? Well, if a polynomial $g(x)neq0,1$ is in the solution space, then we can find a non-trivial factor of $f(x)$! This is because, in view of the above, we must have $g(x)equiv0$ modulo some factor $p_j(x)^{a_j}$ and $g(x)equiv1$ modulo some other factor. This means that $gcd(g(x),f(x))$ is a non-trivial factor of $f(x)$. I don't remember whether Berlekamp had even more efficient ideas at this point, but we can, at the very least, use the Euclidean algorithm to calculate $gcd(g(x),f(x))$ for all
    non-constant polynomials $g(x)$ in the solution space.



    Let's see, $g_2(x)=x^2(x^3+x+1)$, so as $f(x)$ is not divisible by $x$, we can conclude that $gcd(g_2(x),f(x))$ must be equal to $x^3+x+1$. Similarly with $g_3(x)=x^7+x^4+x^2+x$ a run of Euclid reveals that
    $$
    gcd(g_3(x),f(x))=x^3+x^2+x+1=(x+1)^3.
    $$

    Last but not least
    $$
    gcd(g_2(x)+g_3(x),f(x))=x^2+x+1.
    $$

    That's it, all the factors accounted for!





    Currently my favorite algorithm for factoring polynomials over a finite field is Cantor-Zassenhaus. See this post by yours truly for an annotated run of C-Z for something similar. Berlekamp's method is older, and IIRC has the benefit of being deterministic even if a bit slower in the average.



    Cantor-Zassenhaus requires the polynomial to be factored to be square-free. That is easy to arrangeas a preliminary step, because any factor $p_j$ with multiplicity $a_j>1$ is a common factor of $f(x)$ and the formal derivative $f'(x)$. In the present case
    $$
    f'(x)=x^2+1=(x+1)^2,
    $$

    and we easily see that this time actually $f'(x)mid f(x)$, readily implying that $(x+1)^3$ must be a factor of $f(x)$.






    share|cite|improve this answer











    $endgroup$













    • $begingroup$
      Okay, I would never have discerned by myself that was what was going on in the OP's images.
      $endgroup$
      – Henning Makholm
      Dec 29 '18 at 0:25
















    3












    $begingroup$

    Describing what is going on as the other answerers seem to totally ignore the question body (for the reason that it is a bit lacking in explaining where the image came from).



    A main idea in Berlekamp's algorithm, when trying to factor a polynomial $f(x)inBbb{Z}_2[x]$, is to look for solutions $g(x)$ of the congruence
    $$
    g(x)^2equiv g(x)pmod{f(x)}.qquad(*)
    $$

    Because we are in characteristic two this congruence is a homogeneous system of linear equations in the unknown coefficients of $g(x)=g_0+g_1x+g_2x^2+cdots +g_7x^7$, in spite of appearances to the contrary! This follows from the characteristic two freshman's dream, $g(x)^2=sum_j g_jx^{2j}$.



    Assume that the factorization of $f(x)$ is
    $$
    f(x)=prod_{j=1}^kp_j(x)^{a_j},
    $$

    where $p_j(x)$ are distinct irreducible polynomials. By the Chinese remainder theorem $(*)$ is equivalent to a system of congruences
    $$
    g(x)^2equiv g(x)pmod{p_j(x)^{a_j}},quad j=1,2,ldots,k. qquad(**)
    $$

    Now, any individual congruence in the system $(**)$ only has the trivial solutions
    $g(x)equiv0$ and $g(x)equiv1$ modulo the appropriate modulus. This is because only one of the factors of
    $g(x)^2-g(x)=g(x)(g(x)+1)$ can be divisible by $p_j(x)$, and hence has to be divisible by $p_j(x)^{a_j}$ for this congruence to hold.



    Anyway, CRT says that any combination of solutions of the individual congruences can be lifted to a global solution of $(*)$. In particular, the solution space of $(*)$ has dimension $k$.



    So the answer to OP's first question is that the polynomials $g_1,g_2,g_3$ were found by solving a linear homogeneous system of equations. The methods for doing that should be familiar to you from linear algebra. Basically a lot of row operations and such.



    How to proceed? Well, if a polynomial $g(x)neq0,1$ is in the solution space, then we can find a non-trivial factor of $f(x)$! This is because, in view of the above, we must have $g(x)equiv0$ modulo some factor $p_j(x)^{a_j}$ and $g(x)equiv1$ modulo some other factor. This means that $gcd(g(x),f(x))$ is a non-trivial factor of $f(x)$. I don't remember whether Berlekamp had even more efficient ideas at this point, but we can, at the very least, use the Euclidean algorithm to calculate $gcd(g(x),f(x))$ for all
    non-constant polynomials $g(x)$ in the solution space.



    Let's see, $g_2(x)=x^2(x^3+x+1)$, so as $f(x)$ is not divisible by $x$, we can conclude that $gcd(g_2(x),f(x))$ must be equal to $x^3+x+1$. Similarly with $g_3(x)=x^7+x^4+x^2+x$ a run of Euclid reveals that
    $$
    gcd(g_3(x),f(x))=x^3+x^2+x+1=(x+1)^3.
    $$

    Last but not least
    $$
    gcd(g_2(x)+g_3(x),f(x))=x^2+x+1.
    $$

    That's it, all the factors accounted for!





    Currently my favorite algorithm for factoring polynomials over a finite field is Cantor-Zassenhaus. See this post by yours truly for an annotated run of C-Z for something similar. Berlekamp's method is older, and IIRC has the benefit of being deterministic even if a bit slower in the average.



    Cantor-Zassenhaus requires the polynomial to be factored to be square-free. That is easy to arrangeas a preliminary step, because any factor $p_j$ with multiplicity $a_j>1$ is a common factor of $f(x)$ and the formal derivative $f'(x)$. In the present case
    $$
    f'(x)=x^2+1=(x+1)^2,
    $$

    and we easily see that this time actually $f'(x)mid f(x)$, readily implying that $(x+1)^3$ must be a factor of $f(x)$.






    share|cite|improve this answer











    $endgroup$













    • $begingroup$
      Okay, I would never have discerned by myself that was what was going on in the OP's images.
      $endgroup$
      – Henning Makholm
      Dec 29 '18 at 0:25














    3












    3








    3





    $begingroup$

    Describing what is going on as the other answerers seem to totally ignore the question body (for the reason that it is a bit lacking in explaining where the image came from).



    A main idea in Berlekamp's algorithm, when trying to factor a polynomial $f(x)inBbb{Z}_2[x]$, is to look for solutions $g(x)$ of the congruence
    $$
    g(x)^2equiv g(x)pmod{f(x)}.qquad(*)
    $$

    Because we are in characteristic two this congruence is a homogeneous system of linear equations in the unknown coefficients of $g(x)=g_0+g_1x+g_2x^2+cdots +g_7x^7$, in spite of appearances to the contrary! This follows from the characteristic two freshman's dream, $g(x)^2=sum_j g_jx^{2j}$.



    Assume that the factorization of $f(x)$ is
    $$
    f(x)=prod_{j=1}^kp_j(x)^{a_j},
    $$

    where $p_j(x)$ are distinct irreducible polynomials. By the Chinese remainder theorem $(*)$ is equivalent to a system of congruences
    $$
    g(x)^2equiv g(x)pmod{p_j(x)^{a_j}},quad j=1,2,ldots,k. qquad(**)
    $$

    Now, any individual congruence in the system $(**)$ only has the trivial solutions
    $g(x)equiv0$ and $g(x)equiv1$ modulo the appropriate modulus. This is because only one of the factors of
    $g(x)^2-g(x)=g(x)(g(x)+1)$ can be divisible by $p_j(x)$, and hence has to be divisible by $p_j(x)^{a_j}$ for this congruence to hold.



    Anyway, CRT says that any combination of solutions of the individual congruences can be lifted to a global solution of $(*)$. In particular, the solution space of $(*)$ has dimension $k$.



    So the answer to OP's first question is that the polynomials $g_1,g_2,g_3$ were found by solving a linear homogeneous system of equations. The methods for doing that should be familiar to you from linear algebra. Basically a lot of row operations and such.



    How to proceed? Well, if a polynomial $g(x)neq0,1$ is in the solution space, then we can find a non-trivial factor of $f(x)$! This is because, in view of the above, we must have $g(x)equiv0$ modulo some factor $p_j(x)^{a_j}$ and $g(x)equiv1$ modulo some other factor. This means that $gcd(g(x),f(x))$ is a non-trivial factor of $f(x)$. I don't remember whether Berlekamp had even more efficient ideas at this point, but we can, at the very least, use the Euclidean algorithm to calculate $gcd(g(x),f(x))$ for all
    non-constant polynomials $g(x)$ in the solution space.



    Let's see, $g_2(x)=x^2(x^3+x+1)$, so as $f(x)$ is not divisible by $x$, we can conclude that $gcd(g_2(x),f(x))$ must be equal to $x^3+x+1$. Similarly with $g_3(x)=x^7+x^4+x^2+x$ a run of Euclid reveals that
    $$
    gcd(g_3(x),f(x))=x^3+x^2+x+1=(x+1)^3.
    $$

    Last but not least
    $$
    gcd(g_2(x)+g_3(x),f(x))=x^2+x+1.
    $$

    That's it, all the factors accounted for!





    Currently my favorite algorithm for factoring polynomials over a finite field is Cantor-Zassenhaus. See this post by yours truly for an annotated run of C-Z for something similar. Berlekamp's method is older, and IIRC has the benefit of being deterministic even if a bit slower in the average.



    Cantor-Zassenhaus requires the polynomial to be factored to be square-free. That is easy to arrangeas a preliminary step, because any factor $p_j$ with multiplicity $a_j>1$ is a common factor of $f(x)$ and the formal derivative $f'(x)$. In the present case
    $$
    f'(x)=x^2+1=(x+1)^2,
    $$

    and we easily see that this time actually $f'(x)mid f(x)$, readily implying that $(x+1)^3$ must be a factor of $f(x)$.






    share|cite|improve this answer











    $endgroup$



    Describing what is going on as the other answerers seem to totally ignore the question body (for the reason that it is a bit lacking in explaining where the image came from).



    A main idea in Berlekamp's algorithm, when trying to factor a polynomial $f(x)inBbb{Z}_2[x]$, is to look for solutions $g(x)$ of the congruence
    $$
    g(x)^2equiv g(x)pmod{f(x)}.qquad(*)
    $$

    Because we are in characteristic two this congruence is a homogeneous system of linear equations in the unknown coefficients of $g(x)=g_0+g_1x+g_2x^2+cdots +g_7x^7$, in spite of appearances to the contrary! This follows from the characteristic two freshman's dream, $g(x)^2=sum_j g_jx^{2j}$.



    Assume that the factorization of $f(x)$ is
    $$
    f(x)=prod_{j=1}^kp_j(x)^{a_j},
    $$

    where $p_j(x)$ are distinct irreducible polynomials. By the Chinese remainder theorem $(*)$ is equivalent to a system of congruences
    $$
    g(x)^2equiv g(x)pmod{p_j(x)^{a_j}},quad j=1,2,ldots,k. qquad(**)
    $$

    Now, any individual congruence in the system $(**)$ only has the trivial solutions
    $g(x)equiv0$ and $g(x)equiv1$ modulo the appropriate modulus. This is because only one of the factors of
    $g(x)^2-g(x)=g(x)(g(x)+1)$ can be divisible by $p_j(x)$, and hence has to be divisible by $p_j(x)^{a_j}$ for this congruence to hold.



    Anyway, CRT says that any combination of solutions of the individual congruences can be lifted to a global solution of $(*)$. In particular, the solution space of $(*)$ has dimension $k$.



    So the answer to OP's first question is that the polynomials $g_1,g_2,g_3$ were found by solving a linear homogeneous system of equations. The methods for doing that should be familiar to you from linear algebra. Basically a lot of row operations and such.



    How to proceed? Well, if a polynomial $g(x)neq0,1$ is in the solution space, then we can find a non-trivial factor of $f(x)$! This is because, in view of the above, we must have $g(x)equiv0$ modulo some factor $p_j(x)^{a_j}$ and $g(x)equiv1$ modulo some other factor. This means that $gcd(g(x),f(x))$ is a non-trivial factor of $f(x)$. I don't remember whether Berlekamp had even more efficient ideas at this point, but we can, at the very least, use the Euclidean algorithm to calculate $gcd(g(x),f(x))$ for all
    non-constant polynomials $g(x)$ in the solution space.



    Let's see, $g_2(x)=x^2(x^3+x+1)$, so as $f(x)$ is not divisible by $x$, we can conclude that $gcd(g_2(x),f(x))$ must be equal to $x^3+x+1$. Similarly with $g_3(x)=x^7+x^4+x^2+x$ a run of Euclid reveals that
    $$
    gcd(g_3(x),f(x))=x^3+x^2+x+1=(x+1)^3.
    $$

    Last but not least
    $$
    gcd(g_2(x)+g_3(x),f(x))=x^2+x+1.
    $$

    That's it, all the factors accounted for!





    Currently my favorite algorithm for factoring polynomials over a finite field is Cantor-Zassenhaus. See this post by yours truly for an annotated run of C-Z for something similar. Berlekamp's method is older, and IIRC has the benefit of being deterministic even if a bit slower in the average.



    Cantor-Zassenhaus requires the polynomial to be factored to be square-free. That is easy to arrangeas a preliminary step, because any factor $p_j$ with multiplicity $a_j>1$ is a common factor of $f(x)$ and the formal derivative $f'(x)$. In the present case
    $$
    f'(x)=x^2+1=(x+1)^2,
    $$

    and we easily see that this time actually $f'(x)mid f(x)$, readily implying that $(x+1)^3$ must be a factor of $f(x)$.







    share|cite|improve this answer














    share|cite|improve this answer



    share|cite|improve this answer








    edited Jan 1 at 13:50

























    answered Dec 28 '18 at 22:46









    Jyrki LahtonenJyrki Lahtonen

    110k13171386




    110k13171386












    • $begingroup$
      Okay, I would never have discerned by myself that was what was going on in the OP's images.
      $endgroup$
      – Henning Makholm
      Dec 29 '18 at 0:25


















    • $begingroup$
      Okay, I would never have discerned by myself that was what was going on in the OP's images.
      $endgroup$
      – Henning Makholm
      Dec 29 '18 at 0:25
















    $begingroup$
    Okay, I would never have discerned by myself that was what was going on in the OP's images.
    $endgroup$
    – Henning Makholm
    Dec 29 '18 at 0:25




    $begingroup$
    Okay, I would never have discerned by myself that was what was going on in the OP's images.
    $endgroup$
    – Henning Makholm
    Dec 29 '18 at 0:25











    8












    $begingroup$

    Trial and error works well on this small example.



    A polynomial over $mathbb F_2$ is a multiple of $x+1$ iff it has an even number of nonzero terms. So for a start we can divide out factors of $x+1$ as long as we can:
    $$ begin{align} & x^8 + x^4 + x^3+x^2+x+1 \
    ={}& (x+1)(x^7+x^6+x^5+x^4+x^2+1) \
    ={}& (x+1)^2(x^6+x^4+x+1) \
    ={}& (x+1)^3(x^5+x^4+1) end{align} $$

    Now if $x^5+x^4+1$ has further factors, they must be irreducible of degree $2$ and $3$, respectively, because we've already dealt with all possible factors of degree $1$ (namely $x+1$, and $x$ which is obviously not a factor).



    So all that remains now is trying the irreducible polynomials of degree $2$ -- of which there is only one, namely $x^2+x+1$ (since $x^2+1$ is a multiple of $x+1$).



    But by direct division we find that
    $$x^5+x^4+1=(x^2+x+1)(x^3+x+1)$$
    so
    $$ x^8 + x^4 + x^3+x^2+x+1 = (x+1)^3(x^2+x+1)(x^3+x+1) $$






    share|cite|improve this answer











    $endgroup$













    • $begingroup$
      For factoring that quintic you can also use this trick.
      $endgroup$
      – Jyrki Lahtonen
      Dec 28 '18 at 18:34
















    8












    $begingroup$

    Trial and error works well on this small example.



    A polynomial over $mathbb F_2$ is a multiple of $x+1$ iff it has an even number of nonzero terms. So for a start we can divide out factors of $x+1$ as long as we can:
    $$ begin{align} & x^8 + x^4 + x^3+x^2+x+1 \
    ={}& (x+1)(x^7+x^6+x^5+x^4+x^2+1) \
    ={}& (x+1)^2(x^6+x^4+x+1) \
    ={}& (x+1)^3(x^5+x^4+1) end{align} $$

    Now if $x^5+x^4+1$ has further factors, they must be irreducible of degree $2$ and $3$, respectively, because we've already dealt with all possible factors of degree $1$ (namely $x+1$, and $x$ which is obviously not a factor).



    So all that remains now is trying the irreducible polynomials of degree $2$ -- of which there is only one, namely $x^2+x+1$ (since $x^2+1$ is a multiple of $x+1$).



    But by direct division we find that
    $$x^5+x^4+1=(x^2+x+1)(x^3+x+1)$$
    so
    $$ x^8 + x^4 + x^3+x^2+x+1 = (x+1)^3(x^2+x+1)(x^3+x+1) $$






    share|cite|improve this answer











    $endgroup$













    • $begingroup$
      For factoring that quintic you can also use this trick.
      $endgroup$
      – Jyrki Lahtonen
      Dec 28 '18 at 18:34














    8












    8








    8





    $begingroup$

    Trial and error works well on this small example.



    A polynomial over $mathbb F_2$ is a multiple of $x+1$ iff it has an even number of nonzero terms. So for a start we can divide out factors of $x+1$ as long as we can:
    $$ begin{align} & x^8 + x^4 + x^3+x^2+x+1 \
    ={}& (x+1)(x^7+x^6+x^5+x^4+x^2+1) \
    ={}& (x+1)^2(x^6+x^4+x+1) \
    ={}& (x+1)^3(x^5+x^4+1) end{align} $$

    Now if $x^5+x^4+1$ has further factors, they must be irreducible of degree $2$ and $3$, respectively, because we've already dealt with all possible factors of degree $1$ (namely $x+1$, and $x$ which is obviously not a factor).



    So all that remains now is trying the irreducible polynomials of degree $2$ -- of which there is only one, namely $x^2+x+1$ (since $x^2+1$ is a multiple of $x+1$).



    But by direct division we find that
    $$x^5+x^4+1=(x^2+x+1)(x^3+x+1)$$
    so
    $$ x^8 + x^4 + x^3+x^2+x+1 = (x+1)^3(x^2+x+1)(x^3+x+1) $$






    share|cite|improve this answer











    $endgroup$



    Trial and error works well on this small example.



    A polynomial over $mathbb F_2$ is a multiple of $x+1$ iff it has an even number of nonzero terms. So for a start we can divide out factors of $x+1$ as long as we can:
    $$ begin{align} & x^8 + x^4 + x^3+x^2+x+1 \
    ={}& (x+1)(x^7+x^6+x^5+x^4+x^2+1) \
    ={}& (x+1)^2(x^6+x^4+x+1) \
    ={}& (x+1)^3(x^5+x^4+1) end{align} $$

    Now if $x^5+x^4+1$ has further factors, they must be irreducible of degree $2$ and $3$, respectively, because we've already dealt with all possible factors of degree $1$ (namely $x+1$, and $x$ which is obviously not a factor).



    So all that remains now is trying the irreducible polynomials of degree $2$ -- of which there is only one, namely $x^2+x+1$ (since $x^2+1$ is a multiple of $x+1$).



    But by direct division we find that
    $$x^5+x^4+1=(x^2+x+1)(x^3+x+1)$$
    so
    $$ x^8 + x^4 + x^3+x^2+x+1 = (x+1)^3(x^2+x+1)(x^3+x+1) $$







    share|cite|improve this answer














    share|cite|improve this answer



    share|cite|improve this answer








    edited Dec 28 '18 at 18:24

























    answered Dec 28 '18 at 17:42









    Henning MakholmHenning Makholm

    242k17308550




    242k17308550












    • $begingroup$
      For factoring that quintic you can also use this trick.
      $endgroup$
      – Jyrki Lahtonen
      Dec 28 '18 at 18:34


















    • $begingroup$
      For factoring that quintic you can also use this trick.
      $endgroup$
      – Jyrki Lahtonen
      Dec 28 '18 at 18:34
















    $begingroup$
    For factoring that quintic you can also use this trick.
    $endgroup$
    – Jyrki Lahtonen
    Dec 28 '18 at 18:34




    $begingroup$
    For factoring that quintic you can also use this trick.
    $endgroup$
    – Jyrki Lahtonen
    Dec 28 '18 at 18:34











    2












    $begingroup$

    $$x^8+x^4+x^3+x^2+x+1=x^3(x^5-x^2+x^2+x+1)+x^2+x+1=$$
    $$=(x^2+x+1)(x^3(x^2(x-1)+1)+1)=$$
    $$=(x^2+x+1)(x^6-x^5+x^3+1)=$$
    $$=(x^2+x+1)(x^6+x^5+x^3+1)=$$
    $$=(x^2+x+1)(x^2+1)(x^4-x^2+1+x^3)=$$
    $$=(x^2+x+1)(x^2+1)(x+1)(x^2(x-1)+x^2-x+1)=$$
    $$=(x^2+x+1)(x+1)^3(x^3-x+1)=(x^2+x+1)(x+1)^3(x^3+x+1).$$






    share|cite|improve this answer











    $endgroup$


















      2












      $begingroup$

      $$x^8+x^4+x^3+x^2+x+1=x^3(x^5-x^2+x^2+x+1)+x^2+x+1=$$
      $$=(x^2+x+1)(x^3(x^2(x-1)+1)+1)=$$
      $$=(x^2+x+1)(x^6-x^5+x^3+1)=$$
      $$=(x^2+x+1)(x^6+x^5+x^3+1)=$$
      $$=(x^2+x+1)(x^2+1)(x^4-x^2+1+x^3)=$$
      $$=(x^2+x+1)(x^2+1)(x+1)(x^2(x-1)+x^2-x+1)=$$
      $$=(x^2+x+1)(x+1)^3(x^3-x+1)=(x^2+x+1)(x+1)^3(x^3+x+1).$$






      share|cite|improve this answer











      $endgroup$
















        2












        2








        2





        $begingroup$

        $$x^8+x^4+x^3+x^2+x+1=x^3(x^5-x^2+x^2+x+1)+x^2+x+1=$$
        $$=(x^2+x+1)(x^3(x^2(x-1)+1)+1)=$$
        $$=(x^2+x+1)(x^6-x^5+x^3+1)=$$
        $$=(x^2+x+1)(x^6+x^5+x^3+1)=$$
        $$=(x^2+x+1)(x^2+1)(x^4-x^2+1+x^3)=$$
        $$=(x^2+x+1)(x^2+1)(x+1)(x^2(x-1)+x^2-x+1)=$$
        $$=(x^2+x+1)(x+1)^3(x^3-x+1)=(x^2+x+1)(x+1)^3(x^3+x+1).$$






        share|cite|improve this answer











        $endgroup$



        $$x^8+x^4+x^3+x^2+x+1=x^3(x^5-x^2+x^2+x+1)+x^2+x+1=$$
        $$=(x^2+x+1)(x^3(x^2(x-1)+1)+1)=$$
        $$=(x^2+x+1)(x^6-x^5+x^3+1)=$$
        $$=(x^2+x+1)(x^6+x^5+x^3+1)=$$
        $$=(x^2+x+1)(x^2+1)(x^4-x^2+1+x^3)=$$
        $$=(x^2+x+1)(x^2+1)(x+1)(x^2(x-1)+x^2-x+1)=$$
        $$=(x^2+x+1)(x+1)^3(x^3-x+1)=(x^2+x+1)(x+1)^3(x^3+x+1).$$







        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited Dec 28 '18 at 18:00

























        answered Dec 28 '18 at 17:43









        Michael RozenbergMichael Rozenberg

        108k1895200




        108k1895200















            Popular posts from this blog

            Probability when a professor distributes a quiz and homework assignment to a class of n students.

            Aardman Animations

            Are they similar matrix