1 Number of Operations (25 Points)
1 Number of Operations (25 Points)
n3 3 5
+ n2 − n multiplications/divisions (2)
3 2 6
and
n3 n2 5
+ − n additions/subtractions. (3)
3 2 6
b. Make a table comparing the required operations for the Gaussian elimination, Gauss-Jordan, and
hybrid methods, for n = 3, 10, 50, 100.
B. Gauss Elimination
Suppose m linear systems
AX = B (4)
are to be solved, where A is an n × n matrix and both X and B are n × m matrices.
a. Show that Gaussian elimination with backward substitution applied to the augmented matrix
[A B] (5)
requires
1 3 1
n + mn2 − n multiplications/divisions (6)
3 3
and
1 3 1 1
n + mn2 − n2 − mn + n additions/subtractions. (7)
3 2 6
b. Show that the Gauss-Jordan method requires
1 3 1
n + mn2 − n multiplications/divisions (8)
2 2
and
1 3 1
n + (m − 1)n2 + − m n additions/subtractions. (9)
2 2
1
EP501 Numerical Methods Homework 3 Due Oct 11, 2013 11:59 pm
−2x1 + 3x2 + x3 = 9
3x1 + 4x2 − 5x3 = 0 (10)
x1 − 2x2 + x3 = −4
by
a. Gauss elimination without pivoting
b. Gauss-Jordan elimination
c. Doolittle LU factorization
Do all calculations manually, without calculator or MATLAB. Write out every step of the process, follow
the examples in Lecture06 and Lecture07.
Matlab provides the Frank matrix in its “gallery” of matrices, gallery(’frank’,n), where n is the size of
the Frank matrix. The Frank matrix is ill-conditioned. Solve the following problems for n = 5, 10, 15, 25,
with x = (1, 1, · · · , 1), and with A being the Frank matrix.
a. Compute
b = Ax, (12)
then solve x0 with
Ax0 = b, (13)
0
and calculate the difference between x and x . You will need to write your own MATLAB function for
Gauss elimination or any direct methods we discussed in class to solve (13).
b. Calculate the condition number of A. To do this you need the inverse of A. You can use the MATLAB
function inv() to get A−1 . Choose any definition of norm and write MATLAB code to calculate the
norm. Do not use MATLAB functions norm() and cond() to calculate the norm or condition number,
but you can use them to verify your results.
c. Create a table like the following to summarize the results for the four different n values, by listing the
maximum error max |x − x0 |, and condition number for each n.
n max |x − x0 | cond(A)
5
10
15
25
2
EP501 Numerical Methods Homework 3 Due Oct 11, 2013 11:59 pm
x31 − 2x1 x2 + x3 = 0,
x1 x22 − x1 x3 − 5 = 0, (14)
−x1 + x2 x3 + x33 = 0.
a. Read page 169-171 of the textbook on how to solve such a nonlinear system of equations.
b. Derive the linear system equations similar to (3.170) in the textbook. Start with initial approximation
x = (x1 , x2 , x3 ) = (1, 0, −1), write down the the linear equations which must be solved to find ∆x. Your
answer should be in the form Ax=b.
c. Use iterative method (3.171) to solve the equations, starting with the initial approximation given above.
Stop the iteration when k∆xk2 < 10−12 , where kk2 is the Euclidean norm, which can be calculated in
MATLAB using the norm function.
d. Based on the error plot, describe the convergence rate of this iteration, but you don’t have to explain
why.