Question: Problem 1 : ( 6 0 p ) Solve a system of linear equations A x = b using Gaussian elimination with and without partial
Problem : p
Solve a system of linear equations using Gaussian elimination with and without partial pivoting.
Use a matrix size of initialized with random numbers in the interval Initialize the
right hand side by computing with all values Thus the solution is in fact known.
Write your own MATLAB function that performs the initialization of and The matrix size is chosen
with the intent to make the running time long enough for a reasonably good time measurement, but not
excessively long. Use tic and toc to measure execution time.
i Write your own MATLAB function in the spirit of the pseudocode in the lecture slides from the
book that performs Gaussian Elimination without partial pivoting and apply it to solve for in
with A and generated by your code as described above. Then compute the mean squared
error MSE and the square root thereof SMSE Measure the time to compute
Do not include the time to initialize and and the time to compute the average mean
squared error and the square root thereof. Thus, only measure the time to compute
once A and are known. p
a Carry this out in single precision. Report SMSE and time. Note that by default all variables are
represented in double precision. Single precision must be specified explicitly p
b Carry this out in double precision. Report SMSE and time. p
ii Write your own MATLAB function that performs Gaussian Elimination with partial pivoting. The
coding should be at a comparable level as in aie not by using high level MATLAB function
calls Then carry out the same set of computations and measurements as in a for the same A
and Do not reinitialize A and
iii Solve using the MATLAB built in function Linsolve for the same A and as in a and b using
double precision, compute MSE and SMSE and measure the time. Report SMSE and time.
Problem p:
Write a MATLAB function that initializes the matrix such that for dots,
Initialize the vector with all values as in Problem and compute as in Problem
a Use your MATLAB function for Gaussian Elimination with partial pivoting to compute in
the MSE and SMSE and measure the time. p
i Carry this out in singleprecision and report SMSE and time.
ii Carry this out in double precision and report SMSE and time.
b Use the MATLAB Linsolve function to compute then compute MSE and SMSE and measure the
time. Report SMSE and time. p
The matrix A is known as the Hilbert matrix, which is illconditioned.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
