19.07.2014 Views

Contents - Student subdomain for University of Bath

Contents - Student subdomain for University of Bath

Contents - Student subdomain for University of Bath

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

50 CHAPTER 2. POLYNOMIALS<br />

a result <strong>of</strong>ten called Bezout’s identity.<br />

It is possible to make similar modifications to algorithm 3, and the same<br />

theory that shows the division by β i+1 is exact shows that we can per<strong>for</strong>m<br />

the same division <strong>of</strong> (e, e ′ ). However, at the end, we return pp(a i−1 ), and the<br />

division by cont(a i−1 ) is not guaranteed to be exact when applied to (a, b).<br />

Algorithm 5 (General extended p.r.s.)<br />

Input: f, g ∈ K[x].<br />

Output: h ∈ K[x] a greatest common divisor <strong>of</strong> pp(f) and pp(g), h ′ ∈ K and<br />

c, d ∈ K[x] such that cf + dg = h ′ h<br />

Comment: If f, g ∈ R[x], where R is an integral domain and K is the field <strong>of</strong><br />

fractions <strong>of</strong> R, then all computations are exact in R[x], and h ′ ∈ R, c, d ∈ R[x].<br />

i := 1;<br />

if deg(f) < deg(g)<br />

then a 0 := pp(g); a 1 := pp(f);<br />

(*) a := 1; d := 1; b := c := 0<br />

else a 0 := pp(f); a 1 := pp(g);<br />

(*) c := 1; b := 1; a := d := 0<br />

δ 0 := deg(a 0 ) − deg(a 1 );<br />

β 2 := (−1) δ0+1 ;<br />

ψ 2 := −1;<br />

while a i ≠ 0 do<br />

(*) #Loop invariant: a i = af + bg; a i−1 = cf + dg;<br />

a i+1 = prem(a i−1 , a i )/β i+1 ;<br />

#q i :=the corresponding quotient: a i+1 = a i−1 − q i a i<br />

δ i := deg(a i ) − deg(a i+1 );<br />

(*) e := (c − q i a)/β i+1 ;<br />

(*) e ′ := (d − q i b)/β i+1 ; #a i+1 = ef + e ′ g<br />

i := i + 1;<br />

(*) (c, d) = (a, b);<br />

(*) (a, b) = (e, e ′ )<br />

ψ i+1 := −lc(a i−1 ) δi−2 ψ 1−δi−2<br />

i ;<br />

i+1 ;<br />

β i+1 := −lc(a i−1 )ψ δi−1<br />

return (pp(a i−1 ), cont(a i−1 ), c, d);<br />

2.3.4 Polynomials in several variables<br />

Here it is best to regard the polynomials as recursive, so that R[x, y] is regarded<br />

as R[y][x]. In this case, we now know how to compute the greatest common<br />

divisor <strong>of</strong> two bivariate polynomials.<br />

Algorithm 6 (Bivariate g.c.d.)<br />

Input: f, g ∈ R[y][x].<br />

Output: h ∈ R[y][x] a greatest common divisor <strong>of</strong> f and g<br />

h c := the g.c.d. <strong>of</strong> cont x (f) and cont x (g)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!