Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

Numerical Methods

Solving Small Numbers of Linear


Algebraic Equations
By

Norhayati Rosli & Mohd Zuki Bin Salleh


Faculty of Industrial Sciences & Technology
norhayati@ump.edu.my, zuki@ump.edu.my

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
Description

AIMS

This chapter is aimed to solve small numbers of linear algebraic equations by using two types of
methods involving graphical method and Cramer’s rule.

EXPECTED OUTCOMES

1. Students should be able to transform the system of linear equations into matrix form.
2. Students should be able to solve small numbers of equations by using graphical method and
Cramer’s rule.

REFERENCES

1. Norhayati Rosli, Nadirah Mohd Nasir, Mohd Zuki Salleh, Rozieana Khairuddin, Nurfatihah
Mohamad Hanafi, Noraziah Adzhar. Numerical Methods, Second Edition, UMP, 2017 (Internal
use)
2. Chapra, C. S. & Canale, R. P. Numerical Methods for Engineers, Sixth Edition, McGraw–Hill,
2010.

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
Content

1 Introduction to System of Linear Equations


2 Graphical Method
3 Cramer’s Rule

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
INTRODUCTION TO SYSTEM OF
LINEAR ALGEBRAIC EQUATIONS
System is defined as a group of entity or objects, real or abstract,
comprising a whole with each and every component/element interacting or
related to one another. For example, solar system, blood system and
computer system.

Mathematically, system of linear equations is a collection of linear


equations involving the same set of variables

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
INTRODUCTION (Cont.)

System of linear equations is written as

a11 x1  a12 x2   a1n x n  b1


a21 x1  a22 x2   a2 n x n  b2

am1 x1  am 2 x2   am x n  bn

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
INTRODUCTION (Cont.)

 a11 a12 a1n   x1   b1 


It can be written in
a a22 a2 n   x2  b2 
matrix form as  21 
    
    
 am1 am 2 amn   xn  bn 
where

 a11 a12 a1n   x1   b1 


a x  b 
a22 a2 n 
A   21 , x   ,
2
b   2
     
     
 am1 am 2 amn   xn  bn 
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
INTRODUCTION (Cont.)

 a11 a12 a1n b1 


 
 a21 a22 a2 n b2 
 A b  
In Augmented Matrix
 
 
 am1 am 2 amn bn 

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
INTRODUCTION (Cont.)

Solving Small Number of Equations

Cramer’s Rule
2 1 Graphical Method

Two Types
of Methods

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
GRAPHICAL METHOD
The graphical method is suitable to be applied to a linear algebraic system
of two equations.
These equations are plotting on Cartesian Coordinate.
Each equation represents a straight line.
The intersection point provides the solution to the corresponding unknown.
For two equations

a11 x1  a12 x2  b 1
a21 x1  a22 x2  b 2
Solve both equations for 𝑥2 yields
a  b
x2    11  x1  1  x2  (slope) x1  intercept
 a12  a12
a  b
x2    21  x1  2
 a22  a22

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
GRAPHICAL METHOD (Cont.)
Example 1
Use the graphical method to solve the following equations
x1  2 x2  7
2 x1  3x2  7
Solution

Solve both equations for 𝑥2 :

1 7
x2   x1 
2 2
2 7
x2  x1 
3 3
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
GRAPHICAL METHOD (Cont.)
Solution (Cont.)

Plot the two equations on Cartesian coordinate:

The solution is given by the intersection point of the two lines, 𝑥1 = 1 and 𝑥2 = 3.
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
GRAPHICAL METHOD (Cont.)

Given the two lines 𝐿1 and 𝐿2 , one and only one of the following may
occur:

If 𝐿1 and 𝐿2 intersect at exactly one point, there is a unique solution.


The lines cross at only one point.
If 𝐿1 and 𝐿2 are parallel and coincident, there is an infinitely many
solutions.
If 𝐿1 and 𝐿2 are almost parallel, the system is ill-conditioned. The
point of intersection is difficult to detect visually due to the slopes
are closed.
If 𝐿1 and 𝐿2 are parallel and distinct, there is no solution.

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
GRAPHICAL METHOD (Cont.)
Example 2
Determine the nature of the solution for the following system of linear
equations
x1  3x2  3
3x1  9 x2  5
Solution

No solution

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
GRAPHICAL METHOD (Cont.)
Example 3
Determine the nature of the solution for the following system of linear
equations
x1  3 x2  3
3 x1  x2  9
Solution

Unique solution

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
GRAPHICAL METHOD (Cont.)
Example 4
Determine the nature of the solution for the following system of linear
equations
x1  3x2  3
0.35 x1  x2  1.1015
Solution

