0% found this document useful (0 votes)
82 views

COMSATS University, Islamabad: Islamabad Campus Department of Computer Science

This document contains instructions for Assignment 2 on solving systems of linear equations. It includes 7 questions covering various methods for solving systems of linear equations numerically, including Gaussian elimination, LU decomposition, Gauss-Jordan elimination, Jacobi iteration, and Gauss-Seidel iteration. Students are instructed to complete the assignment individually and submit their work by November 4, 2020 for grading.

Uploaded by

Ahmed Bashir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views

COMSATS University, Islamabad: Islamabad Campus Department of Computer Science

This document contains instructions for Assignment 2 on solving systems of linear equations. It includes 7 questions covering various methods for solving systems of linear equations numerically, including Gaussian elimination, LU decomposition, Gauss-Jordan elimination, Jacobi iteration, and Gauss-Seidel iteration. Students are instructed to complete the assignment individually and submit their work by November 4, 2020 for grading.

Uploaded by

Ahmed Bashir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

COMSATS University, Islamabad

Islamabad Campus
Department of Computer Science

Read before Attempt


Assignment No. 2: Solution of System of Linear equation
Course code and Title: CSC475, Numerical Computing
Instructor: Tanveer Ahmed
Assigned Date: October 23,2020 Due Date: November 4,2020
Total Marks: -- CLO-3:
Instructions:
1. This is an individual assignment. You will submit your work individually through your logins
(course portal)
2. Try to get the concepts, consolidate your concepts and ideas from these questions
3. You should concern recommended books for clarify your concepts as handouts are not
sufficient.
4. Try to make solution by yourself and protect your work from other
students. If I found the solution files of some students are same, then I will
reward zero marks to all those students.
5. Deadline for this assignment is November 4,2020. This deadline will not be extended.

Question # 1
Determine the values of a for which the system has
i. No solutions,
ii. Exactly one solution,
iii. Infinitely many solutions.

x + 2y + z = 2
2x - 2y + 3z = 1
x + 2y - (a2 - 3)z = a
Question # 2
a) Do the three straight lines x1 - 4x2 = 1, 2x1 - x2 = -3, -x1 - 3x2 = 4 have the same intersection point?
Explain your answer.
b) Check if (3; 4; -2) is a solution of the following system.

FA2020 Page 1
c) Determine whether the following systems are consistent or not:

d) Consider the following matrix to be an augmented matrix of a linear system. Express in your own
words the next elementary row operation to perform in the solving process of the system.

Question # 3
Assume that the augmented matrix of a linear system has been transformed into the following matrix by
elementary row operations. Continue the solving process and describe the solution set of the original system.

Question # 4
Suppose we have a 3 x 3 lower-triangular L matrix of the form

i. When you do the usual Gaussian-elimination steps on L, what matrix do you get?
ii. When you do the same elimination steps to I, what matrix do you get? Write the answer in terms of L.
iii. When you apply the same steps to a matrix A = LU, what matrix do you get? Write your answer in
terms of L, U, and/or A).
Question # 5
a) Solve the following system of linear equations using:
i. Naïve Gauss elimination method.
ii. Gauss elimination with Partial Pivoting
iii. Gauss elimination with Complete Pivoting
iv. Justify which method you prefer for solving given system

FA2020 Page 2
b) Develop, debug, and test a program in either a high-level language of your choice to solve a system of
linear equations with Gauss elimination with partial pivoting. Test the program using the above
systems.
Note: Show all steps of the computation (carry four significant figures during the computation). Give reasons
for any interchange you made (both in partial pivoting and complete pivoting). Verify your answers by
substituting the solution back in the given equations.
Question # 5
a) Consider the following Gaussian-elimination-Gauss-Jordan hybrid method for solving the following
system.

First, apply the Gaussian-elimination technique to reduce the system to triangular form. Then use the n th
equation to eliminate the coefficients of xn in each of the first n − 1 rows. After this is completed use the (n
−1)st equation to eliminate the coefficients of xn−1 in the first n − 2 rows, etc. The system will eventually appear
as:

Solve the system of linear equations given in question 5 using:


i. Gauss-Jordan method discussed in class lecture. Use two-digit rounding arithmetic to solve the
system
ii. Use the hybrid method described above. Use two-digit rounding arithmetic to solve the system.
b) In general, how many multiplications are made by this method in solving a system of n equations in n
unknowns?
c) How does this compare with the number of multiplications made by the Gauss-Jordan?
d) Develop, debug, and test a program in either a high-level language of your choice to solve a system of
linear equations with hybrid method described above. Test the program using the given system.
Question # 6

FA2020 Page 3
Consider the following decomposition method for solving systems of linear equations:

Step 1: Compute Lower triangular Matrix L as:

Where mij are pivot row multipliers of the Gauss elimination.


Step 2: Now solve the system AX = B as follows:
LAX = LB
UX = B’ (LA = U and LB = B’)
U matrix will allow the computation of the solution vector elements of X using back substitution.
Solve the following system using:
a) Crout LU decomposition method.
b) Using above method.

Question # 7
Consider the following system of equations
−x1 + 4x2 – x4 = 1.3
–x2 –x3 + 4x4 = 1.8
–x1 + 4x3 – x4 = 1.0
4x1 − x2 − x3 = 0.5
¿ ¿ ¿ ¿
which has the exact solution: x 1=0.4125 , x2 =0.6125 , x 3=0.5357 , x 4 =0.7375
a) Use 5 iterations of the Jacobi method to find an approximate solution, x(5)1 , x 2 , x 3 , x 4 . For the first
(5) (5 ) (5)

guess of the solution, take the value of all the unknowns to be zero.
b) Calculate the error of this approximation using the formula:

c) Use 5 iterations of the Gauss-Seidel method to find an approximate solution, x(5) (5) (5 ) (5)
1 , x 2 , x 3 , x 4 . For the
first guess of the solution, take the value of all the unknowns to be zero.
d) Calculate the error of this approximation using the formula:

e) Which one is faster? justify your answer.

FA2020 Page 4
FA2020 Page 5

You might also like