2 - SYSTEM OF LINEAR EQUATIONS - Spring 23-24
2 - SYSTEM OF LINEAR EQUATIONS - Spring 23-24
Chapter-2
Linear equation:
An equation in two or more variables (unknowns) is linear if it contains no products of unknowns or
exponent of each unknown is 1.
Example:
1. 2 x + 3 y = 8 (linear )
2. x1 + x2 + .... + xn = 1 (linear )
3. x 2 + 4 x = 8 (non − linear )
Solution:
A solution of linear equation a1 x1 + a2 x2 + ... + an xn = b is a sequence of 𝑛 numbers 1 , 2 ..., n such
that the equation is satisfied when we substitute x1 = 1 , x2 = 2 ,..., xn = n . The set of all such solutions
of the linear equation is called a solution set.
x + y = 2
has no solution.
x + y = 0
System of linear equations:
A group of 𝑚 linear equations of 𝑛 variables x1 , x2 ,..., xn are of the form
a11 x1 + a12 x2 + . . . + a1n xn = b1
a21 x1 + a22 x2 + . . . + a2 n xn = b2
. . . . . .
.............(1)
. . . . . .
. . . . . .
am1 x1 + am 2 x2 + . . . + amn xn = bm
1
Matrices, Vectors and Fourier Analysis Spring 2023-2024
is known as system of linear equation. Here the co-efficient a i j , i = 1,2,...m, j = 1,2,..., n of the
variable and the free term b i , i = 1,2,..., m are real numbers.
By a solution (set) of a system means such a set of real numbers that satisfies each equation in a system.
System of non-
homogeneous
Linear Equations
System of
homogeneous
Inconsistent Consistent Linear Equations
2
Matrices, Vectors and Fourier Analysis Spring 2023-2024
y y y
x x x
Example: Following augmented matrices illustrate the consistency of the linear system.
1 2 3 2 1 2 3 2 1 2 3 2
(i) [A|B] = [0 1 4| 3], (ii) [A|B] = [0 1 4| 3], (iii) [A|B] = [0 1 4| 3].
0 0 1 2 0 0 0 2 0 0 0 0
rank(𝐴) = rank[𝐴|𝐵] = 3 rank(𝐴) = 2; rank[𝐴|𝐵] = 3 rank(𝐴) = 2;
So, this system is consistent. So, this system is inconsistent. rank[𝐴|𝐵] = 2
There is no solution for this So, this system is consistent
system. but infinitely many solutions.
Example: Test the consistency of the following system of linear equations with the help of the rank
of the matrix
3𝑥1 + 4𝑥2 − 𝑥3 + 2𝑥4 = 1
𝑥1 − 2𝑥2 + 3𝑥3 + 𝑥4 = 2 .
3𝑥1 + 14𝑥2 − 11𝑥3 + 𝑥4 = 3
~ 1 −2 3 1 2 ~ 1
1 −2 3 1 2
1 2
𝑟3 → 𝑟3 − 2𝑟2 ( 0 10 −10 −1| −4) 𝑟2 → 10 𝑟2 (0 1 −1 − 10|− 5)
0 0 0 0 5 0 0 0 0 1
Now rank(𝐴) = 2, rank(𝐴|𝑏) = 3. Since rank(𝐴) ≠ rank(𝐴|𝑏) , the system is inconsistent. It has
no solution.
Example: Test the consistency of the following system of linear equations with the help of the rank
of the matrix, If consistent solve the system.
3
Matrices, Vectors and Fourier Analysis Spring 2023-2024
2𝑥 + 2𝑦 + 3𝑧 = 2
−𝑥 + 3𝑦 + 𝑧 = 1 .
𝑥−𝑦+𝑧 = 3
2𝑥 + 2𝑦 + 3𝑧 = 2, 8𝑦 + 5𝑧 = 4, 3𝑧 = 12
=> 𝑧 = 4, 𝑦 = −2, 𝑥 = −3 𝑆𝑜𝑙𝑣𝑒𝑑.
Graphical representation of the system of linear equations for unique solution (One solution):
4
Matrices, Vectors and Fourier Analysis Spring 2023-2024
Therefore, the unique solution of the system is given by x = 2 and y = 3. Geometrically, the two lines
represented by the two equations that make up the system intersect at the point (2,3). So, the solutions
are 𝑥 = 2 and 𝑦 = 3.
Example: A system of linear equations which are consistent has infinitely many solutions:
(Graphical representation of the system for infinitely many solutions)
In particular, by assigning the value t to x , where t is any real number, we find that y = 2t − 1 and so
the ordered pair (t , 2t − 1) is a solution of the system. The variable t is called a parameter. For example,
setting t = 0 gives the point (0,−1) as a solution of the system, and setting t = 1 gives the point (1, 1) as
another solution. Since t represents any real number, there are infinitely many solutions of the system.
Geometrically, the two equations in the system represent the same line, and all solutions of the system
are points lying on the line (Figure). Such a system is said be dependent.
5
Matrices, Vectors and Fourier Analysis Spring 2023-2024
It has been observed that these two lines are parallel to each other.
Homogeneous system of linear equations has two types of solutions. They are
(i) Trivial (zero) solution (all 𝑥𝑖 = 0)
(ii) More than one solutions
(i) 𝑦
(ii) y
𝑥 x
6
Matrices, Vectors and Fourier Analysis Spring 2023-2024
The system (1) also can be written in augmented matrix form [𝐴|𝐵] or [𝐴 ⋮ 𝐵].
There are three commonly used methods to solve system of linear equations:
1. Using inverse matrix,
2. Using elementary row operations (Gaussian elimination and Gauss-Jordan elimination),
3. Cramer’s rule.
2 3 −4⋮7
[ ].
1 −2 −5⋮3
7
Matrices, Vectors and Fourier Analysis Spring 2023-2024
Note: For additional details of cofactor method, see lecture note of Chapter–1.
𝒎 (no. of linear equations) < 𝒏 (no. of unknowns or variables) of the following system of linear
equations:
After reduced the system of linear equations (1) into echelon form,
(i) Number of variable(s) is equal to the number of equation(s) gives the unique solution
(ii) Number of variable(s) is greater than the number of equation(s) gives more than one
solution.
The table below is the row reduction process applied simultaneously to the system of equations, and
its associated augmented matrix. The row reduction procedure may be summarized as follows:
8
Matrices, Vectors and Fourier Analysis Spring 2023-2024
eliminate x from all equations below 𝑟1, and then eliminate y from all equations below 𝑟2 . This will
put the system into triangular form. Then, using back-substitution, each unknown can be solved.
The solution is 𝑧 = −1, 𝑦 = 3, and 𝑥 = 2. So, there is a unique solution to the original system of
equations.
Example: Solve the following system of equations using Gaussian elimination method
2𝑥 + 𝑦 + 3𝑧 = 1 (𝑟1 )
2𝑥 + 6𝑦 + 8𝑧 = 3 (𝑟2 )
6𝑥 + 8𝑦 + 18𝑧 = 5 (𝑟3 )
𝑟2 → 𝑟2 − 𝑟1 2 1 3 1
𝑟3 → 𝑟3 − 3𝑟1 (0 5 5 ⋮ 2)
0 5 9 2
𝑟3 → 𝑟3 − 𝑟2 2 1 3 1
(0 5 5 ⋮ 2)
0 0 4 0
From this stage, we can get the solution by 𝑧=0
back solving 5𝑦 + 5(0) = 2
2
⇒𝑦=
5
2 3
and 2𝑥 + 5 + 3(0) = 1 ⇒ 𝑥 = 10
9
Matrices, Vectors and Fourier Analysis Spring 2023-2024
Example: Solve the following system of equations using elementary row operations
3𝑥 + 𝑦 − 6𝑧 = −10 (𝑟1 )
2𝑥 + 𝑦 − 5𝑧 = −8 (𝑟2 )
6𝑥 − 3𝑦 + 3𝑧 = 0 (𝑟3 )
𝑟3 → 𝑟3 − 𝑟2 3 1 −6 −10
(0 1 −3 ⋮ −4 )
0 0 0 0
Example: Solve the following system of equations using Gaussian elimination method
𝑥 +𝑧=1 (𝑟1 )
𝑥+𝑦+𝑧 =2 (𝑟2 )
𝑥−𝑦+𝑧 =1 (𝑟3 )
𝑟2 → 𝑟2 − 𝑟1
𝑟3 → 𝑟3 − 𝑟1 1 0 1 1
(0 1 0 ⋮ 1 )
0 −1 0 0
𝑟3 → 𝑟3 + 𝑟2
1 0 1 1
(0 1 0 ⋮ 1)
0 0 0 1
The third row ′0 = 1′ it does not exist. So, the system is inconsistent. That means the system has no
solution.
10
Matrices, Vectors and Fourier Analysis Spring 2023-2024
2 −1 1 1 ~ 1 4 −3 −2 𝑟̃2 → 𝑟2 − 2𝑟1 1 4 −3 −2
(1 4 −3 ⋮ −2) 𝑟 ↔ 𝑟2 (2 −1 1 ⋮ 1 ) (0 −9 7 ⋮ 5)
1
3 2 −1 0 3 2 −1 0 𝑟
̃3 → 𝑟3 − 3𝑟1 0 −10 8 6
~ 1 4 −3 −2 ~ 1 4 −3 −2
𝑟2 → 𝑟2 − 𝑟3 (0 1 −1 ⋮ −1) 𝑟 → 𝑟3 + 10𝑟2 (0 1
3
−1 ⋮ −1)
0 −10 8 6 0 0 −2 −4
~ 1 4 −3 −2 ~ 1 0 1 2 1 0 0 0
1
𝑟3 → −2𝑟3 (0 1 −1 ⋮ −1) 𝑟 → 𝑟1 − 4𝑟2 (0 1 −1 ⋮ −1) 𝑟̃1 → 𝑟1 − 𝑟3 (0 1 0 ⋮ 1)
1
0 0 1 2 0 0 1 2 𝑟̃2 → 𝑟2 + 𝑟3 0 0 1 2
Hence the solution is 𝑥 = 0, 𝑦 = 1, 𝑧 = 2.
Example: Solve the following system of equations using matrix inversion and justify your answer.
2𝑥 + 𝑦 = 1 (𝑟1 )
} (1)
𝑥 − 2𝑦 = 3 (𝑟2 )
Solution:
2 1 𝑥 1
Where, 𝐴 = ( ), 𝑋 = (𝑦), and 𝐵 = ( )
1 −2 3
2 1
The determinant of the matrix A is | | = −6 ≠ 0
1 −2
−1
So, the matrix 𝐴 is non-singular and 𝐴 exists.
1 −2 −1
Now 𝐴−1 = −5 ( )
−1 2
And 𝑋 = 𝐴−1 𝐵
1 −2 −1 1
= ( )( )
−5 −1 2 3
1 −5
= ( )
−5 5
1
=( )
−1
𝑥 1
∴ (𝑦) = ( )
−1
∴ 𝑥 = 1 and 𝑦 = −1
11
Matrices, Vectors and Fourier Analysis Spring 2023-2024
Verification:
𝑟1 : 𝐿. 𝐻. 𝑆 = 2𝑥 + 𝑦 = 2.1 − 1 = 1 = 𝑅. 𝐻. 𝑆
𝑟1 : 𝐿. 𝐻. 𝑆 = 𝑥 − 2𝑦 = 1 − 2(−1) = 3 = 𝑅. 𝐻. 𝑆
Solution:
1 2 3
The system of equations can be written in the matrix form as 𝐴𝑋 = 𝐵 , where 𝐴 = (2 5 3),
1 0 8
𝑥1 5
𝑋 = (𝑥2 ) and 𝐵 = ( 3 ) . The solution can be written as 𝑋 = 𝐴−1 𝐵. Let us find 𝐴−1 using
𝑥3 17
elementary row operations.
1 2 3 1 0 0 ~ 1 2 3 1 0 0 ~
[𝐴 ⋮ 𝐼] = (2 5 3 ⋮ 0 1 0) 𝑟2 → 𝑟2 − 2𝑟1 (0 1 −3 ⋮ −2 1 0) 𝑟 → 𝑟 + 2𝑟
3 3 2
1 0 8 0 0 1 𝑟3 → 𝑟3 − 𝑟1 0 −2 5 −1 0 1
1 2 3 1 0 0 ~ 1 0 9 5 −2 0 ~
(0 1 −3 ⋮ −2 1 0) 𝑟1 → 𝑟1 − 2𝑟2 (0 1 −3 ⋮ −2 1 0) 𝑟 → 𝑟 + 9𝑟
1 1 3
0 0 −1 −5 2 1 0 0 −1 −5 2 1
1 0 0 −40 16 9 ~ 1 0 0 −40 16 9
(0 1 −3 ⋮ −2 1 0) 𝑟2 → 𝑟2 − 3𝑟3 (0 1 0 ⋮ 13 −5 −3)
0 0 −1 −5 2 1 𝑟3 → −𝑟3 0 0 1 5 −2 −1
−40 16 9
∴ 𝐴−1 = ( 13 −5 −3)
5 −2 −1
12
Matrices, Vectors and Fourier Analysis Spring 2023-2024
−40 16 9 5 1
Now, 𝑋 = 𝐴−1 𝐵 = ( 13 −5 −3) ( 3 ) = ( −1) 𝑥1 = 1, 𝑥2 = −1 and 𝑥3 = 2.
5 −2 −1 17 2
Cramer’s Rule:
Let a system of linear equations is given 𝐴𝑋 = 𝐵 and det (𝐴) = 𝐷. This system is
(a) inconsistent if 𝐵 ≠ 0 but 𝐷 = 0 ;
(b) consistent and not applicable if 𝐵 = 0 and 𝐷 = 0 ;
(c) consistent and unique if 𝐷 ≠ 0; and in this case the solution is given by
D
xi = i (i = 1, 2, ......., n) ,
D
𝐷𝑖 can be obtained by replacing ith column by right hand side.
Explicit formulas for small systems
𝑎 𝑥 + 𝑏1 𝑦 = 𝑐1
Consider the linear system { 1
𝑎2 𝑥 + 𝑏2 𝑦 = 𝑐2
𝑎 𝑏1 𝑥 𝑐1
which in matrix format is ( 1 ) (𝑦) = (𝑐 )
𝑎2 𝑏2 2
Assume 𝑎1 𝑏2 − 𝑏1 𝑎2 nonzero. Then, with help of determinants 𝑥 and 𝑦 can be found with Cramer's
rule as
𝑐 𝑏1 𝑎1 𝑐1
| 1 | 𝑐 𝑏 −𝑏 𝑐 |𝑎
𝑐2 𝑏2 1 2 1 2 𝑐 | 𝑎1 𝑐 2 − 𝑐1 𝑎2
𝑥= = and 𝑦 = 2 = .
𝑎1 𝑏1 𝑎1 𝑏2 − 𝑏1 𝑎2 𝑎1 𝑏1 𝑎1 𝑏2 − 𝑏1 𝑎2
| | | |
𝑎2 𝑏2 𝑎2 𝑏2
13
Matrices, Vectors and Fourier Analysis Spring 2023-2024
Example:
Let us demonstrate Cramer's rule with the following system:
𝑥 + 2𝑦 + 3𝑧 = 1
−𝑥 + 2𝑧 = 2
−2𝑦 + 𝑧 = −2
Step 1:
1 2 3
The coefficient matrix of this system is 𝐴 = (−1 0 2)
0 −2 1
Note that the matrix is square (it has 3 rows and 3 columns), and so we may proceed with the
next step of Cramer's rule.
Step 2:
Now find the determinant of the coefficient matrix 𝐴; use the matrix manipulator in the tools box
if you would like help in this computation. You should get |𝐴| = 12. This is not zero, so Cramer's
rule may be applied here.
Step 3:
1 2 3 |𝐴 | 20 5
𝐴𝑥 = ( 2 0 2) and its determinant is |𝐴𝑥 | = −20. Therefore 𝑥 = |𝐴|𝑥 = − 12 = − 4
−2 −2 1
Step 4:
Using the same method, the values for the remaining 2 variables, 𝑥 and 𝑦, are computed below:
1 1 3 |𝐴𝑦 | 13
𝐴𝑦 = (−1 2 2) and its determinant is |𝐴𝑦 | = 13. Therefore 𝑦 = |𝐴| = − 12
0 −2 1
1 2 1 |𝐴 | 2 1
𝐴𝑧 = (−1 0 2 ) and its determinant is |𝐴𝑧 | = 2. Therefore 𝑧 = |𝐴|𝑧 = 12 = 6
0 −2 −2
Example: Verify whether the following system of linear equations is consistent. If consistent then
solve the system using Cramer’s rule. Also check your answer.
2𝑥 − 3𝑦 − 5𝑧 = 40
17𝑥 + 14𝑦 − 22 𝑧 = 22
15𝑥 + 17𝑦 − 17𝑧 = −18 .
Solution:
2 −3 −5
D = 17 14 − 22 = 0 and ≠ 𝟎 . Therefore, this SLE is either inconsistent or more than one
15 17 − 17
solutions.
Example:
2𝑥 − 5𝑦 + 6𝑧 = −27
10𝑥 − 11𝑦 − 9𝑧 = 0
−3𝑥 + 2𝑧 = 16
14
Matrices, Vectors and Fourier Analysis Spring 2023-2024
Solution:
2 −5 6
𝐷 = 10 − 11 − 9 = – 277 and 𝐵 ≠ 0 and, therefore, this SLE has a unique solution.
−3 0 2
− 27 − 5 6 2 − 27 6 2 −5 − 27
Now D1 = 0 − 11 − 9 ; D2 = 10 0 − 9 ; D3 = 10 − 11 0 .
16 0 2 − 3 16 2 −3 0 16
= 2370 ; = 1059 ; = 1339.
2370 1059 1339
Thus 𝑥 = − ; 𝑦 =– ; 𝑧 =– .
277 277 277
Example:
Solve the following system of linear equations using Cramer’s rule
2𝑥 + 𝑦 + 𝑧 = 3
𝑥−𝑦−𝑧 =0
𝑥 + 2𝑦 + 𝑧 = 0
We have the left-hand side of the system with the variables (the "coefficient matrix") and the right-
hand side with the answer values. Let 𝐷 be the determinant of the coefficient matrix of the above
system, and let 𝐷𝑥 be the determinant formed by replacing the 𝑥-column values with the answer-
column values: Evaluating each determinant, we get:
2 1 1
𝐷 = |1 −1 −1| = 3
1 2 1
3 1 1 2 3 1 2 1 3
𝐷𝑥 = |0 −1 −1| = 3, 𝐷𝑦 = |1 0 −1| = −6, 𝐷𝑧 = |1 −1 0| = 9
0 2 1 1 0 1 1 2 0
Example:
Solve the following system of linear equations using Crammer’s rule
2𝑥 + 3𝑦 + 𝑧 = 10
𝑥−𝑦+𝑧 =4
4𝑥 − 𝑦 − 5𝑧 = −8 .
Solution: Each unknown will be the quotient of the determinant obtained by substituting the answers
in the right sides of the equations for the coefficients of the unknown divided by the determinant
formed by taking the coefficients on the left sides of the equations.
15
Matrices, Vectors and Fourier Analysis Spring 2023-2024
10 3 1 2 10 1 2 3 10
|4 −1 1 | |1 4 1| |1 −1 4 |
−8 −1 −5 84 4 −8 −5 42 4 −1 −8 126
𝑥= 2 3 1 = = 2, 𝑦 = 2 3 1 = = 1, 𝑧 = 2 3 1 = =3
42 42 42
|1 −1 1 | |1 −1 1| |1 −1 1 |
4 −1 −5 4 −1 −5 4 −1 −5
Example:
Determine the value(s) of and such that the following system of linear equations has (i) no
solution, (ii) more than one solution, and (iii) a unique solution.
x+ y+z =6
x + 2 y + 3z = 10
x + 2 y + z =
The above system is in echelon form. Now we consider the following three cases:
(i) If = 3 and 10 then third equation of (1) is of the form 0 = a , where a = − 10 0
which is not true. So, the system is inconsistent. Thus, the system has no solution for = 3
and 10 .
(ii) If = 3 and = 10 then third equation of (1) is vanishes and the system will be in echelon
form having two equations in three variables. So, it has 3 − 2 = 1 free variables which is
𝑧. Hence the given system has more than one solution for = 3 and = 10 .
(iii) For a unique solution, the coefficient of 𝑧 in the 3rd equation must be non-zero i.e., 3
and may have any value. Therefore, the given system has unique solution for 3 and
arbitrary values of .
Example:
Determine the value(s) of and such that the following system of linear equations has (i) no
solution (ii) more than one solution and (iii) a unique solution.
x + y − z =1
2 x + 3 y + z = 3 .
x + y + 3 z = 2
x + y − z =1
Solution: The given system of liner equations is 2 x + 3 y + z = 3
x + y + 3 z = 2
Reduce the system to echelon form by means of elementary row operations,
16
Matrices, Vectors and Fourier Analysis Spring 2023-2024
x + y − z =1
L/2 = L2 − 2 L1
y + ( + 2) z = 1 /
( − 1) y + 4 z = 1 L3 = L3 − L1
x + y − z =1
y + ( + 2) z = 1 L/3 = L3 − ( − 1) L2
4 − ( − 1)( + 2)z = 2 −
x + y − z =1
y + ( + 2) z = 1
( )
6 − − 2 z = 2 −
x + y − z =1
y + ( + 2) z = 1 (1)
( + 3)( 2 − ) z = 2 −
The above system is in echelon form. Now we consider the following three cases:
(i) From third equation of (1) , we see that if + 3 = 0 or = −3 then the equation becomes
0 = 5 , which is contradiction. Therefore, the system is inconsistent if = −3 . Thus, the
system has no solution for = −3 .
(ii) We know, if the number of variables is greater than the number of equations, then the
system has more than one solution. From third equation of (1) , we see that if = 2 then it
becomes 0 = 0 . In this case the system has three variables with two equations. So, the
given system has more than one solution for = 2 .
(iii) We know, if the number of variables and the number of equations be equal, then the system
has unique solution. The system (1) has a unique solution
( + 3)( 2 − ) 0 −3, 2.
Example:
Determine the value(s) of and such that the following system of linear equations has (i) no
solution, (ii) more than one solution, and (iii) a unique solution.
2x + 3 y + z = 5
3 x − y + z = 2
x + 7 y − 6z =
17
Matrices, Vectors and Fourier Analysis Spring 2023-2024
2x + 3 y + z = 5
− 11y + (2 − 3) z = −11
L/3 = L3 + L2 (1)
2( − 8) z = 2( − 8)
The above system is in echelon form. Now we consider the following three cases:
(i) For a unique solution, the coefficient of 𝑧 in the 3rd equation of (1) must be non-zero i.e.,
8 and may have many values. Therefore, the given system has unique solution for
8 and arbitrary values of .
(ii) If = 8 and = 8 then third equation of (1) is vanishes and the system will be in echelon
form having two equations in three variables. So, it has 3 − 2 = 1 free variables which is
𝑧. Hence the given system has more than one solution for = 8 and = 8. .
(iii) If = 8 and 8 then third equation of (1) is of the form 0 = a , where a = − 8 0
which is not true. So, the system is inconsistent. Thus, the system has no solution for = 8
and 8 .
Example:
Find the values of 𝑘 such that the following system of linear equations has non-zero solution.
𝑥 + 𝑘𝑦 + 3𝑧 = 0
4𝑥 + 3𝑦 + 𝑘𝑧 = 0.
2𝑥 + 𝑦 + 2𝑧 = 0
Solution:
The augmented matrix 𝐶 = [𝐴: 𝐵]
1 𝑘 3 : 0
~ (4 3 𝑘 : 0)
2 1 2 : 0
On interchanging first row and third row, we have
2 1 2 : 0
~ (4 3 𝑘 : 0)
1 𝑘 3 : 0
Reducing the system to row echelon form by the elementary row operations …
2 1 2 : 0
𝑅2′ = 𝑅2 − 2𝑅1
~( 0 1 𝑘 − 4 : 0) [ ′ 1 ]
0 𝑘−2
1
2 : 0 𝑅3 = 𝑅3 − 2 𝑅1
2 1 2 : 0
1
~ (0 1 𝑘−4 : 0) [𝑅3′ = 𝑅3 − (𝑘 − 2)𝑅2 ]
1
0 0 2 − (𝑘 − 2) (𝑘 − 4) : 0
So,
1
2 − (𝑘 − ) (𝑘 − 4) = 0
2
9
⟹ −𝑘 2 + 𝑘 = 0
2
9
⟹ 𝑘 (−𝑘 + ) = 0
2
18
Matrices, Vectors and Fourier Analysis Spring 2023-2024
9
∴ 𝑘 = 0,
2
Example: A medicine company wishes to produce three types of medicine : type 𝑃, 𝑄 and 𝑅. To
manufacture a type 𝑃 medicine requires 2 minutes each on machine 𝐼 and 𝐼𝐼 and 3 minutes on machine
𝐼𝐼𝐼. A type of 𝑄 medicine requires 2 minutes on machine 𝐼, 3 minutes on machine 𝐼𝐼 and 4 minutes of
machine 𝐼𝐼𝐼. A type 𝑅 medicine requires 3 minutes on machine 𝐼, 4 minutes on machine 𝐼𝐼 and 3
minutes on machine 𝐼𝐼𝐼. There are 3.5 hours available on machine 1, 4.5 hours available on machine 𝐼𝐼
and 5 hours available on machine 𝐼𝐼𝐼. How many medicine of each type should company make in
order to use all the available time?
Solution:
Here, 3.5 hours = 210 minutes, 4.5 hours = 270 minutes and 5 hours = 300 minutes.
Let 𝑥, 𝑦 and 𝑧 be the number of medicines of types 𝑃, 𝑄 and 𝑅 respectively. Then we have the
2𝑥 + 2𝑦 + 3𝑧 = 210
following system of linear equations: {2𝑥 + 3𝑦 + 4𝑧 = 270
3𝑥 + 4𝑦 + 3𝑧 = 300
The augmented matrix of the above system is
2 2 3 : 210
(2 3 4 : 270)
3 4 3 : 300
Reducing the system to echelon form by the elementary row operations
2 2 3 : 210 𝑟 ′ = 𝑟2 − 𝑟1
~ (0 1 1 : 60 ) [ ′ 2 ]
𝑟3 = 2𝑟3 − 3𝑟 1
0 2 −3 : −30
2 2 3 : 210
~ (0 1 1 : 60 ) [𝑟3′ = 𝑟3 − 2𝑟1 ]
0 0 −5 : −150
Hence the solution of the above system is 𝑥 = 30, 𝑦 = 30, 𝑧 = 30
Thus, the number of each type of medicine is 30.
Example: Determine the polynomial 𝑝(𝑥) = 𝑎0 + 𝑎1 𝑥 + 𝑎2 𝑥 2 whose graph passes through the
points (1,4) , ( 2,0) and (3,12).
Solution:
Given polynomial 𝑝(𝑥) = 𝑎0 + 𝑎1 𝑥 + 𝑎2 𝑥 2
Substituting x = 1, 2 and 3 into p (x ) and the corresponding y − values produces the system of linear
equations in the variables a 0 , a1 and a 2 shown below:
p (1) = a 0 + a1 (1) + a 2 (1) 2 = a 0 + a1 + a 2 = 4
p (2) = a 0 + a1 (2) + a 2 (2) = a 0 + 2a1 + 4a 2 = 0
2
19
Matrices, Vectors and Fourier Analysis Spring 2023-2024
a0 + a1 + a 2 = 4
L2 / = L2 − L1
a1 + 3a 2 = −4 /
a + 5a = 12 L3 = L3 − L2
1 2
a0 + a1 + a 2 = 4
a1 + 3a 2 = −4
L3 = L3 − L2
/
2a = 16
2
Example: Find the polynomial that fits the points (−2, 3), (−1, 5), (0, 1), (1, 4) and (2, 10).
20
Matrices, Vectors and Fourier Analysis Spring 2023-2024
Example:
Set up a system of linear equations to represent the network shown in the following figure and solve
the system.
Solution:
Each of the network’s five junctions gives rise to a linear equation, as shown below:
𝑥1 + 𝑥2 = 20 junction 1
𝑥3 + 20 = 𝑥4 junction 2
𝑥2 + 𝑥3 = 10 + 10 junction 3
𝑥1 + 10 = 𝑥5 junction 4
𝑥5 + 10 = 𝑥4 junction 5
The augmented matrix is
1 1 0 0 0 : 20
0 0 1 −1 0 : −20
0 1 1 0 0 : 20
1 0 0 0 −1 : −10
0 0 0 −1 1 : −10
Reduce the system to echelon form by the elementary row operations
1 1 0 0 0 : 20
0 1 1 0 0 : 20 R R
0 0 1 −1 0 : −20 2 3
4
R R 5
0 0 0 −1 1 : −10
1 0 0 0 −1 : −10
21
Matrices, Vectors and Fourier Analysis Spring 2023-2024
1 1 0 0 0 : 20
0 1 1 0 0 : 20
0 0 1 −1 0 : −20 R5 / = R5 − R1
0 0 0 −1 1 : −10
0 −1 0 0 −1 : −30
1 1 0 0 0 : 20
0 1 1 0 0 : 20
0 0 1 −1 0 : −20 R5 / = R5 + R2
0 0 0 −1 1 : −10
0 1 0 −1 : −10
0
1 1 0 0 0 : 20
0 1 1 0 0 : 20
R / = (−1) R4
0 0 1 −1 0 : −20 4/
R = R5 − R3
0 0 0 1 −1 : 10 5
0 0 1 −1 : 10
0
1 1 0 0 0 : 20
0 1 1 0 0 : 20
R / = R3 + R4
0 0 1 0 −1 : −10 3 /
R5 = R5 − R4
0 0 0 1 −1 : 10
0 : 0
0 0 0 0
1 1 0 0 0 : 20
0 1 0 0 1 : 30
0 0 1 0 −1 : −10 ( ) R2 / = R2 − R3
0 0 0 1 −1 : 10
0
0 0 0 0 : 0
1 0 0 0 −1 : −10
0 1 0 0 1 : 30
0 0 1 0 −1 : −10 R1/ = R1 − R2
0 0 0 1 −1 : 10
0 : 0
0 0 0 0
22
Matrices, Vectors and Fourier Analysis Spring 2023-2024
The above system is in echelon form having 4 equations in 5 unknowns. So, it has (5 − 4) = 1 free
variable, which is x 5 .
Let x5 = t , then by back substitution method, we have
x4 = t + 10, x3 = t − 10, x2 = 30 − t , x1 = t − 10, where t is a real number.
So, this system has an infinite number of solutions.
Example:
The following figure shows the flow of downtown traffic in a current city during the rush hours on a
typical weekday. The arrows indicate the direction of traffic flow on each-way road, and the average
number of vehicles per hour entering and leaving each intersection appears beside each road. 5th
Avenue and 6th Avenue can each handle up to 2000 vehicles per hour without causing congestion,
whereas the maximum capacity of both 4th street and 5th street is 1000 vehicles per hour. The flow of
traffic is controlled by traffic lights installed at each of the four intersections.
(a) Write a general expression involving the rates of flow x1 , x2 , x3 , x4 and suggest two possible
flow patterns that will ensure no traffic congestion.
(b) Suppose the part of 4th street between 5th Avenue and 6th Avenue is to be resurfaced and that
traffic flow between the two junctions must therefore be reduced to at most 300 vehicles per
hour. Find two possible flow patterns that will result in a smooth flow of traffic.
Solution:
(a) To avoid congestion, all traffic entering an intersection must also leave that intersection.
Applying this condition to each of the four intersections in a clockwise direction beginning
with the 5th Avenue and 4th Street intersection, we obtain the following equations:
1500 = x1 + x4
1300 = x1 + x2
1800 = x2 + x3
2000 = x3 + x4
This system of four linear equations in the four variables x1 , x2 , x3 , x4 may be written in the more
standard form
23
Matrices, Vectors and Fourier Analysis Spring 2023-2024
x1 + x4 = 1500
x1 + x2 = 1300
+ x3 x2 = 1800
x3 + x 4 = 2000
Using Gauss-Jordan elimination method, we obtain
1 0 0 1 1500
1 1 0 0 1300
0 1 1 0 1800
0 0 1 1 2000
1 0 0 1 1500
0 1 0 −1 −200
R2 / = R2 − R1
0 1 1 0 1800
0 0 1 1 2000
1 0 0 1 1500
0 1 0 −1 −200
R3/ = R3 − R2
0 0 1 1 2000
0 0 1 1 2000
1 0 0 1 1500
0 1 0 −1 −200
R4 / = R4 − R3
0 0 1 1 2000
0 0 0 0 0
The last augmented matrix is in row-reduced form and is equivalent to a system of three linear
equations in the four variables x1 , x2 , x3 , x4 . This we may express three of the variables-say,
x1 , x 2 , x3 in terms of x 4 . Setting x4 = t (t a parameter), we may write the infinitely many solutions of
the system as
x1 = 1500 − t
x2 = −200 + t
x3 = 2000 − t
x4 = t
Observe that for a meaningful solution we must have 200 t 1000 since x1 , x2 , x3 and x4 must all
be nonnegative and the maximum capacity of a street is 1000.
For example, picking t = 300 gives the flow pattern
x1 = 1200, x2 = 100, x3 = 1700, x4 = 300
Selecting t = 500 gives the flow pattern
x1 = 1000, x2 = 300, x3 = 1500, x4 = 500
(b) In this case, x 4 must not exceed 300. Again, using results of part(𝑎), we find, upon setting
x4 = t = 300, the flow pattern x1 = 1200, x2 = 100, x3 = 1700, x4 = 300 obtained earlier.
24
Matrices, Vectors and Fourier Analysis Spring 2023-2024
(c) Picking t = 250 gives the flow pattern x1 = 1250, x2 = 50, x3 = 1750, x4 = 250.
Linear programming problem can be solved by (i) Graphical method, (ii) Simplex method (Pivoting
method).
Example: A company manufactures and sells two models of lamps, L1 and L2. To manufacture each
lamp, the manual work involved in model L1 is 20 minutes and for L2, 30 minutes. The mechanical
(machine) work involved for L1 is 20 minutes and for L2, 10 minutes. The manual work available per
month is 100 hours and the machine is limited to only 80 hours per month. Knowing that the profit per
unit is 15 and 10 for L1 and L2, respectively, determine the quantities of each lamp that should be
manufactured to obtain the maximum benefit.
Solution:
25
Matrices, Vectors and Fourier Analysis Spring 2023-2024
Let
𝑥 = number of lamps L1
𝑦 = number of lamps L2
Objective function 𝑓(𝑥, 𝑦) = 15 𝑥 + 10 𝑦
L1 L2 Time
1 1
𝑥 + 𝑦 ≤ 100
3 2
1 1
𝑥 + 𝑦 ≤ 80
3 6
1 1
· 0 + · 0 ≤ 100
3 2
1 1
· 0 + · 0 ≤ 80
3 6
The area of intersection of the solutions of the inequalities would be the solution to the system of
inequalities, which is the set of feasible solutions.
26
Matrices, Vectors and Fourier Analysis Spring 2023-2024
The optimal solution, if unique, is a vertex. These are the solutions to systems:
1 1
𝑥 + 𝑦 = 100; 𝑥 = 0 (0, 200)
3 2
1 1
𝑥 + 𝑦 = 80; 𝑦 = 0(240, 0)
3 6
1 1 1 1
𝑥 + 𝑦 = 100; 𝑥 + 𝑦 = 80(210, 60)
3 2 3 6
In the objective function, place each of the vertices that were determined in the previous step.
Example: A calculator company manufactures two types of calculator: a handheld calculator and a
scientific calculator. Statistical data projects that there is an expected demand of at least 100 scientific
and 80 handheld calculators each day. Since the company has certain limitations on the production
capacity, the company can only manufacture 200 scientific and 170 handheld calculators per day. The
27
Matrices, Vectors and Fourier Analysis Spring 2023-2024
company has received a contract to deliver a minimum of 200 calculators per day. If there is a loss of
2 taka on each scientific calculator that you sold and a profit of 5 taka on each handheld calculator,
then how many calculators of each type the company should manufacture daily to maximize the net
profit?
Solution: To solve this problem, let’s first formulate it properly by following the steps.
Step 1: Identify the number of decision variables.
In this problem, since we have to calculate how many calculators of each type should be manufactured
daily to maximize the net profit, the number of scientific and handheld calculators each are our decision
variables.
Consider,
number of scientific calculators manufactured = 𝑥
number of handheld calculators manufactured = 𝑦
28
Matrices, Vectors and Fourier Analysis Spring 2023-2024
Cryptographically Problem:
The process to write (encoded) and read (decoded) any secret messages by using matrices is known as
Cryptography.
29
Matrices, Vectors and Fourier Analysis Spring 2023-2024
Blank A B C D E F G H I J K L M N
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
O P Q R S T U V W X Y Z
15 16 17 18 19 20 21 22 23 24 25 26
O P Q R S T U V W X Y Z Blank
15 16 17 18 19 20 21 22 23 24 25 26 0
A B C D E F G H I J K L M N
1 2 3 4 5 6 7 8 9 10 11 12 13 14
4 3
Example: Encode the message SECRET CODE by using matrix 𝐴 = [ ].
1 1
Solution:
S E C R E T space C O D E
19 5 3 18 5 20 0 3 15 4 5
30
Matrices, Vectors and Fourier Analysis Spring 2023-2024
Step 2: Divide these numbers in the sequence into groups of 2 (based on the size of given matrix) and
use these groups as the columns (proceed down the columns) of a matrix, B of two rows. Thus,
19 3 5 0 15 5
B=
5 18 20 3 4 0
Step 3: Now,
4 3 19 3 5 0 15 5
AB =
1 1 5 18 20 3 4 0
91 66 80 9 72 20
AB =
24 21 25 3 19 5
Step 4: Therefore, the coded message is 91 24 66 21 80 25 9 3 72 19 20 5.
1 1
𝐴=( ).
1 0
Solution:
Step 1: When elements of the encoding matrix, 𝐴 are positive and find inverse matrix of 𝐴.
0 1
𝐴−1 = ( )
1 −1
Step 2: The encoded message is 7 6 28 20 23 5.
Since the encoding matrix, 𝐴 is 2 × 2, make a matrix “C” having two rows by picking two numbers
from the left of encoded message as columns of matrix “C”. We have,
7 28 23
𝐶=( )
6 20 5
Step 3: Now,
0 1 7 28 23 6 20 5
𝐴−1 𝐶 = ( )( )=( )
1 −1 6 20 5 1 8 18
31
Matrices, Vectors and Fourier Analysis Spring 2023-2024
Step 4: Writing the numbers in the columns of this matrix in sequence and using the letters to
correspondence numbers. Thus,
6 1 20 8 5 18
F A T H E R
Exercise 2
1. Solve the following system of linear equations by using Cramer’s rule and Matrix inversion
methods (If Applicable).
a. −3 x + 2 y − 3 z = − 8 b. x1 + x2 + 2 x3 = 8 c. 3 x − y + z = −2
2x − y + z = 4 − x1 − 2 x2 + 3 x3 = 1 x + 5 y + 2z = 6
x + 2 y − 4 z = −2 2x + 3y + z = 0
3 x1 − 7 x2 + 4 x3 = 10
Ans: (−2, 0, 4)
Ans: (2, 2, 2) Ans: (3, 1, 2)
d. x1 + 2 x2 + x3 = 2 e. x + y + 2z = 1 f. 2 x1 − x2 − x3 = 6
2 x1 − x2 + 2 x3 = −1 y + z =1 x1 + 3x2 + 2 x3 = 1
3x1 − 4 x2 − 3x3 = −16 −2 x + 3 y + z = 3 3x1 − x2 − 5 x3 = 1
Ans: (−2, 1, 2) Ans: not applicable Ans: (3, −2, 2)
2. Find the rank of the matrices corresponding to each of the following systems of linear
equations. Hence test whether the systems of linear equations are consistent. If consistent find
the solutions of the system. Also check your answer by direct substitution.
a. 2 x1 − 3x2 = −2 x2 − 4 x3 = 8 c. 𝑥 − 2𝑦 + 𝑧 = 0
b. 2 x1 − 3x2 + 2 x3 = 1 2𝑦 − 8𝑧 = 8
2 x1 + x2 = 1
−4𝑥 + 5𝑦 + 9𝑧 = −9
3x1 + 2 x2 = 1 5 x1 − 8 x2 + 7 x3 = 1
Ans. (29, 16, 3)
Ans: Inconsistent Ans: Inconsistent
d. x + y + 2z = 0 e. 𝑥 + 2𝑦 + 4𝑧 = −13 f. x1 − x2 + 2 x3 = 5
y+z =0 3𝑥 − 𝑦 + 𝑧 = 5 2 x1 + x2 − x3 = 2
𝑥 + 3𝑦 =3
−2 x + 3 y + z = 0 2 x1 − x2 − x3 = 4
Ans. (3, 0, −4)
Ans. (−𝑎, −𝑎, 𝑎) Ans: (2, −1, 1)
g. 2x − y − 5 z = 4 h. − x + 2 y + 2 z = −2 i. x1 + 2 x2 − 2 x3 = 2
x + y + z = −3 3x + 2 y − z = 9 − x1 + x2 − 2 x3 = −1
− x −4y + z = 4 x +4 y + z=5 x1 − 4 x2 − 2 x3 = 8
Ans: (−1, − 1, − 1) Ans: (2, 1, −1) Ans: (2, −1, −1)
32
Matrices, Vectors and Fourier Analysis Spring 2023-2024
j. 2x − 3y + 4z = 8 k. 3𝑥 + 𝑦 + 2𝑧 = 14 l. x + 2 y − 3z = 6
3 x + 4 y − 5 z = −4 2𝑦 + 5𝑧 = 22 2x − y + 4z = 2
2𝑥 + 5𝑦 − 𝑧 = −22 4 x + 3 y − 2 z = 14
5x − 7 y + 6 z = 9
Ans: (2, −4 , 6) Ans: (2 − 𝑎, 2 + 2𝑎, 𝑎)
Ans: (1, 2, 3)
m. −x + y −z=0 n. x + 2y +3z =1 o. x + y + z = −1
3 x − y + 2 z = −2 x + 3y + 6z = 3 x − y + z = −5
2 x + 4 y + 3z = 2 2 x + 6 y + 13 z = 5 2x + y − z = 5
Ans: (−2, 0, 2) Ans: (−6, 5, −1) Ans: (0, 2, −3)
p. x + 2 y + 3z = 5 q. 3x + 2 y − z = −15
2 x + 5 y + 3z = 3 5x + 3 y + 2 z = 0
x + 8 z = 17 3x + y + 3z = 11
Ans: (1, −1, 2) −6 x − 4 y + 2 z = 30
Ans: (−4, 2, 7)
3. Determine the value(s) of such that the following system of linear equations has (i) no
solution, (ii) more than one solution, and (iii) a unique solution.
x + y + z = 1
x + y + z = 1 .
x + y + z = 1
Ans: (𝑖) 𝜆 = −2, (𝑖𝑖) 𝜆 = 1, (𝑖𝑖𝑖) 𝜆 ≠ 1, 𝜆 ≠ −2.
4. Determine the value(s) of such that the following system of linear equations has (i) no
solution, (ii) more than one solutions, and (iii) a unique solution.
x − 3z = −3
2 x + y − z = −2 .
x + 2 y + z = 1
Ans: (𝑖) 𝜆 = −5, (𝑖𝑖) 𝜆 = 2, (𝑖𝑖𝑖) 𝜆 ≠ 2, 𝜆 ≠ −5.
5. Determine the value(s) of and 𝜇 such that the following system of linear equations has (i)
no solution, (ii) more than one solutions, and (iii) a unique solution.
𝑥+𝑦 +𝑧 =2
𝑥 + 3𝑦 + 𝜆𝑧 = 6.
𝑥 + 2𝑦 + 3𝑧 = 𝜇
6. Determine the value(s) of such that the following system of linear equations has (i) no
solution, (ii) more than one solutions, and (iii) a unique solution.
x + y + z = 1
x + y + z = .
x + y + z = 2
Ans: (𝑖) 𝜆 = −2, (𝑖𝑖) 𝜆 = 1, (𝑖𝑖𝑖) 𝜆 ≠ 1, 𝜆 ≠ −2.
33
Matrices, Vectors and Fourier Analysis Spring 2023-2024
7. The network in the figure below shows the traffic flow (in vehicles per hour) over the
several one-way streets. Determine the general flow pattern for the network.
8. The network in the figure below shows the traffic flow (in vehicles per hour) over the
several one-way streets. Determine the general flow pattern for the network.
9. The network in the figure below shows the traffic flow (in vehicles per hour) over the several
one-way streets. Determine the general flow pattern for the network.
a. b.
34
Matrices, Vectors and Fourier Analysis Spring 2023-2024
Ans: (a) Here 𝑥3 is the free variable. The system has an infinite number of solutions. But to
remove negativity 𝑥3 must be between 0 to 500.
(b) Here 𝑥3 is the free variable. The system has an infinite number of solutions. But to
remove negativity 𝑥3 must be greater than 500.
10. The network in the figure below shows the traffic flow (in vehicles per hour) over the
several one-way streets. Determine the general flow pattern for the network.
Ans: Here 𝑥5 is the free variable. The system has an infinite number of solutions. But to
remove negativity 𝑥5 must start from 200.
11. Find the general flow pattern of the network system in the figure. Assuming that the flows
are all nonnegative, what is the smallest possible value for x4 .
𝑥2
𝑥3
𝑥1 𝑥4
12. A company produces three products 𝑥, 𝑦, 𝑧 every day. Their total production on a certain day
is 45 tons. It is found that the production of 𝑧 exceeds the production of 𝑥 by 8 tons while the
total production of ‘𝑥’ and ‘𝑧’ is twice the production of ‘𝑦’. Determine the production level of
each product.
13. Construct the system of linear equations from the following diagrams, reduced the system to
echelon form and finally find the general flow pattern, where 𝑥𝑖 is the number of cars.
(i)
35
Matrices, Vectors and Fourier Analysis Spring 2023-2024
(ii)
(iii)
(iv)
1 1
14. Encode the message TRY YOUR BEST by using matrix, 𝐴 = ( ). Also decode your
1 0
encrypted message using the same matrix.
36
Matrices, Vectors and Fourier Analysis Spring 2023-2024
1 1
15. Encode the message HONESTY IS THE BEST POLICY by using matrix 𝐴 = ( )
1 0
given above.
1 2
16. Encrypt the message EFFORT NEVER DIES by the provided matrix, 𝐵 = ( ).
1 1
1 1
𝐴=( ).
1 0
Linear Programming:
Reference: Operation Research by Hamdy A. Taha, 10th edition.
Problem-2.1-1 and 2.1-2 (Page-45-52), problem 2.7 , 2.8, 2.9, 2.13 (page 77, 78).
Supplementary:
37
Matrices, Vectors and Fourier Analysis Spring 2023-2024
References:
38