ill-conditioned

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
GRAPHICAL METHOD (Cont.)
Example 5
Determine the nature of the solution for the following system of linear
equations
x1  3 x2  3
2 x1  6 x2  6

Solution

Many solutions

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
CRAMER’S RULE
Definition

Cramer’s rule states that each unknown in a system of linear


equations may be expressed as a fraction of two determinants. The
denominator, 𝐷 is a determinant of 𝑨 matrix. The numerator, 𝐷𝑛 is
obtained by replacing the column of the coefficients of the unknown
by the vector 𝒃.

Dn
Cramer’s rule formula: xn 
D

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
CRAMER’S RULE (Cont.)

Determinant for small dimension of matrices

1 1 a11  a11
a11 a12
2 2  a11a22  a12 a21
a21 a22
a11 a12 a13
a22 a23 a21 a23 a21 a22
3 3 a21 a22 a23  a11  a12  a13
a32 a33 a31 a33 a31 a32
a31 a32 a33
 a11 ( a22 a33  a23a32 )  a12 ( a21a33  a23a31 )  a13 ( a21a32  a22 a31 )

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
CRAMER’S RULE (Cont.)

For 3 × 3 matrices, the Cramer’s rule are:

b1 a12 a13 a11 b1 a13 a11 a12 b1


b2 a22 a23 a21 b2 a23 a21 a22 b2
b3 a32 a33 a31 b3 a33 a31 a32 b3
x1  , x2  , x3 
a11 a12 a13 a11 a12 a13 a11 a12 a13
a21 a22 a23 a21 a22 a23 a21 a22 a23
a31 a32 a33 a31 a32 a33 a31 a32 a33

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
CRAMER’S RULE (Cont.)
Example 5
Given the system of linear equations

x1  3x2  x3  8
2 x1  x2  3x3  13
3x1  2 x2  x3  4
a) Transform the above system into a matrix form of 𝐀𝐱 = 𝐛.
b) Compute 𝑥1 , 𝑥2 and 𝑥3 by using Cramer’s rule.

Solution

a) 1 3 1  x1   8
 2 1 3   x   13 
  2  
 3 2 1  x3   4 
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
CRAMER’S RULE (Cont.)
Solution (Cont.)

b) Find the determinant of the matrix 𝐀

1 3 1
1 3 2 3 2 1
D  A  2 1 3  (1) 3  (1)  21
2 1 3 1 3 2
3 2 1
Find the determinants of 𝐷1 , 𝐷2 and 𝐷3 by replacing the first, second and third
column in 𝐀 with 𝐛.

8 3 1
1 3 13 3 13 1
D1  13 1 3  (8) 3  (1)  21
2 1 4 1 4 2
4 2 1
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
CRAMER’S RULE (Cont.)
Solution (Cont.)

1 8 1
13 3 2 3 2 13
D2  2 13 3  (1)  (8)  (1) 3  42
4 1 3 1 4 4
3 4 1

1 3 8
1 13 2 13 2 1
D3  2 1 13  (1) 3  (8)  63
2 4 3 4 3 2
3 2 4

21 42 63
x1   1, x2   2, x3  3
21 21 21
Therefore, 𝑥1 = 1, 𝑥2 = −2, 𝑥3 = 3.
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
Conclusion

Graphical method is applicable for system with two equations only.


Cramer’s rule are suitable to solve 3 × 3 system.
However, the difficulty arise in Cramer’s rule when the dimension of the matrix
is high as one needs to compute the determinant of the matrix.

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
Author Information
Mohd Zuki Salleh
Applied & Industrial Mathematics Research
Group, Norhayati Binti Rosli,
Faculty of Industrial Sciences & Technology Senior Lecturer,
(FIST), Applied & Industrial Mathematics Research
Universiti Malaysia Pahang, Group,
Lebuhraya Tun Razak, Fakulti Sains & Teknologi Industri,
26300 Gambang, Kuantan, Universiti Malaysia Pahang,
Pahang, Malaysia 26300 Gambang, Pahang.
Web: Mohd Zuki Salleh SCOPUS ID: 36603244300
UMPIR: Mohd Zuki Salleh UMPIR ID: 3449
Google Scolar: Mohd Zuki Salleh Google
ResearchID: F-5440-2012 Scholars: https://scholar.google.com/citations
ORCiD: http://orcid.org/0000-0001-9732-9280 ?user=SLoPW9oAAAAJ&hl=en
SCOPUS ID: 25227025600 e-mail: norhayati@ump.edu.my
E-mail: zuki@ump.edu.my

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449

You might also like