Skip to content

MFDS Assignment 1#

Tasks#

Q1) Write code to implement the Gaussian elimination with partial pivoting for the system \(An×nx = b\). Include a statement in the code to indicate the swapping of rows. Using the code

  • draw the \(log−log\) plot of \(n\) versus the time taken for forward elimination and backward substitution (as separate graphs) by taking values of in-between \(1000\) and \(10000\) in steps of \(1000\). Determine the time taken for a single computation in your machine (by averaging over \(1000\) runs) and compare the time taken with the actual time derived in the class. This should give the time taken for the partial pivoting.

  • solve the system \(A5×5x = b\), with random entries and display your results.

Q2) Gauss Jordan method To find the inverse of a non-singular matrix \(A\) by Gauss Jordan method, one starts with the augmented matrix \([A|I]\) where \(I\) is the identity matrix of the same size and performs elementary row operations on \(A\) so that \(A\) is reduced to \(I\). Performing the same elementary operations on \(I\) would give \(A−1\). Assuming that \(Am×m\) is an invertible matrix, write a code to find the inverse of \(A\) using the Gauss Jordan method. Using the code, find the inverse of a \(6 x 6\) random matrix which is non-singular.

My Submission#

  • The actual Assignment can be found here
  • The code along with the metrics collected can be found here

tags: !MathematicalFoundationsIndex Assignments