1. Enter matrices A and b by typing and .
a) Show that Ax=b is inconsistent.( Hint: you may show this by finding or finding both rank(A) and )
b) You can enter and A'*A by typing A'*A and A'* b in MATLAB. Show that the system is a consistent system and find a solution for
c) Find the norm of the vector Ax-b by typing norm( Ax-b) where x is your solution from part (b).
i) Find a vector say , z, in column space of A by typing . compute || z -b|| by typing norm(z -b), compare this value with || Ax-b|| which one is smaller ?
ii) Find two other vectors, z, in cloumn space of A as we found z in part (i), find the norm of ||z -b|| for each of the points, z, and compare the results with || Ax-b||.
d) Is invertible?
You may check this by
i) Finding ( is it non-zero?) [Note : type det( A'* A)]
ii) Finding ( Is it an identity matrix?)[Note : type rref( A'* A)]
e) Are the columns of A linearly independent?
f) Are the rows of A are linearly independent?
g) Find a basis for the column space of A.
h) Find a basis for the row space of A.
i) How many solutions does Ax=0 have?
j) What is the number of solutions of ?
k) Find a basis for the range of the linear transformation ? ( is defined by T(x)= Ax)
l) Find a basis for the .
m) Find nullity of A , and .
n) Find rank(A), , and .
2. Recall the following theorem: If A is an matrix, then the following are equivalent:
i) Columns of A are linearly independent.
ii) is an invertible matrix.
a) Determine if the following vectors are linearly independent.
(Note: form a matrix A whose columns are the vectors , then find .
b) Determine if the following vectors are linearly independent.
3. Find an equation of the line that passes through the points ( 3,4) and (1,2).
a) Using the least square solution.
b) Using the regular way: finding slope and using slope intercept formula.
c) Did you get the same answer?
4. Consider the following set of points
(3, 4), (1,2), (-1, 1), (6,5), (7,9)
You may enter this points in a matrix by typing
then X= D(:,1) is the matrix of x-values and Y=D(:,2) is the matrix of y-values.
i) Find a polynomial of degree two , that best fits the points given above.
Help
You need to form a matrix A whose columns are square of the x values, x-values, and a column of ones. One way to do this is to type
Note: Recall that the operations .* , .^ provide element wise multiplication and raising to a power.
Now in Ax=b the vector x is
and b is the vector of y-values. So you can enter b=D(:,2).
Now you could form the system AX=b, and least square solution id the solution of the normal system .
To solve this system you may find by typing
For the rest of this problem you need to redefine the matrix A > Make sure first clear yur old variables. For example for part (ii) first column of A is the third powers of x-value, and so on.
ii) Find a polynomial of degree three, that best fits the points given above.
iii) Find a polynomial of degree four, that best fits the points given above.
iv) Find a polynomial of degree five that best fits the points given above.