MAT 2550 -- Mathematica Homework 1 (sections 1.4, 1.5, 1.6)
Your Name Goes Here  No name = No credit!!

Text will be in read, Mathematica input will be in black.  Remember that Mathematica commands are executed by using Shift-Enter.   Save the notebook then submit it through the D2L dropbox.  Due date --- TBA.

First let’s build a 5x5 matrix.

MatrixForm[A={{3,4,9,6,7},{0,7,1,6,5},{-1,4,2,-2,0},{0,7,-5,3,0},{2,1,6,0,-5}}]

You can check to see if A has an inverse by row-reducing it and see if you get to the Identity.  For this example, A will row reduce to the Identity matrix.

MatrixForm[RowReduce[A]]

You can find the inverse by creating a large augmented matrix of the form [ A | I ]:

MatrixForm[Join[A,IdentityMatrix[5],2]]

and reducing that to [ I | A^(-1) ]:

MatrixForm[RowReduce[Join[A,IdentityMatrix[5],2]]]

You should know how to do the previous step by hand,  although Mathematica has a built-in Inverse command:

MatrixForm[Inverse[A]]

Now take a random vector of constants, call it b, and consider the matrix equation A.x=b.

MatrixForm[b=Transpose[{{0,-3,5,2,1}}] ]
MatrixForm[Join[A,b,2]]

Since A is invertible, this system will have a unique solution vector x, no matter what b is chosen.  
You have two ways of solving for x=(x1,x2,x3,x4,x5).  
1. RREF the augmented matrix [A | b]:

MatrixForm[RowReduce[Join[A,b,2]]]

2. Multiply the inverse matrix of A with b.  If A does not have an inverse, then you will have to resort to solve by 1.

MatrixForm[x=Inverse[A].b]

Do all of the above steps again (if possible) for:
1. M and u
2. M and v
3. K and v
For each of the three sets above, determine whether the linear system is consistent or inconsistent.  If the system is consistent, state what the solution(s) are, you can write it here.


4. Find the determinant for A, M and K and state whether the determinant is zero or nonzero.  There is a built in function Det[].  How does this compare with the fact that the matrix is invertible or not?  Write answer here.

M={{1,2,-1,4,-2,2},{2,0,2,0,4,1},{1,-1,1,-1,3,1},{3,3,4,2,4,3},{1,1,3,-1,3,1},{4,2,0,6,2,2}}
K={{1,0,-1,4,-2,2},{2,0,1,0,4,1},{1,-1,1,-1,3,1},{3,3,4,2,4,3},{1,1,3,-1,-3,1},{4,1,0,6,2,2}}
u=Transpose[{{2,1,-1,3,5,0}}]
v=Transpose[{{-5,25,14,36,22,22}}]