Today we restrict ourself to univariate polynomials and examine
the Euclidean algorithm in details.
Let
be any field (e.g.
).
We consider the following problems:
This is typically a nontrivial problem. An equivalent problem is to decide if a(x) and b(x) have a common zero in some extension field of
For the above relationship, the degrees of r(x) and b(x) are often bounded in some way. This usually depends on the application involved.
All three problems can be solved efficiently by the Extended Euclidean
Algorithm. Recall that, for
,
not both zero,
is defined to be the common divisor of a(x) and b(x)that has the greatest degree and is monic.
We make the convention that
.
Facts:
The second fact above is the so-called long division and the remainder r(x)is either zero or has a degree smaller than that of b(x).
The Euclidean algorithm
is simply a sequence of long divisions (repeated until the remainder becomes
zero). The following extended Euclidean algorithm (EEA) also expresses
each remainder as a linear combination of the original polynomials.
To fix notation, let
a(x) = r-1 and
b(x) = r0, and we assume
that
.
The next theorem follows immediately from the algorithm.
The polynomials ui and vi have very nice properties.
Proof.
Note that for
Iterate the above matrix equation i times yields
But
Now we want to look at the relationship of the degrees of qi and ri.
since
for
,
it follows from
ri-1= qi+1 ri + ri+1 that
So the Extended Euclidean Algorithm (EEA) uses at most the following number of operations:
Remark. EEA is fine to use for finite fields,
since the coefficients of the intermediate polynomials never grow big.
But for other fields (such as
), the sizes of the coefficients
will grow exponentially.