Hints
- Homework 1. No comments.
- Homework 2. No comments.
- Homework 3. No comments.
- 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.
- A[i][i] =1 if i is not equal to n.
- A[i][j] =0 if i < j < n.
- A[i][j] =(-1)**(i+j-1) if i > j or j is equal to n.
- Second example of a matrix (i,j=1...n) A[i][j] = |i-j|. This is the absolute value!
- Third example of a matrix (i,j=1...n) A[i][j] = n-|i-j|. And so is it!
- Fourth example of a matrix (i,j=1...n) A[i][j] = max(i,j).
-
- Homework 4.
- Homework 5.