Problem:
Solution:
Part (a) is obvious
fGCD(f,f′)=c(x−a1)r1⋯(x−an)rn(x−a1)r1−1⋯(x−an)rn−1=c(x−a1)⋯(x−an)=fred
Part (b) is just an application of the formula.
print "Problem 15"
f = polynomial.from_string("x^11 - x^10 + 2x^8 - 4x^7 + 3x^5 - 3x^4 + x^3 + 3x^2 - x - 1")
fd = f.derivative()
g = polynomial.polynomial_gcd(f, fd)
(q, r) = polynomial.polynomial_divide(f, g)
print q
The square free part of the polynomial is x5+x2−x−1
Solution:
Part (a) is obvious
fGCD(f,f′)=c(x−a1)r1⋯(x−an)rn(x−a1)r1−1⋯(x−an)rn−1=c(x−a1)⋯(x−an)=fred
Part (b) is just an application of the formula.
print "Problem 15"
f = polynomial.from_string("x^11 - x^10 + 2x^8 - 4x^7 + 3x^5 - 3x^4 + x^3 + 3x^2 - x - 1")
fd = f.derivative()
g = polynomial.polynomial_gcd(f, fd)
(q, r) = polynomial.polynomial_divide(f, g)
print q
No comments:
Post a Comment