Professional Documents
Culture Documents
System of Linear Equations - Problem Sheet - 1
System of Linear Equations - Problem Sheet - 1
Problem Sheet - 1
Instructions:
• Don’t use linalg.inv(), linalg.dot() and linalg.solve() methods in python
numpy library.
0 0 0 0 0
1 −7 5 5
(b)
0 1 3 2
1 2 3 4 5
1 0 7 1 3
(c)
0 0 0 0 1
0 0 0 0 0
1 2 3
0 0 1
(d)
0 0 0
0 0 0
3. Write a python program for Gauss-Jordan Elimination method to find
the RREF of the following matrices. Also print the given matrix and
its RREF and rank?
0 3 −6 6 4 −5
(a) 3 −7 8 −5 8 9
3 −9 12 −9 6 15
1 1 1 6
(b) 2 −1 1 3
1 0 1 4
1 3 4 7
(c) 2 4 6 8
3 6 9 12
0 1 −2 3
(d)
1 −3 4 −6
1 −3 7 1
(e) 0 1 4 0
0 0 0 1
1 1 1 8
(f) −1 −2 3 1
3 −7 4 10
4. Write a python program to find solutions for the following linear system
using Gauss-Jordan elimination method. If its has unique solution,
print the solution. If it has infinite solution, print the infinite solution
in set form. If it has no solution, print no solution, rank of A and
[A : B].
x1 + x2 + 2x3 = 8
(a) −x1 − 2x2 + 3x3 = 1
3x1 − 7x2 + 4x3 = 10
2x1 − 3x2 + 4x3 − 4x4 = 0
(b) 7x1 + x2 − 8x3 + 9x4 = 0
2x1 − 8x2 + x3 − x4 = 0
2x1 − x2 + 3x3 − 4x4 = 9
x1 + x2 − 2x3 + 7x4 = 11
(c)
3x1 − 3x2 + x3 + 5x4 = 8
2x1 + x2 + 4x3 + 4x4 = 10
5. Write a python program to solve the following linear system using
Gauss-Seidel Method. Also print the initial values, the iteration ta-
ble and final solution.
4x1 + x2 + x3 = 2
(a) x1 + 5x2 + 2x3 = −6
x1 + 2x2 + 3x3 = −4
2x + 5y = 21
(b)
x + 2y = 8
2x + 3y − z = 5
(c) 3x + 2y + z = 10
x − 5y + 3z = 0
6. Write a python program to solve the following linear system using
Gauss-Jacobi Method. Also print the initial values, the iteration table
and final solution.
4x1 + x2 + x3 = 2
(a) x1 + 5x2 + 2x3 = −6
x1 + 2x2 + 3x3 = −4
2x + 5y = 21
(b)
x + 2y = 8
2x + 3y − z = 5
(c) 3x + 2y + z = 10
x − 5y + 3z = 0
7. Write python program to solve all above problems using any python
library methods. like linalg.inv(), linalg.dot() and linalg.solve()
methods in python numpy library. linsolve() method in python sympy
library