fbpx
Wikipedia

Berlekamp's algorithm

In mathematics, particularly computational algebra, Berlekamp's algorithm is a well-known method for factoring polynomials over finite fields (also known as Galois fields). The algorithm consists mainly of matrix reduction and polynomial GCD computations. It was invented by Elwyn Berlekamp in 1967. It was the dominant algorithm for solving the problem until the Cantor–Zassenhaus algorithm of 1981. It is currently implemented in many well-known computer algebra systems.

Overview edit

Berlekamp's algorithm takes as input a square-free polynomial   (i.e. one with no repeated factors) of degree   with coefficients in a finite field   and gives as output a polynomial   with coefficients in the same field such that   divides  . The algorithm may then be applied recursively to these and subsequent divisors, until we find the decomposition of   into powers of irreducible polynomials (recalling that the ring of polynomials over a finite field is a unique factorization domain).

All possible factors of   are contained within the factor ring

 

The algorithm focuses on polynomials   which satisfy the congruence:

 

These polynomials form a subalgebra of R (which can be considered as an  -dimensional vector space over  ), called the Berlekamp subalgebra. The Berlekamp subalgebra is of interest because the polynomials   it contains satisfy

 

In general, not every GCD in the above product will be a non-trivial factor of  , but some are, providing the factors we seek.

Berlekamp's algorithm finds polynomials   suitable for use with the above result by computing a basis for the Berlekamp subalgebra. This is achieved via the observation that Berlekamp subalgebra is in fact the kernel of a certain   matrix over  , which is derived from the so-called Berlekamp matrix of the polynomial, denoted  . If   then   is the coefficient of the  -th power term in the reduction of   modulo  , i.e.:

 

With a certain polynomial  , say:

 

we may associate the row vector:

 

It is relatively straightforward to see that the row vector   corresponds, in the same way, to the reduction of   modulo  . Consequently, a polynomial   is in the Berlekamp subalgebra if and only if   (where   is the   identity matrix), i.e. if and only if it is in the null space of  .

By computing the matrix   and reducing it to reduced row echelon form and then easily reading off a basis for the null space, we may find a basis for the Berlekamp subalgebra and hence construct polynomials   in it. We then need to successively compute GCDs of the form above until we find a non-trivial factor. Since the ring of polynomials over a field is a Euclidean domain, we may compute these GCDs using the Euclidean algorithm.

Conceptual algebraic explanation edit

With some abstract algebra, the idea behind Berlekamp's algorithm becomes conceptually clear. We represent a finite field  , where   for some prime  , as  . We can assume that   is square free, by taking all possible pth roots and then computing the gcd with its derivative.

Now, suppose that   is the factorization into irreducibles. Then we have a ring isomorphism,  , given by the Chinese remainder theorem. The crucial observation is that the Frobenius automorphism   commutes with  , so that if we denote  , then   restricts to an isomorphism  . By finite field theory,   is always the prime subfield of that field extension. Thus,   has   elements if and only if   is irreducible.

Moreover, we can use the fact that the Frobenius automorphism is  -linear to calculate the fixed set. That is, we note that   is a  -subspace, and an explicit basis for it can be calculated in the polynomial ring   by computing   and establishing the linear equations on the coefficients of   polynomials that are satisfied iff it is fixed by Frobenius. We note that at this point we have an efficiently computable irreducibility criterion, and the remaining analysis shows how to use this to find factors.

The algorithm now breaks down into two cases:

  • In the case of small   we can construct any  , and then observe that for some   there are   so that   and  . Such a   has a nontrivial factor in common with  , which can be computed via the gcd. As   is small, we can cycle through all possible  .
  • For the case of large primes, which are necessarily odd, one can exploit the fact that a random nonzero element of   is a square with probability  , and that the map   maps the set of non-zero squares to  , and the set of non-squares to  . Thus, if we take a random element  , then with good probability   will have a non-trivial factor in common with  .

For further details one can consult.[1]

Applications edit

One important application of Berlekamp's algorithm is in computing discrete logarithms over finite fields  , where   is prime and  . Computing discrete logarithms is an important problem in public key cryptography and error-control coding. For a finite field, the fastest known method is the index calculus method, which involves the factorisation of field elements. If we represent the field   in the usual way - that is, as polynomials over the base field  , reduced modulo an irreducible polynomial of degree   - then this is simply polynomial factorisation, as provided by Berlekamp's algorithm.

Implementation in computer algebra systems edit

Berlekamp's algorithm may be accessed in the PARI/GP package using the factormod command, and the WolframAlpha [1] website.

See also edit

References edit

  1. ^ Theory of Computation - Dexter Kozen. Springer. Retrieved 2020-09-19.

