Starting from:

$30

CS 241 Homework 2

Homework 2
1 Questions
1. Q1: Finish the online Homework2 in www.educoder.net.
2. Q2: What is the time complexity of your Lagrange interpolation algorithm? What about
your Newton interpolation algorithm?
3. Q3: Given f(x) = 1
1+x2
, x ∈ [−5, 5]. Compute the interpolating polynomials based on the
following points sampled from f(x) using both Lagrange and Newton interpolation algorithms
finished in Q1.
x = [−5, −4, −3, −2, −1, 0, 1, 2, 3, 4, 5]
f(x) = [0.0385, 0.0588, 0.1, 0.2, 0.5, 1.0, 0.5, 0.2, 0.1, 0.0588, 0.0385]
Draw curves of the original function and your interpolating polynomials in one figure using
any tools you like, such as Python, Matlab, Excel, etc. What do you find comparing the
original line with the interpolating lines?
2 Note
1. Do not cheat! We will check duplicates.
2. Due is Oct. 2rd, 23:59. Finish the online judge, submit a PDF of the homework on the canvas.
No late homework is accepted!
1

More products