{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw7_solutions

# hw7_solutions - Due CS 257(Luke Olson Homework#7 Solutions...

This preview shows pages 1–3. Sign up to view the full content.

Due: October 23, 2008 CS 257 (Luke Olson): Homework #7 Solutions Problem 1 Problem 1 Consider the following table of values x 0 2 3 y 7 11 28 1. Write out the interpolating polynomial using a Lagrange basis. 2. Write out the interpolating polynomial using a Newton basis. 3. Rewrite your Newton polynomial so it can be evaluated efficiently using Horner’s method. 4. Simplify both the Newton and the Lagrange polynomials and show that you get the same polynomial regardless of the basis you use. Solution 1. Write out the interpolating polynomial using a Lagrange basis. 7 ( x - 2)( x - 3) (0 - 2)(0 - 3) + 11 ( x - 0)( x - 3) (2 - 0)(2 - 3) + 28 ( x - 0)( x - 2) (3 - 0)(3 - 2) 2. Write out the interpolating polynomial using a Newton basis. 7 + 4 ( x - 0) (2 - 0) + 15 ( x - 0)( x - 2) (3 - 0)(3 - 2) 3. Rewrite your Newton polynomial so it can be evaluated efficiently using Horner’s method. (5( x - 2) + 2)( x - 0) + 7 4. Simplify both the Newton and the Lagrange polynomials and show that you get the same polynomial regardless of the basis you use. 5 x 2 - 8 x + 7 Grading One point for each part. Page 1 of 4

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Due: October 23, 2008 CS 257 (Luke Olson): Homework #7 Solutions Problem 2 Problem 2 Implement both divided difference.m and newton interp.m from the skeleton code given below.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}