Homework 7

Please do the following exercise from the textbook.  

Exercise 5.11

For a scheme file of the polynomial procedures we defined in class, click here.

The algorithm for division of polynomials is as follows:
(the dividend is the first polynomial in the procedure call, and the divisor is the second polynomial in the procedure call)
  1. Divide the leading term of the dividend by the leading term of the divisor (this is the first term of the quotient)
  2. Multiply above result by the divisor
  3. Subtract above result from the dividend
  4. Divide above result by divisor and continue recursively
  5. If the degree of the divisor is greater than the degree of the dividend, stop and return dividend as the remainder
  6. If the dividend becomes zero, the quotient and remainder are both zero
Example:
(x^2 - 4) / (x - 2)
  1. x^2 / x = x
  2. x * (x - 2) = x^2 - 2x
  3. x^2 - 4 - (x^2 - 2x) = 2x - 4
  4. (2x - 4) / (x - 2) = 2
done:  answer is (x + 2) and there is no remainder

Homework is due in class on March 10, 2004.