hw6_solutions - CS 257 Numerical Methods - Homework 6...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS 257 Numerical Methods - Homework 6 October 25, 2006 1. [1pt] Section 4.1 #1 Solution: p ( x ) = 7 ( x- 2)( x- 3)( x- 4) (0- 2)(0- 3)(0- 4) +11 ( x- 0)( x- 3)( x- 4) (2- 0)(2- 3)(2- 4) +28 ( x- 0)( x- 2)( x- 4) (3- 0)(3- 2)(3- 4) +63 ( x- 0)( x- 2)( x- 3) (4- 0)(4- 2)(4- 3) 2. [1pt] Section 4.1 #3 Solution: Let { x , x 1 , x 2 , x 3 } = {- 1 , 1 , 3 , 4 } . We find the four corresponding Lagrange polynomials to be ` = ( x- 1)( x- 3)( x- 4) (- 1- 1)(- 1- 3)(- 1- 4) ` 1 = ( x +1)( x- 3)( x- 4) (1+1)(1- 3)(1- 4) ` 2 = ( x +1)( x- 1)( x- 4) (3+1)(3- 1)(3- 4) ` 3 = ( x +1)( x- 1)( x- 3) (4+1)(4- 1)(4- 3)-2-1 1 2 3 4 5-3-2-1 1 2 3 4 Lagrange Polynomials The key property your graph should show is that ` i ( x j ) = 1 i = j i 6 = j 3. [1pt] Section 4.1 #4 Solution: To verify that the two polynomials interpolate the data, just note that for all four points p ( x i ) = q ( x i ) = y i . The “Existance of Polynomial Interpolation Theorem” guarantees that for four data points there is a unique polynomial of degree three or less which interpolates the data. q is of degree four so the theorem does not apply. 4. [1pt] Section 4.1 #13 Solution: 1 (a)-1 1-1 2-1-1-7 2-1 1 3 5 3 1 1 p ( x ) =- 1 + 0 x + 0 x ( x- 1) + 1 x ( x- 1)( x- 2) + 0 x ( x- 1)( x- 2)( x + 1) (b) 1 2 3 6 2-2-1 7/5 1/5 4-4 1/2-19/10-7/10 5 2 6 13/14 99/70 37/70 p ( x ) = 2 + 2( x- 1) + 1 5 ( x- 1)( x- 3)- 7 10 ( x- 1)( x- 3)( x + 2) + 37 70 ( x- 1)( x- 3)( x + 2)( x- 4) 5. [1pt] Section 4.1 #18 Solution: 2 1 1-1 3 5 2 1 2 6-1-3-2 5-183-63-31-7-1 p ( x ) = 2- 1 x + 1 x ( x- 1)- 2 x ( x- 1)( x- 3)- 1 x ( x- 1)( x- 3)( x- 2) Rearanging for fast evaluation we find, p ( x ) = 2 + x (- 1 + ( x- 1)(1 + ( x- 3)(- 2 + ( x- 2)(- 1)))) 6. [1pt] Section 4.1 #40 Solution: To create a divided difference table with n + 1 points, one will need to perform arithmatic to put data in in n columns: one for f [ , ], one for f [ , , ], etc. The first column will contain n enteries, the second n- 1, and so on. The total number of enteries to be filled in will be n + ( n- 1) + ( n- 2) + . . . + 2 + 1 = n ( n + 1) 2 For each entry one must perform two subtractions, one division, and no multiplications. Therefore, the total number of subtractions is n ( n + 1). The total number of divisions is n ( n +1) 2 . 7. [1pt] Section 4.1 #42 Solution: Given a polynomial p ( x ) of degree n and n + 2 numbers x i , imagine generating the data points [ x i , p ( x i )].We know that we can find a Newton polynomial of these data points using the divided difference formula. p n +1 ( x ) = p [ x ] + p [ x , x 2 ]( x- x ) + . . . + p [ x , . . . , x n +1 ]( x- x )( x- x 1 ) . . . ( x- x n ) Note that the above Newton polynomial is of degree less than or equal to n + 1. We know that the degree n polynomial p also interpolates the data. By “Existance of Polynomial Interpolation Theorem”, there is a unique polynomial of degree n + 1 or less that interpolate that data points. Hence, p and p n +1 are equal....
View Full Document

This note was uploaded on 09/15/2008 for the course CS 257 taught by Professor Thomaskerkhoven during the Fall '05 term at University of Illinois at Urbana–Champaign.

Page1 / 10

hw6_solutions - CS 257 Numerical Methods - Homework 6...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online