berlekamp, algorithm, algorithm, dealing, with, lfsrs, berlekamp, massey, algorithm, mathematics, particularly, computational, algebra, well, known, method, factoring, polynomials, over, finite, fields, also, known, galois, fields, algorithm, consists, mainly,. For the algorithm dealing with LFSRs see Berlekamp Massey algorithm In mathematics particularly computational algebra Berlekamp s algorithm is a well known method for factoring polynomials over finite fields also known as Galois fields The algorithm consists mainly of matrix reduction and polynomial GCD computations It was invented by Elwyn Berlekamp in 1967 It was the dominant algorithm for solving the problem until the Cantor Zassenhaus algorithm of 1981 It is currently implemented in many well known computer algebra systems Contents 1 Overview 2 Conceptual algebraic explanation 3 Applications 4 Implementation in computer algebra systems 5 See also 6 ReferencesOverview editBerlekamp s algorithm takes as input a square free polynomial f x displaystyle f x nbsp i e one with no repeated factors of degree n displaystyle n nbsp with coefficients in a finite field F q displaystyle mathbb F q nbsp and gives as output a polynomial g x displaystyle g x nbsp with coefficients in the same field such that g x displaystyle g x nbsp divides f x displaystyle f x nbsp The algorithm may then be applied recursively to these and subsequent divisors until we find the decomposition of f x displaystyle f x nbsp into powers of irreducible polynomials recalling that the ring of polynomials over a finite field is a unique factorization domain All possible factors of f x displaystyle f x nbsp are contained within the factor ring R F q x f x displaystyle R frac mathbb F q x langle f x rangle nbsp The algorithm focuses on polynomials g x R displaystyle g x in R nbsp which satisfy the congruence g x q g x mod f x displaystyle g x q equiv g x pmod f x nbsp These polynomials form a subalgebra of R which can be considered as an n displaystyle n nbsp dimensional vector space over F q displaystyle mathbb F q nbsp called the Berlekamp subalgebra The Berlekamp subalgebra is of interest because the polynomials g x displaystyle g x nbsp it contains satisfy f x s F q gcd f x g x s displaystyle f x prod s in mathbb F q gcd f x g x s nbsp In general not every GCD in the above product will be a non trivial factor of f x displaystyle f x nbsp but some are providing the factors we seek Berlekamp s algorithm finds polynomials g x displaystyle g x nbsp suitable for use with the above result by computing a basis for the Berlekamp subalgebra This is achieved via the observation that Berlekamp subalgebra is in fact the kernel of a certain n n displaystyle n times n nbsp matrix over F q displaystyle mathbb F q nbsp which is derived from the so called Berlekamp matrix of the polynomial denoted Q displaystyle mathcal Q nbsp If Q q i j displaystyle mathcal Q q i j nbsp then q i j displaystyle q i j nbsp is the coefficient of the j displaystyle j nbsp th power term in the reduction of x i q displaystyle x iq nbsp modulo f x displaystyle f x nbsp i e x i q q i n 1 x n 1 q i n 2 x n 2 q i 0 mod f x displaystyle x iq equiv q i n 1 x n 1 q i n 2 x n 2 ldots q i 0 pmod f x nbsp With a certain polynomial g x R displaystyle g x in R nbsp say g x g n 1 x n 1 g n 2 x n 2 g 0 displaystyle g x g n 1 x n 1 g n 2 x n 2 ldots g 0 nbsp we may associate the row vector g g 0 g 1 g n 1 displaystyle g g 0 g 1 ldots g n 1 nbsp It is relatively straightforward to see that the row vector g Q displaystyle g mathcal Q nbsp corresponds in the same way to the reduction of g x q displaystyle g x q nbsp modulo f x displaystyle f x nbsp Consequently a polynomial g x R displaystyle g x in R nbsp is in the Berlekamp subalgebra if and only if g Q I 0 displaystyle g mathcal Q I 0 nbsp where I displaystyle I nbsp is the n n displaystyle n times n nbsp identity matrix i e if and only if it is in the null space of Q I displaystyle mathcal Q I nbsp By computing the matrix Q I displaystyle mathcal Q I nbsp and reducing it to reduced row echelon form and then easily reading off a basis for the null space we may find a basis for the Berlekamp subalgebra and hence construct polynomials g x displaystyle g x nbsp in it We then need to successively compute GCDs of the form above until we find a non trivial factor Since the ring of polynomials over a field is a Euclidean domain we may compute these GCDs using the Euclidean algorithm Conceptual algebraic explanation editWith some abstract algebra the idea behind Berlekamp s algorithm becomes conceptually clear We represent a finite field F q textstyle mathbb F q nbsp where q p m textstyle q p m nbsp for some prime p textstyle p nbsp as F p y g y textstyle mathbb F p y g y nbsp We can assume that f x F q x textstyle f x in mathbb F q x nbsp is square free by taking all possible pth roots and then computing the gcd with its derivative Now suppose that f x f 1 x f n x textstyle f x f 1 x ldots f n x nbsp is the factorization into irreducibles Then we have a ring isomorphism s F q x f x i F q x f i x textstyle sigma mathbb F q x f x to prod i mathbb F q x f i x nbsp given by the Chinese remainder theorem The crucial observation is that the Frobenius automorphism x x p textstyle x to x p nbsp commutes with s textstyle sigma nbsp so that if we denote Fix p R f R f p f textstyle text Fix p R f in R f p f nbsp then s textstyle sigma nbsp restricts to an isomorphism Fix p F q x f x i 1 n Fix p F q x f i x textstyle text Fix p mathbb F q x f x to prod i 1 n text Fix p mathbb F q x f i x nbsp By finite field theory Fix p F q x f i x textstyle text Fix p mathbb F q x f i x nbsp is always the prime subfield of that field extension Thus Fix p F q x f x textstyle text Fix p mathbb F q x f x nbsp has p textstyle p nbsp elements if and only if f x textstyle f x nbsp is irreducible Moreover we can use the fact that the Frobenius automorphism is F p textstyle mathbb F p nbsp linear to calculate the fixed set That is we note that Fix p F q x f x textstyle text Fix p mathbb F q x f x nbsp is a F p textstyle mathbb F p nbsp subspace and an explicit basis for it can be calculated in the polynomial ring F p x y f g textstyle mathbb F p x y f g nbsp by computing x i y j p textstyle x i y j p nbsp and establishing the linear equations on the coefficients of x y textstyle x y nbsp polynomials that are satisfied iff it is fixed by Frobenius We note that at this point we have an efficiently computable irreducibility criterion and the remaining analysis shows how to use this to find factors The algorithm now breaks down into two cases In the case of small p textstyle p nbsp we can construct any g Fix p F q x f x F p textstyle g in text Fix p mathbb F q x f x setminus mathbb F p nbsp and then observe that for some a F p textstyle a in mathbb F p nbsp there are i j textstyle i j nbsp so that g a 0 mod f i textstyle g a 0 mod f i nbsp and g a 0 mod f j textstyle g a not 0 mod f j nbsp Such a g a textstyle g a nbsp has a nontrivial factor in common with f x textstyle f x nbsp which can be computed via the gcd As p textstyle p nbsp is small we can cycle through all possible a textstyle a nbsp For the case of large primes which are necessarily odd one can exploit the fact that a random nonzero element of F p textstyle mathbb F p nbsp is a square with probability 1 2 textstyle 1 2 nbsp and that the map x x p 1 2 textstyle x to x frac p 1 2 nbsp maps the set of non zero squares to 1 textstyle 1 nbsp and the set of non squares to 1 textstyle 1 nbsp Thus if we take a random element g Fix p F q x f x textstyle g in text Fix p mathbb F q x f x nbsp then with good probability g p 1 2 1 textstyle g frac p 1 2 1 nbsp will have a non trivial factor in common with f x textstyle f x nbsp For further details one can consult 1 Applications editOne important application of Berlekamp s algorithm is in computing discrete logarithms over finite fields F p n displaystyle mathbb F p n nbsp where p displaystyle p nbsp is prime and n 2 displaystyle n geq 2 nbsp Computing discrete logarithms is an important problem in public key cryptography and error control coding For a finite field the fastest known method is the index calculus method which involves the factorisation of field elements If we represent the field F p n displaystyle mathbb F p n nbsp in the usual way that is as polynomials over the base field F p displaystyle mathbb F p nbsp reduced modulo an irreducible polynomial of degree n displaystyle n nbsp then this is simply polynomial factorisation as provided by Berlekamp s algorithm Implementation in computer algebra systems editBerlekamp s algorithm may be accessed in the PARI GP package using the factormod command and the WolframAlpha 1 website See also editPolynomial factorisation Factorization of polynomials over a finite field and irreducibility tests Cantor Zassenhaus algorithmReferences edit Theory of Computation Dexter Kozen Springer Retrieved 2020 09 19 Berlekamp Elwyn R 1967 Factoring Polynomials Over Finite Fields Bell System Technical Journal 46 8 1853 1859 doi 10 1002 j 1538 7305 1967 tb03174 x MR 0219231 BSTJ Later republished in Berlekamp Elwyn R 1968 Algebraic Coding Theory McGraw Hill ISBN 0 89412 063 8 Knuth Donald E 1997 4 6 2 Factorization of Polynomials Seminumerical Algorithms The Art of Computer Programming Vol 2 Third ed Reading Massachusetts Addison Wesley pp 439 461 678 691 ISBN 0 201 89684 2 Retrieved from https en wikipedia org w index php title Berlekamp 27s algorithm amp oldid 1173490488, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.