Problems

  1. Show that a degree n two-variable polynomial has (n+1)(n+2)/2 terms and that a degree n three-variable polynomial has (n+1)(n+2)(n+3)/6 terms.
  2. Under finite precision arithmetic, addition and multiplication operators are commutative. In general, the associative law and distributive law do not hold. Suppose you have a decimal computer with four significant digits for floating number computation.
  3. Function cos(x) has a series similar to that of sin(x):

    Based on the function of sin(x), write a function for cos(x). Will you get strange results similar to that of sin(x).

  4. Let us minimize the effect of subtractions in the computation of sin(x) and cos(x). Use two variables, positive and negative. The former accumulates all terms with positive signs, while the latter accumulates all terms with negative signs. The result is positive - negative. Would this scheme be better? Write a program to verify it.
  5. Given a polynomial like the following one:

    it is always possible to rearrange the terms to a new form:

    What is the advantages of the second form over the first one? Please count the number of multiplications. Which form would propagate errors faster? Write a function that takes a degree n polynomial (coefficients in an array) and a x and evaluates the polynomial at x using the second form.