# HW 4.pdf - Homework Math 104 A 1 Instructor Prof Hector D...

• Notes
• 2

This preview shows page 1 - 2 out of 2 pages.

Homework, Math 104 A1Instructor: Prof. Hector D. CenicerosGeneral Instructions: Please write your homework papers neatly. You need to turn inboth full printouts of your codes and the appropriate runs you made. Write your own code,individually. Do not copy codes!1. (a) Write the Lagrangian form of the interpolating polynomialP2corresponding to thedata in the table below:xjf(xj)01113-5(b) UseP2to approximatef(2).2. We proved in class thatkf-pnk(1 + Λn)kf-p*nk(1)wherepnis the interpolating polynomial offat the nodesx0, . . . , xn,p*nis the bestapproximation off, in the supremum (infinity) norm, by a polynomial of degree atmostn, and Λnis the Lebesgue constant, i.e. Λn=kLnk, whereLn(x) =nXj=0|lj(x)|.(2)(a) Write a computer code to evaluate the Lebesgue function (2) associated to a givenset of pairwise distinct nodesx0, . . . , xn.(b) Consider the equidistributed pointsxj=-1+j(2/n) forj= 0, . . . , n. Write a com-puter code that uses (a) to evaluate and plotLn(x) (evaluateLn(x) at a large numberof points ¯x