Problem:
Solution:
This is basically exercising the algorithm we developed in the last problem, the flow goes like this
I(V(f1,f2))=I(V(g))
I(V(g))=⟨gred⟩
gred=gd
d=gcd(g,g′)
g=x4−2x3+2x−1
g′=4x3−6x2+2
d=x2−2x+1
gred=x2−1
Therefore I(V(x5−2x4+2x2−x,x5−x4−2x3+2x2+x−1))=⟨x2−1⟩
All these are computed using this program
print "Problem 17"
f = polynomial.from_string("x^5 - 2x^4 + 2x^2 - x")
g = polynomial.from_string("x^5 - x^4 - 2x^3 + 2x^2 + x - 1")
gcd = polynomial.polynomial_gcd(f, g)
gcdd = gcd.derivative()
d = polynomial.polynomial_gcd(gcd, gcdd)
(gred, r) = polynomial.polynomial_divide(gcd, d)
print gcd
print gcdd
print d
print gred
Solution:
This is basically exercising the algorithm we developed in the last problem, the flow goes like this
I(V(f1,f2))=I(V(g))
I(V(g))=⟨gred⟩
gred=gd
d=gcd(g,g′)
g=x4−2x3+2x−1
g′=4x3−6x2+2
d=x2−2x+1
gred=x2−1
Therefore I(V(x5−2x4+2x2−x,x5−x4−2x3+2x2+x−1))=⟨x2−1⟩
All these are computed using this program
print "Problem 17"
f = polynomial.from_string("x^5 - 2x^4 + 2x^2 - x")
g = polynomial.from_string("x^5 - x^4 - 2x^3 + 2x^2 + x - 1")
gcd = polynomial.polynomial_gcd(f, g)
gcdd = gcd.derivative()
d = polynomial.polynomial_gcd(gcd, gcdd)
(gred, r) = polynomial.polynomial_divide(gcd, d)
print gcd
print gcdd
print d
print gred
No comments:
Post a Comment