

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


CS 257: Numerical Methods Spring 2006 Homework, Set 6 Due Thursday March 2, 2006
(-) Start EACH PROBLEM on a SEPARATE piece of paper (This is important since we may assign each problem to a different grader). (-) Put your NETID and HW NUMBER on top of EACH PAGE clearly, e.g. ānetid: zamani hw2ā. (-) Write descriptive solutions. Comment your code! (-) Include your curves/graphs (and other supporting materials) in your write-up. (-) Donāt use handwritten code (unless you want to lose points), copy-paste your code into your write-up or attach a proper print of code to your papers. (-) Please write everything in a āportraitā style (not landscape). (-) Please number problems according to numbers presented in the homework write-up that appears on the course page, NOT according to the numbers in the textbook. (-) Please type your homework or hand-write it legibly (but yet attach a print of your codes to your handwritten stuff). (-) Show that your code works (even if the problem doesnāt explicitly asks to test your code!)
The purpose of this homework is threefold:
The required files for this assignment:
(1) Uniqueness of Solutions Show (by hand) that the system of equations:
x 1 + 4 x 2 + αx 3 = 6 2 x 1 ā x 2 + 2 αx 3 = 3 αx 1 + 3 x 2 + x 3 = 5
has a unique solution when α = 0, no solution when α = ā1, and infinitely many solutions when α = 1.
(2) Finite Precision and Gaussian Elimination Consider the following system of equations:
Solve by hand using Gaussian elimination (without pivoting) in two ways:
compute the 2-norm of the error, āx ā xāā 2 , using norm(error,2), where x is your solution and xā is the solution from Matlab. You should notice one error is larger than the other.
(3) Gaussian Elimination with and without Pivoting GEbasic.m and GEppiv.m are implementa- tions of the basic Gaussian elimination (both forward elimination and backward substitution) pre- sented in class. Test the two routines on the following matrix. With GEppiv, use a pivot tolerance of
and compare the 2-norm of the error for the basic and pivoted solutions using norm(error,2). You should notice one error is larger than the other. These routines also output the pivot at each step. What do you notice about the size of the pivots between the two cases?    
x 1 x 2 x 3 x 4
(4) The Cost of Gaussian Elimination In this problem, we will use GE.m (Gaussian elimination with- out pivoting) to investigate computational cost. We will compare the time to use:
Use the provided code, GE.m, as a base. Feel free to vary the problem size until you reach the limits of your machine. Output required: