MATH 240 Spring 2019 MATLAB Project 3 – due in class Tuesday, 4/9
Directions:
There are no new commands to learn for this project. Please review old commands as needed.
Previous guidelines on format and collaboration hold. Please review them if you forget them. For this project, do problem 1 in format short and do the rest in format rat.
As before, a question part marked with a star ⋆ indicates the answer should be typed into your output as a comment – the question isn’t asking for MATLAB output.
0. Review all directions and rules from the previous project. Then enter the command clock.
1. Do #36 on p. 226 of the textbook.
2. (Use format short) Consider the set of functions
1, cos t, cos2 t, cos3 t .
We can view this set as a set of vectors in the vector space C(R) of all continuous real-valued functions whose domain is R. We would like to show that this is a linearly independent set in C(R). This means that if x1, x2, x3, x4 are scalars such that
(∗) x1(1) + x2 cos t + x3 cos2 t + x4 cos3 t = 0 (for all t),
then we must have x1 = 0, x2 = 0, x3 = 0, x4 = 0. Essentially we are trying to disprove the existence of a linear relation relating these four functions to each other. More concretely, we are trying to prove that no identity such as
3 + 4 cos t − 7 cos2 t + 1 cos3 t = 0 2
could possibly exist.
(a) Each substitution of a number for t in the equation (∗) produces a linear equation in the four variables x1 , x2 , x3 , x4 . By plugging in t = 0, 0.1, 0.2 and 0.3, you get four linear equations for the four unknowns. Define the coefficient matrix A for this linear system in MATLAB.
(b) Note that a nontrivial solution x to (∗) is automatically a nontrivial solution to Ax = 0. However, if A is invertible, then Ax = 0 has no nontrivial solutions. This implies that the equation (∗) has no nontrivial solutions. Compute rref(A) and det(A).
(c) ⋆ Very briefly explain why each of the last two computations show A is invertible.
(d) It is reasonable to be suspicious of the very small value of det(A) in the last step – could this be roundoff error, with the actual det(A) being zero? Do a check by repeating the computation with the more spread out inputs t = 0, .2, .5, 1, to see det(A) large enough to eliminate that suspicion.
(e) ⋆ Now consider the set of functions {1, sin2 t, cos2 t}. (Here 1 denotes the constant function whose value is always 1.) Explain why this set of functions is linearly dependent. (Hint: Do you know any identities that relate these three functions?)
(f) (Optional – don’t have to turn in) Explore what happens if you try to use the techniques of the previous parts on the set {1, sin2 t, cos2 t}.
3. Do #34 on p. 232 of the textbook. 02181
4. (Use format rat) Let A = −9 −10 13 11 −2. −3 −4 4 1 −1
−6 −4 10 18 0
(a) Compute rank A. (The MATLAB command is rank(A).)
(b) ⋆ Use the rank to determine the values dim(Nul A), dim(Col A), and dim(Row A).
(c) Compute rref(A) and use it to give a basis for
i. NulA ii. ColA iii. RowA
5. Consider the polynomials
p1(t)=3+5t+5t3, p2(t)=1+t+2t2 +3t3, p3(t)=3+4t+3t2 +7t3,
p4(t) = 1+2t−t2 +t3, p5(t) = 5−3t+t2 +8t3, which are all elements of the vector space P3. We shall investigate the subspace
W = Span{p1(t), p2(t), p3(t), p4(t), p5(t)}.
(a) Let vi = [pi(t)]E , the coordinate vector of pi(t) relative to the basis E = {1, t, t2, t3} for P3. Enter
these coordinate vectors into MATLAB as v1, v2, v3, v4, v5.
(b) Let A be the matrix v1 v2 v3 v4 v5. Observe that Span{v1, v2, v3, v4, v5} = Col(A). Use this fact to compute a basis for Span{v1, v2, v3, v4, v5}. (Recall you can enter A into MATLAB as A = [v1 v2 v3 v4 v5].)
(c) ⋆ Translate your previous answer into a basis for W (consisting of polynomials). What is dim W ?
(d) ⋆ Is W = P3? Justify your answer.
6. Consider the following four matrices from the vector space M2×3 of all 2 × 3 matrices: −2−10 1 2 −3 2 1 −4 2−2−12
A1 = 4 5 2 , A2 = 4 −2 2 , A3 = 0 −3 0 , A4 = 2 3 1 . (a) Let vi denote the coordinate vector [Ai]E relative to the basis
1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 E=000,000,000,100,010,001.
Enter the coordinate vectors for A1, A2, A3, A4 into MATLAB.
(b) Use MATLAB to show that the coordinate vectors v1, v2, v3, v4 are linearly dependent.
(c) ⋆ Express one of the matrices Ai as a linear combination of the other three. (Hint: first do the same for the coordinate vectors.)
7. (Optional – You do not have to turn this problem in. It is based on material in section
4.7, which we will not finish until too close to the due date of this project.)
Let [x]B denote the coordinate vector of x with respect to a basis B. For bases B and C, P denotes C←B
the change of coordinates matrix, which has the property that P [x]B = [x]C. It follows that C←B
−1 P=P.
B←C C←B
Also, if we have three bases B,C, and D, then
PP=P. D←C C←B D←B
Each of the following three sets is a basis for the vector space P3:
E = {1, t, t2, t3} ,
B={1, 1+2t, 2−t+3t2, 4−t+t3} , and
C={1+3t+t3, 2+t, 3t−t2+4t3, 3t} .
(a) ComputethematricesP = P andQ= P . E←B E←C
(b) Use P and Q and the properties above to compute R = P . C←B
(c) Compute the C coordinate vector of the polynomial t3. 0
2
(d) Suppose p(t) is the polynomial for which [p(t)]B = 3. Compute the coordinate vector [p(t)]C.
1