Hints

  1. Homework 1. No comments.
  2. Homework 2. No comments.
  3. Homework 3. No comments.
  4. Homework 500 point problem. If you want to test your code, make sure you test it with a reasonably nonsingular matrix. There is a hint somewhere in the notes how to deal with singularity. A matrix whose elements are reasonably small and i used once to check LU decomposition code is the code/matrix given in the problem statement. Alternatively, you can use the following "sample" matrix of dimension $n$. Its inverse has lots of 1/2**k. (Note: indices for matrices start from 1 and grow to n). Other examples include the Vandermode matrix (see textbook Lagrange chapter). Linear Algebra books have examples of matrices with known inverses; you could use them for testing as well.
    1. A[i][i] =1 if i is not equal to n.
    2. A[i][j] =0 if i < j < n.
    3. A[i][j] =(-1)**(i+j-1) if i > j or j is equal to n.
    4. Second example of a matrix (i,j=1...n) A[i][j] = |i-j|. This is the absolute value!
    5. Third example of a matrix (i,j=1...n) A[i][j] = n-|i-j|. And so is it!
    6. Fourth example of a matrix (i,j=1...n) A[i][j] = max(i,j).
  5. Homework 4.
  6. Homework 5.