5

Is there any way to determine the number of roots of a polynomial in finite field, more specifically, $GF(2^q)$, without actually solving the equation and find all roots?

hardmath
  • 37,015
Nan
  • 417
  • The degree of the polynomial is an upper bound on the number of roots. If the polynomial is irreducible over the field of degree more than one, then it has no roots in the field. There are irreducible polynomials of all degrees, so there is little you can do apart from factoring and/or checking for roots. – hardmath Oct 04 '15 at 00:16
  • 1
    This question discusses the related problem of actually also finding those zeros. In spite of what hardmath said this is actually possible as long as the degree of the polynomial is modest. Even if the finite field is relatively large! That example there hopefully convinces everybody that the method is not based on checking elements one by one :-) – Jyrki Lahtonen Oct 04 '15 at 04:59

2 Answers2

6

Yes. This is possible, because the field is finite.

If $p(x)$ is your polynomial, all you need to do is to calculate the greatest common divisor $$ d(x):=\gcd(p(x),x^{2^q}-x). $$ The number of zeros of $p(x)$ in the field $GF(2^q)$ is then equal to the degree of $d(x)$. This is because the polynomial $x^{2^q}-x$ has all the elements of $GF(2^q)$ as simple zeros.

Observe that even though that exponent $2^q$ may be quite large, the computation of the gcd using Euclid's algorithm is still reasonably fast as long as the degree of $p(x)$ is not too high. This is because calculating the remainder of $x^{2^q}$ when divided by $p(x)$ is really just repeated squaring. And this is then the only step dealing with high degree polynomials.

Jyrki Lahtonen
  • 133,153
  • If you have a specific polynomial in mind, there may be tricks and shortcuts... – Jyrki Lahtonen Oct 04 '15 at 04:56
  • Thank you very much for your reply. Could you elaborate more on this part of your answer?"This is because calculating the remainder of x2qx2q when divided by p(x)p(x) is really just repeated squaring. And this is then the only step dealing with high degree polynomials." – Nan Oct 04 '15 at 18:19
  • My application scenario is that I generated a polynomial over finite field using an algorithm called Berlekamp–Massey algorithm. The generated polynomial, however, may not be a valid solution to my problem. A valid polynomial should be the one whose number of roots equal to its degree. One way to tell if the polynomial is valid is to use a process called Chien search which basically tries every element in the field to see if the polynomial is zero. So if there is any algorithm that is faster than the chien search, it would be helpful to me. Thanks – Nan Oct 04 '15 at 18:27
  • @Nan: So you are decoding an RS-code or a BCH-code. Why didn't you say so :-) I'd say that the answer depends on the numerology of your code. If the code is short, then a Chien search is not too bad. This is because typically you go through the field elements in the order they come as powers of a primitive element. In that case the values of a degree $t$ polynomial form a sequence with a linear recurrence relation of depth $t$, which is relatively fast. In particular because in the positive cases when the decoding is successful you will be doing a Chien search anyway. – Jyrki Lahtonen Oct 05 '15 at 13:25
  • (cont'd) OTOH, if there is a high risk of Berlekamp-Massey giving you an invalid polynomial, and the length of the code is something like 64800 bits, then it may be worth your while to check that the polynomial has the correct number of solutions. And calculating the gcd of a degree, say $14$, polynomial $p(x)$ and $q(x)=x^{65536}-x$ is (me thinks) faster than doing a Chien search. Anyway, I was suggesting that you calculate the remainder of $q(x)$ modulo $p(x)$ using repeated squaring. – Jyrki Lahtonen Oct 05 '15 at 13:30
  • Is there anything specific here to $2^q$ or can we just modify $x^q-x$ for any finite field $q$? – Future Jun 06 '17 at 04:45
1

@Jyrki: After read some material on the repeated squaring, I think what you were referring was as:

$x^2~mod ~p(x) = (x ~mod ~p(x))^2 ~mod ~p(x)$

$x^4 ~mod ~p(x) = (x^2 ~mod ~p(x))^2 ~mod ~p(x)$

...

Do you think this is the most efficient way to calculate

$x^{2^q} ~mod ~p(x)$?

Seems to me that most complexity lies in squaring the polynomials.

Another point is that I think for my application, it is enough to only calculate

$x^{2^q} -x~mod ~p(x)$

if the above term is not zero, that means $p(x)$ definitely does not have enough number of roots (which would be equal to its degree if it is a valid polynomial). So the expensive Chien search can be skipped for this one. Do you agree with me?

Nan
  • 417