Verify Token
VerifyTips on modular polynomial division
Computations like the ones above arise in many different contexts (testing divisibility, Euclidean Algorithm on Polynomials, etc.). Everything we do about Polynomial Division is based on Theorem 5.25 which is just Euclid's Division Theorem for Polynomials (note that we can generalize everything to the more general case of Euclidean domains). This page focuses on doing fast polynomial division.
Normal Polynomial Division
Consider the polynomials and . To divide by one could use the notation in the same manner as the integer division algorithm from primary school. However, I think the following notation is much quicker and more intuitive when practiced a lot. I would call it the because we use no fancy tabular notation or anything, but just signs and cleverly factor everything in one line. In the end it's really nothing but rewriting the polynomial in a clever way, we don't change anything or do anything special. We basically always do the following steps (We want to divide by ):
- Take a look at look at the part that is not factored in terms of yet, let's call this part (when starting, we have ). Take a look at the highest-order term and eliminate it (written in green in the following example).
- How to eliminate? Think about how to obtain this using . More precisely find some such that the leading term of the highest order of and is the same.
- Subtract all the evil terms you produced by this multiplication (we only wanted to eliminate the highest order term) - all lower order terms of , let's call them
- Now we have a part which is factored in terms of and some rest part. We go back to step 1, and call this rest part as long as the degree is greater or equal to the degree of otherwise, we cannot divide by anymore.
Consider the following example and try to understand it in detail:
Now, as our remainder has a degree smaller than the degree of (intuitively, we cannot pull out any factor of anymore), we are finished.
Modular Polynomial division
From the computation above, we also were able to find the unique remainder of . Oftentimes this is the only thing we are interested in, for example in the case of an extension field or computing modulo a polynomial. Consider the above example, but now we only want to compute . It makes the whole notation a lot easier because what we can intuitively do is throw away all of the terms which divisible by in each line because we replace the signs with signs. This makes it much more beautiful:
Look how neat this is. The more you practice the more steps can you skip (for example do the subtraction of the evil terms directly) - but watch out, don't do too many at once :).
Modular Polynomial Divison over Finite Fields
Even more often we might be working with polynomials over some finite field. We could for example want to compute the remainder of mod over . Actually, we can just do the same, and in the end, take all coefficients modulo . However, we could also do all of the things on the fly and always work with the coefficients in . Remember that we basically can consider the coefficients as representatives of modular equivalence classes (i.e. for example ). You might want to write a note at the beginning of the calculations like:
Note that I will treat two polynomials as equal, respecting that the coefficients are in . Therefore, something like will be used such that no coefficient bigger than will appear (instead of stating explicitly that the coefficients are congruent modulo ). However, I will still use or to make explicit that I consider the remainder modulo the polynomial .
In this context it is often handy to have a quick intuition about what negative numbers are in the respective fields, as you will subtract something quite often, you can also directly write it as an addition. For example (remember the evil terms) would over be the same as .
Now it's up to you to practice these things (see above :)).