Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

MATLAB QUESTION *I would greatly appreciate it if you can give me the matlab cod

ID: 3592971 • Letter: M

Question

MATLAB QUESTION

*I would greatly appreciate it if you can give me the matlab codes. This is for my intro to linear algebra course. *

PLEASE ONLY DO PART c,d (a,b are posted on a different question) thank you! :)

6. (Use format short) Consider the set of functions {1, cos t, cos2 t, cos3t). We would like to show that this is a linearly independent set of functions. This means that if ^1,x2, x3, 4 are scalars such that (*) x1(1) + z2 cost+13 cos2 t + z4 cos30 (for all t), then we must have x1 = 0,22 = 0,23 = 0,24 = 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 could possibly exist. (a) Each substitution of a number for t in the equation (*) produces a linear equation in the four variables 1, x2, X3, Tt4. 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.

Explanation / Answer

c) As we have seen that rref(A) is an indentify matrix and we know that A is invertible is equivalent to rref being an identity matrix. Hence this shows that A is invertible.

d) As we have seen that A is invertible and hence its determinant can not be zero and hence its not a round off error and determinant is actually non zero

% part a, defining coeficient matrix A
A = [
1 cos(0) cos(0).^2 cos(0).^3;
1 cos(0.2) cos(0.2).^2 cos(0.2).^3;
1 cos(0.5) cos(0.5).^2 cos(0.5).^3;
1 cos(1) cos(1).^2 cos(1).^3
]
  

% computing rref of A
rrefMat = rref(A)

% computing dterminent of A   
detA = det(A)

These new values gives determinant

And hence det(A) is not zero