Part 1
1. Sample f(t) to produce f(t k) where k ∈ [1, 10] ⊂ Z. The t k should be randomly chosen points on the
interval [-2, 2]. Produce a table with columns t k and f(t k). Ensure that the t ks are not sorted.
2. Solve the normal equations using QR decomposition and calculate the error, E. Write your approximated
function, fˆ1(t).
3. Solve the normal equations using the SVD and calculate the error, E. Write your approximated function,
ˆf2(t).
4. Plot f(t), fˆ1(t) and fˆ2(t) on the same plot.
Part 2
In this part we will see how additive random noise affects our solution.
1. Create a new dataset by doing the following:
• Sample f(t) to produce f(t k) where k ∈ [1, 1000] ⊂ Z. The t k should be randomly chosen points
on the interval [-2, 2]. Use a different random seed than used in the previous part.
• Add columns y 1(t k) = f(t k) + n 1(t k) and y 2(t k) = f(t k) + n 2(t k) where n 1(t) ∼ N(0, 1) and
n 2(t) ∼ N(0, 5) to the dataset.
2. Solve the normal equations for this new dataset. NOTE: This dataset should be solved simultaneously
with 3 right hand sides.