CSCI 3656 Problem Set 4 solution

$14.99

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (1 vote)

1. Write a program that:
• takes as input
– a 3 × 3 matrix A
– a three-element vector ~b
• uses Gaussian elimination — without pivoting — to find the solution ~x to the
matrix equation A~x = ~b
• prints out the augmented matrix at every step
For this problem, please write the code in python, C, C++, Lisp, Java, etc. That
is, do this from scratch, without using any linear algebra libraries or calling upon
any built-in linear algebra commands from packages like Maple, Matlab, IDL,
Mathematica, etc. (You may use those programming environments if you wish,
but do not use their built-in linear algebra stuff. One of the points of this problem
is to get you thinking about what data structures, loops, etc., you should use for
matrix problems.)
For this assignment, we would like to see both a transcript of your interaction with
the program and a copy of your code. And do remember that you need to let
us know if you worked with other class members on that code.
(a) [25 pts] Use your program to solve the following set of equations and turn in a
transcript of the session:
−11×1 + 3×2 + 3×3 = 18
−2×1 − 5×2 + x3 = −3
x1 − 10×2 + 8×3 = 5
(b) [5 pts] Use your program to solve the following set of equations and turn in a
transcript of the session:
1
0.16×1 + 0.85×2 + 0.34×3 = 0.27
−0.25×1 − 1.5×2 + 0.50×3 = −0.21
1.03×1 + 5.46×2 + 1.77×3 = 1.75
(c) [5 pts] Use your program to solve the following set of equations and turn in a
transcript of the session:
−2×1 + x2 − 4×3 = −5
7×1 − 3×2 + x3 = −2
3×1 − x2 − 7×3 = 1
2. [15 pts] Compute the condition number of the three matrices in problem 1 using
the ||.||∞ norm. What do those numbers tell you about those matrices? Does
that line up with what happened when you ran your Gaussian elimination code on
them?
3. [15 pts] Solve the system in problem 1(b) by hand using Gaussian elimination
with partial pivoting. (You’re welcome to modify your code from problem 1 to do
pivoting in order to check your answers, but it’s worth knowing how to do these
kinds of problems by hand — e.g., for the hour exams.) Do you get the same
answer with and without pivoting? Why or why not?
4. [15 pts] Write down the PA=LU factorization of the system in problem 1(b) and
use those factors to solve this system:
0.16×1 + 0.85×2 + 0.34×3 = 0.27
−0.25×1 − 1.5×2 + 0.50×3 = −0.21
1.03×1 + 5.46×2 + 1.77×3 = 1.75
Do this by hand, in the most efficient way possible. Please show your work, and
be neat enough that we can follow what you’re doing. To finish off this problem,
please explain why LU factorization is a good idea—i.e., what is the advantage of
doing it? In what situation, for example, is that a Good Thing?
5. [5 pts] What is the difference between Jacobi and Gauss-Seidel, in terms of the way
they work? Which one converges faster? Why?
2