HW6: MATH/CSCI XXXXXXXXXXNumerical Computing
Due by 2pm on November 8, 2022 (Tuesday)
1. (10=6+4 points) Given A ∈ Rm×n with m > n, and b ∈ Rm. Consider to solve Ax = b for x ∈ Rn.
• If Ax = b is solvable for some given b ∈ Rm, when will the solution x ∈ Rn be unique? Justify
your answer.
• Give an example of A and b, such that Ax = b is solvable yet the solution x is not unique.
2. (10 points) Given data points (x, y, z) = (0, 0, 3), (0, 1, 2), (1, 0, 3), (1, 1, 5), (1, 2, 6), find (by hand)
the plane in three dimensions (model z = c1+c2x+c3y) that best fits the data (in the least squares
sense).
3. (10 points) Fit the following data by hand, in the least squares sense, to the periodic model
y = f(t) = c1 + c2 cos 2πt+ c3 sin 2πt. Find the RMSE (refer to Section 4.1.1 and Section 4.2.1 of
the textbook).
t y
0 3
1/2 1
1 3
3/2 2
4. (12 points in total) The problem considers fitting data using the model function
g(x) = v1x
v2 , (1)
which is known as a power law function, and also as an allometric function. Assume that the data
are (x1, y1), (x2, y2), · · · , (xn, yn), where the xi’s and yi’s are positive.
i.) (3 points) Writing y = v1x
v2 , and then taking the log of this equation (namely, with base
10), show that the transformed model function can be written as
G(X) = V1 + V2X, with V1 = log(v1), V2 = v2. (2)
Also, show that the transformed data points
(Xi, Yi), with Xi = log(xi), Yi = log(yi). (3)
ii.) Strategy to fit the {(xi, yj)}ni=1 to a power law: with the transformation above, we can
fit the data to the power law model as (1) through fitting the the transformed data (3) into
the transformed model in (2) in the least squares sense. Once V1 and V2 are computed, one
can transform them back to v1 = 10
V1 and v2 = V2, and build a power law model as in (1).
(9 points) (Computer problem) Using the strategy described above, fit the data given on
next page (from Introduction to Scientific Computing and Data Analysis, by M. Holmes.
The original data can be found in LMS, under references for Week #10). What is given, fo
each animal, is its typical mass and its maximum relative speed. The latter is the animal’s
maximum speed divided by its body length. In your data fitting problem, use x as the mass,
and y as the maximum relative speed. Report the power law you find. Also, plot the data
and power law curve together, both in the original x−y coordinates as well as using a log-log
plot. You would want to use some symbol for the data.
2