Cmpe 360
HW 8
Q1: Find the least squares polynomials of degrees 1, 2, and 3 for the data in
the following table. Compute the error E in each case. Graph the data and the
polynomials.
xi 1.0 1.1 1.3 1.5 1.9 2.1
yi 1.84 1.96 2.21 2.45 2.94 3.18
Solve the following three
questions for the function f(x) = ex
Q2: Find the linear least squares polynomial approximation on the interval [-1,
1].
Q3: Find the linear least squares polynomial approximation of degree 2 on this
interval.
Q4: Compute the error E for Q2.
Q5: Find the general continuous least squares trigonometric polynomial Sn(x)
for f(x), where
f(x) = 0, if –π < x
≤ 0
f(x) = 1, if 0 < x < π