Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Math 170A, Fall 2022

HOMEWORK #3

Homework problems that will be graded (Q1 - Q5, 30pts in total):

Q1.    a)  (This is the first part of Question 3.1.5 from the textbook.) Consider the following

data:

ti      1.0    1.5   2.0   2.5   3.0

yi      1.1    1.2    1.3    1.3    1.4

Set up the problem of minimization associated with least squares for a best fit line for this data.

b) Let

l 1              l    3

w1  =             ,w2  =

l 6

,  and w3  =

0

be vectors in R4 . Apply the classical Gram-Schmidt process to find an orthonor- mal basis for the subspace spanned by w1 ,w2 , and w3 .

Q2. Let A = (aij ) be a 10 × 10 positive definite matrix with Cholesky factor R = (rij ).

Suppose that a11  = 9, a12  = 12, a17  = 3, a22  = 25, and a27  = 7. Solve for r27 .

Q3. Let A be an n × n positive definite and symmetric matrix, and X an n × n invertible matrix. Show that B = XT AX is positive definite and symmetric.

Q4.  Show that the function from Rn ×n  to R given by

||A||max  =i(m)x|aij |

is not a norm by stating which of the 4 matrix norm conditions it fails to satisfy, and by demonstrating this fact via an example.

Q5. Write MATLAB functions classicalGS.m and modifiedGS.m, implementing the codes

given in class to orthogonalize the columns of a matrix A, and output the factors Q and R (Q has orthonormal columns, and R is an upper triangular matrix with positive diagonal).

Once you saved the function scripts, go back to the Command Window and type

A = hilb(8);

This makes A a particularly ill-conditioned 8×8 matrix form MATLAB’s matrix library (we will learn the concept of ill-conditioning later in the course).

Then, call

[Q1, ]   =   classicalGS(A);

[Q2, ∼]   =   modifiedGS(A);

to get the computed factors Q1 and Q2 with the classical, respectively, modified Gram- Schmidt algorithms.

Finally, let us now test the quality of the Q1 and Q2 factors. At the prompt, type norm(Q1\ ∗ Q1 − eye(8)),

followed by

norm(Q2\ ∗ Q2 − eye(8))

These commands let you know how close to orthogonal the matrices Q1, respectively Q2, are.

What do you notice?   Comment on it.   Take screenshots of the two codes and the Command Window, making sure the outputs to the last two lines are visible.