1. Unit-2 SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
RAI UNIVERSITY, AHMEDABAD 1
Course: MCA
Subject: Computer Oriented Numerical
Statistical Methods
Unit-2
RAI UNIVERSITY, AHMEDABAD
2. Unit-2 SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
RAI UNIVERSITY, AHMEDABAD 2
Unit-II-Solution of simultaneous Linear Equations
Sr.
No.
Name of the Topic Page
No.
1. Introduction, System of linear equations in two variable Methods
for solving linear equation,
2
2. Existence of Unique roots, multiple roots and no roots (consistency
and Inconsistency of system), Dependent and Independent system
of linear equations, Examples
2
3. System of linear equations in three variables, System of linear
equations in n-variables
7
4. Methods for solving system of linear equations 9
5. Gauss elimination method and its examples 9
6. Gauss Seidel method and its examples 13
7. Difference between Direct Method and Iterative Method 16
8. References 17
9. Exercise 18
3. Unit-2 SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
RAI UNIVERSITY, AHMEDABAD 3
1.1 Introduction:
We are already familiar with solving linear equations of one variable and two
variables. The general form of linear equation of one variable is ax + b = 0 where
a is not 0 and a and b are real numbers, and the general form of linear equations of
two variables is
ax + by + c =0 where a, b and c are real numbers. In this section let us discuss with
system of linear equations.
1.2 What is a system of linear Equations?
1.2.1 Definition:System of Linear Equations
Linear Equations in one variable: The general form of linear equation in one
variable is ax + b = 0, where a and b are Real numbers and a is not equal to 0.
This system has unique solution, which is x = - b/a
For example : 2x + 6 = 0
=> 2x = -6
= > x = - 6/2 = - 3 π₯ =
βπ
π
The only solution to this equation is x = - 3
This solution can be represented on a number line.
2.1 System of linear Equations in two variables:
The general form of linear equation in two variables is ax + by +c = 0, where
a, b, c are real numbers and a and b bothnot equal to 0.
Let us consider the example x + y = 6
This equation will satisfy for infinitely many pairs of the form (x,y) satisfying this
condition.
For example (1,6), 2,4), (3,3), (7, -1),.........etc
so that in all the cases x + y = 5, meaning the sum of the coordinates = 6
Hence these pairs of values satisfying the given equation are called the solution to
the given equation.
4. Unit-2 SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
RAI UNIVERSITY, AHMEDABAD 4
2.2 System of linear Equations Solver:
Step-1. For the linear equations of one variable, there will be unique solution
which can be solved from the given equation.
Step-2. For the linear equations of two variables, we need to have two equations to
solve for the variables.
Let us assume that the given two equations are of the form
a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0.
It is possible to solve the system of linear equations for the unknown variables x
and y.
The methods involved in solving these homogeneous systems of linear equations
are,
1. Substitution Method.
2. Elimination Method.
3. Cross Multiplication Method
4. Matrix Method etc.
To solve a system of linear equations we should know about the types of
solution(s) that exists for the system.
2.3 Consistentsystemof linear equations: (Unique Roots, Infinite Roots)
The system of linear equations is said to be consistent if the solution exists.
For the above system of equations, if the following ratio satisfies we can say about
the type of solutions accordingly.
If
π1
π2
β
π1
π2
then the system has unique solution.
If
π1
π2
=
π1
π2
=
π1
π2
then the system has infinite solution.
2.4 InconsistentSystem of Equations: (No roots)
The system of linear equations is said to be inconsistent if the solution
does not exists.
For the above system of equations, if the following ratio satisfies then we can say
that the system is inconsistent
5. Unit-2 SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
RAI UNIVERSITY, AHMEDABAD 5
If
π1
π2
=
π1
π2
β
π1
π2
2.5 Dependent systemof Linear Equations:
System of Linear Equations is said to be dependent if both the equations have
infinitely common solutions.
So the coinciding lines are the dependent system of linear equations.
They satisfy the condition,
π1
π2
=
π1
π2
=
π1
π2
2.6 Independent system of Linear Equations:
System of Linear Equations is said to be independent if they do not
have infinite number of common solution.
So the intersecting lines and the parallel lines are the Independent system of Linear
Equations.
2.7 Solving systemof linear equations:
While solving a system of linear equations, we will come to know if they are
consistent or inconsistent, dependent or independent.
System of Linear Equations Examples:
2.7.1 Exampleβ
Solve the systemof linear equations: ππ + ππ = ππ; ππ + ππ = ππ
Solution:
Let us number the equations
2π₯ + 3π¦ = 25 ------------------------------(1)
3π₯ + 2π¦ = 25 ------------------------------(2)
Multiplying Equation (1) by 3, 3 ( 2π₯ + 3π¦ ) = 3 ( 25)
6π₯ + 9π¦ = 75 --------------------(3)
Multiplying equation (2) by 2, 2 ( 3π₯ + 2π¦ ) = 2 ( 25)
6π₯ + 4π¦ = 50 -----------------------------(4)
6π₯ + 9π¦ = 75 ------------------------------(3)
6π₯ + 4π¦ = 50 ------------------------------(4)
______________
6. Unit-2 SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
RAI UNIVERSITY, AHMEDABAD 6
Subtracting (4) from (3) 5π¦ = 25
π¦ = 25 /5 = 5
Substituting y=5 in (1) we get, 2π₯ + 3(5) = 25
2π₯ + 15 = 25
2π₯ = 25 β 15 = 10
π₯ = 10/2 = 5
Therefore, the two equations intersect at the point (2,2).
Hence the system of equations is consistent and independent.
If we verify the condition,
π1
π2
β
π1
π2
, we see that,
2
3
β
3
2
2.7.2 Exampleβ
Solve the System of linear equations: π + π = π, ππ + ππ = π
Solution:
Let π₯ + π¦ = 4 ---------------------(1)
2π₯ + 2π¦ = 9 ------------------- (2)
Multiplying (1) by 2, we get,
2 ( π₯ + π¦ ) = 2(4)
=> 2π₯ + 2π¦ = 8 -------------------(3)
2π₯ + 2π¦ = 9 --------------------(2)
Subtracting , (2) from (3), we get, 0 = 1, which is not true.
Hence the system of equations have no solution.
From the above relation,
π1
π2
=
π1
π2
β
π1
π2
we have
1
2
=
1
2
β
4
9
Hence the above pair of equations is inconsistent and
independent.
7. Unit-2 SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
RAI UNIVERSITY, AHMEDABAD 7
2.7.3 Exampleβ
Solve the system of linear equations: π + ππ = π ; ππ + ππ = ππ
Solution:
Let π₯ + 3π¦ = 8 ---------------------(1)
3π₯ + 9π¦ = 24 ------------------ (2)
Substituting π₯ = 8 β 3π¦ in (2), 3 ( 8 β 3π¦ ) + 9π¦ = 24
=> 24 β 9π¦ + 9π¦ = 24
This condition is true for all values of y.
we get 24 = 24 which is true.
Therefore the system of equations has infinitely many solutions.
Hence the system is consistent and dependent Hence by solving system of
equations we can conclude if the system of linear equations is consistent or
inconsistent and independent or dependent.
2.8 System of Linear Equations word problems:
We can follow the following steps while solving the word problems.
Step 1: Read the problem carefully and identify the unknown quantities. Give
these quantities a variable name like π₯, π¦, π’, π£, π€, etc.
Step 2: Identify the variables to be determined.
Step 3: Read the problem carefully and formulate the equations in terms of the
variables to be determined.
Solve 4: Solve the equations obtained in step 3, using any one of the method you
are comfortable with.
2.8.1 Exampleβ
4 Chairs and 3 tables cost1400 dollars and 5 chairs and 2 tables cost1400
dollars. Find the costof a chair and a table.
Solution:
Let the costof a chair be x dollars, and the costof a table be y dollars.
8. Unit-2 SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
RAI UNIVERSITY, AHMEDABAD 8
Let us solve linear system of equations we have framed here.
Hence we have the equations, 4π₯ + 3π¦ = 1400 ---------------------(1)
5π₯ + 2π¦ = 1400 ---------------------(2)
Multiplying (1) by 5, 5( 4π₯ + 3π¦ ) = 5( 1400)
=> 20 π₯ + 15 π¦ = 7000------------------------(3)
Multiplying (2) by 4, we get 4 ( 5π₯ + 2π¦ ) = 4 ( 1400)
=> 20 π₯ + 8 π¦ = 5600 ----------------------(4)
20 π₯ + 15 π¦ = 7000----------------------(3)
______________________
Subtracting (3) from (4), β 7 π¦ = β1400
=> π¦ = β1400/β7 = 200
Substituting y= 200 in Equation (1), we get,
4π₯ + 3 ( 200) = 1400
=> 4π₯ + 600 = 1400
=> 4π₯ = 1400 β 600 = 800 =
> π₯ = 800/4 = 200
Therefore costof a Chair is 200 dollars and costof a Table is 200 dollars.
3.1 System of linear equations in three variables:
The general form of linear equation in three variables, π₯, π¦ πππ π§is
ππ₯ + ππ¦ + ππ§ + π = 0, where a, b, c are real numbers and a, b, c not all equal
to 0.
This represent the equation of a plane in three-dimensional co-ordinate system,
where π, π, π are the direction ratios of the normal to the plane.
To solve the equation in three variables, we need to have three conditions
(equations) relating the variables π₯, π¦ πππ π§.
Elimination method is the most suitable method to solve the equations.
9. Unit-2 SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
RAI UNIVERSITY, AHMEDABAD 9
3.2 System of Linear equations with n variables
π11 π₯1 + π12 π₯2 + β―β¦ β¦+ π1π π₯ π = π1
π21 π₯1 + π22 π₯2 + β―β¦ β¦+ π2π π₯ π = π2
β¦β¦β¦β¦β¦ β¦β¦β¦β¦β¦β¦β¦ β¦β¦β¦β¦β¦β¦..
π π1 π₯1 + π π2 π₯2 + β―β¦ β¦+ π ππ π₯ π = π π
We can also write it in Matrix form as
[
π11 π12 β¦β¦. π1π
π21 π22 β¦β¦. π2π
β¦β¦ . . β¦β¦ β¦β¦ β¦β¦. .
π π1 π π2 β¦β¦ π ππ
] [
π₯1
π₯2
β¦
π₯ π
] = [
π1
π2
β¦
π3
]
βΉ π΄π = π΅
πΆ = [ π΄, π΅] = [
π11 π12 β¦ β¦. π1π
π21 π22 β¦β¦. π2π
β¦β¦ .. β¦β¦β¦ β¦ β¦ β¦. .
π π1 π π2 β¦β¦ π ππ
]is called augumented matrix.
[ π΄: π΅] = πΆ
3.2.1 (π) ConsistentEquations:
If Rank A = Rank C
(i) Unique Solution: Rank A= Rank C=n Where, π = number of
unknown
(ii) Infinite Solution: Rank A= Rank C= r, π < π
3.2.2 (π) InconsistentEquations:
If Rank π΄ β Rank πΆ.
10. Unit-2 SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
RAI UNIVERSITY, AHMEDABAD 10
4.1. There are two types of methods for solving System of Linear equations:
A. Direct Methods
B. Iterative Methods
4.2 DirectMethods Of Solution:
1. Gauss elimination Method
2. Gauss -Jordan Method
3. Factorization method
4.3 Iterative Methods:
1. Jacobiβs iteration Method
2. Gauss - Seidel iteration Method
3. Relaxation Method
Here we discuss only 1st method gauss elimination.
5.1 Gauss elimination Method:
In this method, the unknowns are eliminated successively and the system is
reduced to an upper triangular system from which the unknowns are found by back
A system of non-homogeneous linear equations
AX=B
if R(A)=R(C)
solution exists
systemis consistant
if R(A)=R(C)=n
systemhas unique
solution
if R(A)=R(C) less than n
InfiniteSolution
if R(A)# R(C)
solution does not exist
systemis inconsistant
11. Unit-2 SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
RAI UNIVERSITY, AHMEDABAD 11
substitution. The method is quite general and is well-adapted for computer
operations. Here we shall explain it by considering a system of three equations for
the sake of clarity.
Consider the equations
π1 π₯ + π1 π¦ + π1 π§ = π1
π2 π₯ + π2 π¦ + π2 π§ = π2
π3 π₯ + π3 π¦ + π3 π§ = π3
Step-I. To eliminate π₯ from second and third equations.
Assuming π1 β 0,we eliminate π₯ from the second equation by subtracting (
π2
π1
)
times the first equation from the second equation. Similarly we eliminate π₯ from
the third equation by eliminating (
π3
π1
) times the first equation from the third
equation. We thus get the new system
π1 π₯ + π1 π¦ + π1 π§ = π1
π2β²π¦ + π2β²π§ = π2β²
π3β²π¦ + π3β²π§ = π3β²
Here the first equation is called the pivotal equation and π1 is called the first pivot.
Step-II. To eliminate π¦ from third equation in (2).
Assuming π2β² β 0, we eliminate π¦ from the third equation of (2) ,by Subtracting
(
π3β²
π2β²
) times the second equation from third equation. We thus, get the new system
π1 π₯ + π1 π¦ + π1 π§ = π1
π2β²π¦ + π2β²π§ = π2β²
π3β²β²π§ = π3β²β²
Here the second equation is the pivotal equation and π2β² is the new pivot.
12. Unit-2 SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
RAI UNIVERSITY, AHMEDABAD 12
Step-III. To evaluate the unknowns.
The values of π₯, π¦, π§ are found from the reduced system (3) by back substitution.
5.1.1 Exampleβ
Apply gauss elimination method to solve the equations
π + ππ β π = βπ
π + π β ππ = βππ
ππ β π β π = π .
Solution:
We have [
1 4 β1
1 1 β6
3 β1 β1
][
π₯
π¦
π§
] = [
β5
β12
4
]
Operate π 2 β π 1 & π 3 β 3π 1,
~ [
1 4 β1
0 β3 β5
0 β13 2
][
π₯
π¦
π§
] = [
β5
β7
19
]
Operate π 3 β
13
3
π 2,
[
1 4 1
0 β3 β5
0 0 71/3
][
π₯
π¦
π§
] = [
β5
β7
148/3
]
Thus, We have π§ =
148
71
= 2.0845,
3π¦ = 7 β 5π§ = 7 β 10.4225 = β3.4225 i.e., π¦ = β1.1408
π₯ = β5 β 4π¦ + π§ = β5 + 4(1.1408) + 2.0845 = 1.6479
and
Hence π₯ = 1.6479, π¦ = β1.1408, π§ = 2.0845.
15. Unit-2 SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
RAI UNIVERSITY, AHMEDABAD 15
This is a modification of the Jacobiβs iteration method. As before, we start with
initial approximations π₯0, π¦0, π§0 (each=0) for π₯, π¦, π§ respectively. Substituting π¦ =
π¦0, π§ = π§0 in the first equations, we get
π₯1 = π1
Then putting π₯ = π₯1, π§ = π§0 in the second of the equations, we have
π¦1 = π2 β π2 π₯1 β π2 π§0
Next substituting π₯ = π₯1, π¦ = π¦1 in the third equations, we obtain
π§1 = π3 β π3 π₯1 β π3 π¦1
And so on, i.e. as soonas new approximation for an unknown is found, it is
immediately used in the next step.
This process ofiteration is continued till convergency to the desired degree of
accuracy is obtained.
6.1.1 Exampleβ
Apply Gauss-Seideliterationmethod to solve the equation:
πππ + π β ππ = ππ
ππ + πππ β π = βππ
ππ β ππ + πππ = ππ
Solution:
We write the given equation in the form
π₯ =
1
20
(17 β π¦ + 2π§) β¦β¦β¦β¦β¦β¦β¦β¦β¦β¦β¦β¦ (1)
π¦ =
1
20
(β18β 3π₯ + π§) β¦β¦β¦β¦β¦β¦β¦β¦β¦β¦β¦β¦ (2)
π§ =
1
20
(25 β 2π₯ + 3π¦) β¦β¦β¦β¦β¦β¦β¦β¦β¦β¦β¦β¦. (3)
16. Unit-2 SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
RAI UNIVERSITY, AHMEDABAD 16
We start form the approximation π₯0 = π¦0 = π§0 = 0.substituting π¦ = π¦0, π§ = π§0 in
the right side of the first of equations (1) we get
π₯1 =
1
20
(17β π¦0 + 2π§0) = 0.8500
Putting π₯ = π₯1, π§ = π§0 in the second of the equations (1), we have
π¦1 =
1
20
(β18 β 3π₯1 + π§0) = β1.0275
Putting π₯ = π₯1, π¦ = π¦1 in the last of the equations (1), we obtain
π§1 =
1
20
(25β 2π₯1 + 3π¦1) = 1.0109
For the second iteration, we have
π₯2 =
1
20
(17 β π¦1 + 2π§1) = 1.0025
π¦2 =
1
20
(β18 β 3π₯2 + π§1) = β0.9998
π§2 =
1
20
(25β 2π₯2 + 3π¦2) = 0.9998
For the third iteration, we get
π₯3 =
1
20
(17 β π¦2 + 2π§2) = 1.0000
π¦3 =
1
20
(β18 β 3π₯3 + π§2) = β1.0000
π§3 =
1
20
(25β 3π₯3 + 2π¦3) = 1.0000
The values in the 2nd and 3rd iterations bring practically the same, we can stop.
Hence the solution is π₯ = 1, π¦ = β1, π§ = 1.
17. Unit-2 SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
RAI UNIVERSITY, AHMEDABAD 17
7.1 Difference betweendirect and iterative methods:
Direct Method Iterative Method
It computes the solution to a problem in
a finite number of steps.
In contrast to direct methods, iterative
methods are not expected to terminate in
a number of steps.
These methods give the precise answer
if they were performed in infinite
precision arithmetic.
Iterative methods form successive
approximations that converge to the
exact solution in the limit.
This method takes less time for
computation when we have small
system linear of equations.
This method takes long time for
calculation when we have small system
of linear equations.
When we have large linear system of
equation Iterative method became more
easy then direct method.
Iterative methods are better than direct
methods for solving large linear systems
e.g. Gauss elimination, LU
decomposition
e.g. Gauss -Seidel method, Jacobi
Method, Newton-Raphson method.
18. Unit-2 SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
RAI UNIVERSITY, AHMEDABAD 18
8. Referencesandwebsite Name:
1. Higher Engineering mathematics by B.S.Grewal
2. Higher Engineering Mathematics by B.V.Ramana
3. http://www.linearequations.org/system-of-linear-equations.html#
4. http://www.mathworks.com/matlabcentral/answers/7058-are-iterative-
methods-always-better-than-direct-methods-for-solving-large-linear-systems
5. http://1.bp.blogspot.com/-
pHo8nT2SKgM/UPKdqSinfSI/AAAAAAAAC9I/JZHDxmqADsg/s1600/dir
ect_vs_indirect.png
19. Unit-2 SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
RAI UNIVERSITY, AHMEDABAD 19
EXERCISE
Q-1 Evaluate the following questions:
1. Solve the following system of linear equation
π₯ + 4π¦ = β10 ,3π₯ β π¦ = 9
2. Solve the following system of linear equation
3π₯ + 7π¦ = 15,5π₯ + 2π¦ = β4
3. Show that the non Homogeneous system of linear equation are not
consistant.
2π₯ + 6π¦ = β11
6π₯ + 20π¦ β 6π§ = β3
6π¦ β 18π§ = β1
4. Test the consistency of the following equations and solve them if possible.
3π₯ + 3π¦ + 3π§ = 1
π₯ + 2π¦ = 4
10π¦ + 3π§ = β2
2π₯ β 3π¦ β π§ = 5
Q-2 Evaluate the following questions:
1. Solve the following equations by Gauss elimination method:
2π₯ + π¦ + π§ = 10
3π₯ + 2π¦ + 3π§ = 18
π₯ + 4π¦ + 9π§ = 16
2. Solve the following equations by Gauss elimination method:
2π₯ β π¦ + 3π§ = 9
20. Unit-2 SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
RAI UNIVERSITY, AHMEDABAD 20
π₯ + π¦ + π§ = 6
π₯ β π¦ + π§ = 2
3. Solve the following equations by Gauss-Seidel method:
2π₯ + π¦ + 6π§ = 9
8π₯ + 3π¦ + 2π§+ 13 = 0
π₯ + 5π¦ + π§ = 7
4. Solve the following equations by Gauss-Seidel method:
28π₯ + 4π¦ β π§ = 32
π₯ + 3π¦ + 10π§ = 24
2π₯ + 17π¦ + 4π§ = 35
21. Unit-2 SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
RAI UNIVERSITY, AHMEDABAD 21