2 - System of Linear Equations

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 45

Matrices, Vectors, Fourier Analysis Summer 2021-2022

Chapter-2

System of Linear Equations (SLE)


In mathematics, linear systems are the basis and a fundamental part of linear algebra, a subject which
is used in most parts of modern mathematics. Computational algorithms for finding the solutions are
an important part of numerical linear algebra, and play a prominent role in engineering, physics,
chemistry, computer science, and economics. A system of linear equations is a group of two or more
linear equations containing the same variables. In a system of equations there is more than one
unknown since the equations contain more than one variable. We will explore applications that
involve systems of linear equations and look at how to set up a system of equations with given
information. Systems of linear equations arise in a wide variety of applications. System of linear
equations arises in the problem of polynomial curve fitting, network analysis and analysis of an
electric circuit and the linear programming problem etc. System of linear equations also arises when
we want to solve mixture problems and distance-rate-time problem. One of the most frequent
occasions where linear systems of n equations in n unknowns arise is in least-squares optimization
problems. Least squares problems lead to square (i.e.n × n) linear systems of equations. Also
systems of linear equations arise in the problem of graph theory and cryptography.
In cryptanalysis (breaking codes mathematically) we use linear in solving systems of equations
related to both a grammar and language in cipher text.

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 . x 1 +x 2 +. . ..+x n =1 ( linear)
3 . x 2 + 4 x =8 (non−linear)

Solution:
A solution of linear equation a 1 x 1 + a2 x 2 +. . .+ an x n =b is a sequence of n numbers α 1 , α 2 . . ., α n
such that the equation is satisfied when we substitute x 1=α 1 , x 2 =α 2 ,. .. , x n =α n . The set of all such
solutions of the linear equation is called a solution set.

x+y=2¿} ¿ ¿¿ has no solution.


System of linear equations:

A group of m linear equations of n variables x 1 , x2 ,. .. , x n are of the form

1
Matrices, Vectors, Fourier Analysis Summer 2021-2022

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.

Solution of a system of linear equations:


A sequence of numbers α 1 , α 2 . . ., α n is called solution of the system of linear equations given by (1) if
α 1 , α 2 . . ., α n is a solution of every equation in the system.

Degenerate and non-degenerate linear equation:


A linear equation is said to be degenerate if it has the form 1 0 x +0 x +. ..+0 x =b
2 n . That is, if every
coefficient of the variable is equal to zero. The solution of such a generate linear equation is as
follows:
(i) If the constantb≠0 , then the above equation has no solution.
(ii) If the constant b=0, then every vector u=(α 1 , α 2 , .. .. . ., α n ) is a solution of the above
equation.
The general linear equation
a 1 x 1 +a2 x 2 +. . .. .+an x n =b is called non-degenerate linear equation.

Consistent and inconsistent equations:


A system of linear equations is called consistent if it has at least one set of solution. A system of
linear equations is called inconsistent if it has no solution.

Consistency theorem: The system of linear equations AX=B (m equations and n unknowns) is
consistent (i.e. there is at least one solution of the system) if the coefficient matrix A and the
augmented matrix ( A|B ) have the same rank.

Determinate and Indeterminate:


A consistent system is called determinate if it has a unique solution and indeterminate if it has more
than one solution.
An indeterminate system of linear equation always has an infinite number of solutions.

Then 3 cases arise:


► SLE is inconsistent ⇒ straight lines do not intersect (i.e., parallel);
► SLE has a unique solution ⇒ all straight lines pass through a single point;
► SLE is redundant ⇒ actually one straight line, with which others coincide, exists.
System of non-
homogeneous
Linear Equations
System of
homogeneous
Inconsistent Consistent Linear Equations

More than one


Trivial solution More than one
No solution Unique solution
solutions (zero solution) solutions

2
Matrices, Vectors, Fourier Analysis Summer 2021-2022

y y y

x x x

An inconsistent system A unique system Infinitely many solution system


(no common point) (only 1 common point) (overlapping lines)

Example: Following augmented matrices illustrate the consistency of the linear system.

[ |] [ |] [ |]
1 2 32 1 2 32 1 2 32
(i) [ A|B ] = 0 1 4 3 , (ii) [ A|B ] = 0 1 4 3 , (iii) [ A|B ] = 0 1 4 3 .
0 0 12 0 0 02 0 0 00
rank (A )=rank [ A| B ] =3 rank (A )=2 ; rank [ A| B ] =3 rank ( A )=2 ;
So, this system is consistent. So, this system is inconsistent. rank [ A| B ] =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 x 1 +4 x2 −x3 +2 x 4=1
x 1−2 x 2 +3 x 3+ x 4=2 .
3 x 1+14 x2 −11 x3 + x 4 =3

Solution: The corresponding augmented matrix is

( |) ( |)
3 4 −1 2 1 1 −2 3 1 2
1 −2 3 1 2 ↔ r 2 3 4 −1 2 1
r
3 14 −11 1 3 1 3 14 −11 1 3

(
r 2 →r 2−3 r 1 1 −2
|)
~ 3 1 2
~ 0 10 −10 −1 −4
r 3 →r 3 −3 r 1
0 20 −20 −2 −3

( |)
3 1 2

( |)
1 −2 3 1 2 1 1 −2
→ r 3−2 r 2 → r2 −1 −2
0 10 −10 −1 −4 0 1 −1
r3 r 2 10 10 5
0 0 0 0 5
0 0 0 0 1

Now rank ( A )=2 ,rank ( A|b ) =3. Since rank ( A ) ≠ rank ( A|b ) , the system is inconsistent. It has no
solution.

3
Matrices, Vectors, Fourier Analysis Summer 2021-2022

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.
2 x+ 2 y +3 z=2
−x+ 3 y+ z =1 .
x− y+ z=3

Solution: The corresponding augmented matrix is

( |) ( |)
2 2 32 ~ 2 2 3 2
r 2 → 2r 2 +r 1
−1 3 1 1 ~ 0 8 5 4
1 −1 1 3 r 3 →2 r 3 −r 1 0 −4 −1 4

( |)
2 2 3 2
~
r 3 →2 r 3 +r 2 0 8 5 4
0 0 3 12

Now rank ( A )=3 , rank ( A|b )=3. Since rank ( A )=rank ( A|b ) , the system is consistent.

Echelon matrix can be written to system of linear equations

2 x+ 2 y +3 z=2 , 8 y +5 z =4 ,3 z=12
¿> z =4 , y=−2 , x=−3 Solved .

Example: A system of linear equations with exactly one solution


Consider the system
2 x− y=1
3 x+2 y =12
Solving the first equation for y in terms of x , we obtain the equation
y=2 x−1
Substituting this expression for y into the second equation yields
3 x+2(2 x−1 )=12
⇒3 x + 4 x−2=12
⇒7 x =14
∴ x=2
Finally, substituting this value of x into the expression for y gives y=2(2)−1=3

Graphical representation of the system of linear equations for unique solution (One solution):

4
Matrices, Vectors, Fourier Analysis Summer 2021-2022

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 x=2 and y=3 .

Example: A system of linear equations which are coincident has infinitely many solutions:
(Graphical representation of the system for infinitely many solutions)

Consider the system 2 x− y=1 ; 6 x−3 y=3 .

Solving the first equation for y in terms of x , we obtain the equation


y=2 x−1
Substituting this expression for y into the second equation yields
6 x−3(2 x−1 )=3
⇒ 6 x −6 x+3=3
∴ 0=0
Which is a true statement. This result follows from the fact that the second equation is equivalent to
the first. Our computations have revealed that the system of two equations is equivalent to the single

5
Matrices, Vectors, Fourier Analysis Summer 2021-2022

equation 2 x− y=1 . Thus, any ordered pair of numbers ( x , y ) satisfying the equations 2 x− y=1 or
y=2 x−1 constitutes a solution to the system.

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.

Example: A system of linear equations that has no solution:


Consider the system
2 x− y=1
6 x−3 y=12
Solving the first equation for y in terms of x , we obtain the equation
y=2 x−1
Substituting this expression for y into the second equation yields
6 x−3(2 x−1 )=12
⇒ 6 x −6 x+3=12 ∴ 0=9
which is clearly untrue. Thus, there is no solution to the system of equations.
y=2 x−1
y=2 x−4
Graphical representation of the system of linear equations for no solution:

We see at once that the lines represented by these equations are parallel (each has slope 2) and
distinct since the first has y intercept −1 and the second has y -intercept −4. Systems having no
solutions such as this one are said to be inconsistent.

6
Matrices, Vectors, Fourier Analysis Summer 2021-2022

Homogeneous and nonhomogeneous linear equation:


A system of linear equations is called homogeneous if all the constant terms b 1 , b2 .. . ., b n of the Non-
homogeneous system are zero such as the system has the form:
a 11 x 1 + a12 x 2 + . . . +a1n x n =0
a21 x 1 + a22 x 2 + . . . +a 2n x n =0
. . . . . .
. . . . . .
. . . . . .
a m 1 x1 + am 2 x 2 + . . . +amn x n =0

Homogeneous system of linear equations has two types of solutions. They are
(i) Trivial (zero) solution (all x i=0 )
(ii) More than one solution

Matrices and system of linear equations:

][ ] [ ]
The system of linear equations (1) can be written in the matrix form.

[
a11 a12 . . . a1 n x1 b1
a21 a22 . . . a2 n x2 b2
. . . . . . x 3 = b3
. . . . . . . .
. . . . . . . .
am 1 an 2 . . . amn x m bm
or simply A X =B …………………………………….…(2)

where co-efficient matrix, A=( a i j ) , variable matrix,


X =( x i ) and constant matrix, B=(b i )

The associated homogeneous system of (1) is A X =0.

The system (1) also can be written in augmented matrix form [ A |B ¿ or [ A ⋮ B ].

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.

7
Matrices, Vectors, Fourier Analysis Summer 2021-2022

Example:
The co-efficient matrix and the augmented matrix of the system
2 x +3 y−4 z=7
x−2 y−5 z=3
( 1) }
The matrix equation of the above system (1) is

)( ) ( )
x
( 2 3 −4
1 −2 −5
y =
z
7
3
Augmented matrix of the above system (1) is

[ 21 3 −4 ⋮ 7
−2 −5 ⋮ 3 ]
.
Solution of linear equation by applying matrices:
m ( no . of linear equations )=n(no . of variables) for the system of linear equations:
Consider, m ( no . of linear equations )=n(no . of variables ) for the system of linear equations (2).
Let, D be the determinant of the matrix A . we have to evaluate the determinant. If D=0, A is
−1
singular. So A doesn’t exist and hence the system has no solution. If D≠0 , A is nonsingular. So,
A−1 exists and hence the system has a solution. Now multiplying both sides of (3) by A−1 , we have
−1 −1
A AX= A B
−1
IX =A B
−1 A−1 A=I B=[l i ]
∴ X= A B
since I X= X and .

[ ] [ ][ ]
That is,
x1 l1
A 11 A 12 . . . A 1n
x2 A 21 A 22 . . . A 2n l2

x3
=
1 .
|A| .
.
.
.
.
.
.
.
.
.
. l3 [ m
= malignl¿ 1 ¿ ¿ ¿ 2 ¿ m3 ¿ . ¿ . ¿ mn ¿
]
. . . . . . . .
. A n1 An2 . . . A nn .
xn ln
(say)
x =m , x =m2 , x3 =m3 ,. .. .. . .. .. . .. . x n =mn (say) is
Where determinant of the matrix, A is | A|. Then, 1 1 2
a solution of the given system of n linear equations.
It is to be noted that the solution of the system of equation can also be found by reducing the
augmented matrix of the given system to reduced echelon form.

m (no. of linear equations) ¿ n (no. of unknowns or variables) of the following system of linear
equations:

8
Matrices, Vectors, Fourier Analysis Summer 2021-2022

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.

Example of the algorithm


Suppose the goal is to find and describe the set of solutions to the following system of linear
equations:
2 x+ y−z=8 ( r 1 )
−3 x− y +2 z=−11(r 2)
−2 x+ y+ 2 z=−3(r 3 )

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:
eliminate x from all equations below r 1, and then eliminate y from all equations below r 2. This will
put the system into triangular form. Then, using back-substitution, each unknown can be solved.

System of equations row operations augmented matrix

[ | ]
2 x+ y−z=8 2 1 −1 8
−3 x− y +2 z=−11 −3 −1 2 −11
−2 x+ y+ 2 z=−3 −2 1 2 −3

[ |]
2 x+ y−z=8 r 2 →2 r 2 +3 r 1 2 1 −1 8
y + z=2 r 3 →r 3+ r 1 0 1 1 2
2 y + z=5 0 2 1 5

[ |]
2 x+ y−z=8 r 3 →r 3−2 r 2 2 1 −1 8
y + z=2 0 1 1 2
−z=1 0 0 −1 1
The matrix is now in echelon form

[ |]
2 x+ y=7 r 1 →r 1 −r 3 2 1 0 7
y=3 r 2 →r 2+r 3 0 1 0 3
−z=1 0 0 −1 1

[ |]
2 x=4 r 1 →r 1 −r 2 2 0 0 4
y=3 0 1 0 3
−z=1 0 0 −1 1

[ |]
x=2 1 1 0 0 2
r1 → r
y=3 2 1 0 1 0 3
z=−1 r 2 →−r 2 0 0 1 −1

The solution is z=−1, y=3 , and x=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 x+ y+ 3 z=1 ( r 1)
2 x+ 6 y+ 8 z=3(r 2 )

9
Matrices, Vectors, Fourier Analysis Summer 2021-2022

6 x +8 y +18 z=5 ( r 3 )

[ ]
r 2 →r 2−r 1 2 1 3 1
r 3 →r 3−3 r 1 0 5 5⋮ 2
0 5 9 2

[ ]
r 3 →r 3−r 2 2 1 3 1
0 5 5⋮ 2
0 0 4 0
From this stage, we can get the solution by z=0
back solving 5 y +5 ( 0 )=2
2
⇒ y=
5
2 3
and 2 x+ +3 ( 0 )=1 ⇒ x=
5 10
So, the solution is:
(
( x , y , z )=
3 2
)
, ,0
10 5

Example: Solve the following system of equations using elementary row operations
3 x+ y−6 z=−10 ( r 1)
2 x+ y−5 z=−8 ( r 2 )
6 x−3 y +3 z=0 ( r 3 )

[ ]
r 2 →3 r 2−2r 1 3 1 −6 −10
r 3 →r 3−2 r 1 0 1 −3 ⋮ −4
0 1 −3 −4

[ ]
r 3 →r 3−r 2 3 1 −6 −10
0 1 −3 ⋮ −4
0 0 0 0

Let, z=a, where a is a free variable.


We have,
y=3 a−4
∴ x+ 3 z−4−6 z=−10
⇒ x=a−2
So, the general solution of the system is ( x , y , z )=( a−2, 3 a−4 , a) .
For particular solution, putting a=1( putting any suitable value)
( x , y , z )=(−1,−1 ,1)

Example: Solve the following system of equations using Gaussian elimination method
x + z=1 ( r 1 )
x + y + z=2 ( r 2 )
x− y + z=1 ( r 3 )

10
Matrices, Vectors, Fourier Analysis Summer 2021-2022

r 2 →r 2−r 1

[ ]
r 3 →r 3−r 1 1 0 1 1
0 1 0⋮ 1
0 −1 0 0

r 3 →r 3+ r 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.

Example: Solve the following system using Gauss-Jordan elimination method.


2 x− y + z=1
x +4 y−3 z=−2
3 x +2 y−z=0
Solution

[ ] [ ] [ ]
2 −1 1 1 1 4 −3 −2 ~r 2 → r 2−2 r 1 1 4 −3 −2

1 4 −3 −2 ↔r 2 2 −1 1 ⋮ 1 0 −9 7 ⋮ 5
r1 ¿~r →r −3 r
3 2 −1 0 3 2 −1 0 3 3 1
0 −10 8 6

[ ] [ ]
1 4 −3 −2 1 4 −3 −2
→r 2−r 3 0 1 −1 ⋮ −1 → r 3 + 10r 2 0 1 −1 ⋮ −1
r2 r3
0 −10 8 6 0 0 −2 −4

[ ] [ ] [ ]
1 1 4 −3 −2 1 0 1 2 ~
r 1 → r 1−r 3 1 0 0 0
→− r 3 0 1 −1 ⋮ −1 →r 1 −4 r 2 0 1 −1 ⋮ −1 ~ 0 1 0⋮ 1
r3 2 r r → r +r
0 0 1 2 1 0 0 1 2 2 2 3
0 0 1 2
Hence the solution is x=0 , y=1 , z=2.

Example: Solve the following system of equations using matrix inversion and justify your answer.
2 x+ y=1(r 1 )
x−2 y=3(r 2)
(1 ¿ }
Solution:

System (1) is written in the matrix form

11
Matrices, Vectors, Fourier Analysis Summer 2021-2022

[2 1 x
][ ] [ ]
=
1 −2 y 3
1

AX=B
−1
X =A B

Where, A= [ 21 −21 ], X =[ xy ], [ 13]


and B=

The determinant of the matrix A is |


1 −2|
2 1
=−6 ≠ 0

So, the matrix A is non-singular and A−1 exists.


Now A =
−1
[
1 −2 −1
−5 −1 2 ]
And X =A −1 B
¿
[ ][ ]
1 −2 −1 1
−5 −1 2 3

−5 [ 5 ]
1 −5
¿

¿
[−11 ]
∴ =
[ xy ] [−11 ]
∴ x=1∧ y =−1

Verification:
r 1 : L. H . S=2 x+ y=2.1−1=1=R . H . S
r 1 : L. H . S=x−2 y=1−2(−1)=3=R . H . S

Example: Solve the following system of equations using matrix inversion.


2 x− y +3 z=53
4 x−z=−53
3 x+ 3 y+ 2 z=106

Solution: We write down the given system as

( )( ) ( )
2 −1 3 x 53
4 0 −1 y = −53
3 3 2 z 106
⇒ A X =B [ say]
⇒ –1
X =A B [ since A – 1exists]

() ( )( ) ( )
x 3 11 1 53 −6
1
y −11 −5 14 −53 22 A
–1
53
⇒ z = 12 −9 4 106 = 29 [ after finding ]
⇒ x=– 6 , y=22 , z =29 is the required solution.

12
Matrices, Vectors, Fourier Analysis Summer 2021-2022

Example: Using matrix inversion solve the system of linear equations


x 1+ 2 x 2 +3 x3 =5
2 x 1+5 x 2 +3 x 3 =3 .
x 1+ 8 x 3=17

Solution:

[ ]
1 2 3
The system of equations can be written in the matrix form as AX=B , where A= 2 5 3,
1 0 8

[] []
x1 5
X = x 2 and B= 3 . The solution can be written as X =A −1 B . Let us find A−1 using elementary
x3 17
row operations.

[ ] [ ]
1 2 3 1 0 0 1 2 3 1 0 0
[ A ⋮ I ] = 2 5 3 ⋮ 0 1 0 r 2 →r 2−2 r 1 0 1 −3 ⋮ −2 1 0
r → r 3 +2 r 2
1 0 8 0 0 1 r 3 →r 3 −r 1 0 −2 5 −1 0 1 3

[ ] [ ]
1 2 3 1 0 0 1 0 9 5 −2 0

0 1 −3 −2 1 0 0 1 −3 ⋮ −2 1 0
r 1 →r 1−2r 2 r → r 1+ 9 r 3
0 0 −1 −5 2 1 0 0 −1 −5 2 1 1

[ ] [ ]
1 0 0 −40 16 9 1 0 0 −40 16 9

0 1 −3 −2 1 0 2r → r 2 −3 r 3 0 1 0 ⋮ 13 −5 −3
0 0 −1 −5 2 1 r 3 →−r 3 0 0 1 5 −2 −1

[ ]
−40 16 9
−1
∴ A = 13 −5 −3
5 −2 −1

[ ][ ] [ ]
−40 16 9 5 1
−1
Now, X =A B= 13 −5 −3 3 = −1 x 1=1 , x 2=−1∧x 3=2.
5 −2 −1 17 2

Cramer’s Rule:
Let a system of linear equations is given AX=B∧| A|=D . This system is
(a) inconsistent if B≠ 0 but D=0 ;
(b) consistent and redundant if B=0 and D=0 ;
(c) consistent and unique if D ≠ 0; and in this case the solution is given by
D
x i= i (i=1 , 2 , . . .. .. . , n)
D ,
Di can be obtained by replacing ith column by right hand side.
Explicit formulas for small systems

Consider the linear system {


a1 x+ b1 y=c 1
a2 x+ b2 y=c 2

13
Matrices, Vectors, Fourier Analysis Summer 2021-2022

which in matrix format is [ ][ ] [ ]


a1 b1 x
a2 b2 y
c
= 1
c2

Assume a 1 b 2−b1 a2 nonzero. Then, with help of determinants x and y can be found with Cramer's
rule as

x=
| |
c1 b1
c2 b2
=
c 1 b❑2−b1 c 2
∧ y=
| |
a1 c1
a2 c a c ❑2−c 1 a2
= 1 .
| | | |
a 1 b1 a1 b2−b1 a2 a1 b1 a1 b2−b1 a2
a 2 b2 a2 b2

The rules for 3 ×3 matrices are similar. Given

{
a1 x+ b1 y+ c 1 z=d1
a2 x+ b2 y+ c 2 z=d2
a3 x+ b3 y+ c 3 z=d 3

which in matrix format is

[ ][ ] [ ]
a1 b1 c1 x d1
a2 b2 c2 y = d2
a3 b3 c3 z d3

Then the values of x , y and z can be found as follows:

| | | | | |
d 1 b1 c1 a1 d 1 c 1 a1 b1 d1
d 2 b2 c2 a2 d 2 c 2 a2 b2 d2
d 3 b3 c3 a3 d 3 c 3 a 3 b3 d 3
x= , y= ∧z=

| | | | | |
a1 b 1 c 1 a 1 b1 c 1 a1 b1 c1
a2 b 2 c 2 a2 b2 c2 a2 b2 c2
a3 b 3 c 3 a 3 b3 c 3 a3 b3 c3

Similar idea can be extended for n × n systems

Example:
Let us demonstrate Cramer's rule with the following system:
x +2 y+ 3 z=1
−x +2 z =2
−2 y + z=−2
Step 1:

[ ]
1 2 3
The coefficient matrix of this system is A= −1 0 2
0 −2 1

14
Matrices, Vectors, Fourier Analysis Summer 2021-2022

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 A ; use the matrix manipulator in the tools
box if you would like help in this computation. You should get | A|=12. This is not zero, so
Cramer's rule may be applied here.
Step 3:

[ ]
1 2 3
| A x| −20 −5
A x= 2 0 2 and its determinant is | A x|=−20. Therefore x= = =
−2 −2 1 | A| 12 4
Step 4:
Using the same method, the values for the remaining 2 variables, x and y , are computed below:

[ ]
1 1 3
|A |
A y = −1 2 2 and its determinant is | A y|=13. Therefore y= y =−13
0 −2 1 | A| 12

[ ]
1 2 1
| A z| 2 1
A z= −1 0 2 and its determinant is | A z|=2. Therefore z= = =
0 −2 −2 | A| 12 6

Example: Verify whether the following system of linear equations is consistent or not. If consistent
then solve the system using Cramer’s rule. Also check your answer.
2 x−3 y−5 z=40
17 x +14 y−22 z=22
15 x+ 17 y−17 z=−18 .

Solution:
2 −3 −5
D=|17 14 −22| ≠0
15 17 −17 = 0 and . Therefore, this SLE is either inconsistent or more than one
solutions.

Example:
2 x−5 y+ 6 z=−27
10 x−11 y−9 z=0
−3 x+ 2 z=16
Solution:
2 −5 6
D=¿ |10 −11 −9 |¿ – 277 B≠ 0
−3 0 2 and and, therefore, this SLE has a unique solution.
−27 −5 6 2 −27 6 2 −5 −27
D1 =| 0 −11 −9 | D2 =|10 0 −9 | D3 =|10 −11 0 |
Now 16 0 2 ; −3 16 2 ; −3 0 16 .
¿ 2370 ; ¿ 1059 ; ¿ 1339.

15
Matrices, Vectors, Fourier Analysis Summer 2021-2022

2370 1059 1339


x=¿− y=– z=–
Thus 277 ; 277 ; 277 .

Example:
Solve the following system of linear equations using Cramer’s rule
2 x+ y+ z =3
x− y −z=0
x +2 y+ z =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 D be the determinant of the coefficient matrix of the above
system, and let D x be the determinant formed by replacing the x -column values with the answer-
column values: Evaluating each determinant, we get:

| |
2 1 1
D= 1 −1 −1 =3
1 2 1

| | | | | |
3 1 1 2 3 1 2 1 3
D x = 0 −1 −1 =3 , D y = 1 0 −1 =−6 , D z= 1 −1 0 =9
0 2 1 1 0 1 1 2 0

So, according to Cramer's rule:


Dx 3 D y −6 Dz 9
x= = =1 , y = = =−2∧z= = =3
D 3 D 3 D 3

Example:
Solve the following system of linear equations using Crammer’s rule
2 x+3 y + z=10
x− y + z=4
4 x− y−5 z=−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.

| | | | | |
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
x= = =2, y= = =1, z= = =3

| | | | | |
2 3 1 42 2 3 1 42 2 3 1 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.

16
Matrices, Vectors, Fourier Analysis Summer 2021-2022

{
x + y +z=6
x+2 y +3 z=10
x +2 y +λz=μ

Solution: The corresponding augmented matrix is

( | )
1 1 6 6
¿ r 2 → r 2−r 1 0 1 2 4
r 3 → r 3−r 2 0 0 λ−1 μ−10

The above system is in echelon form. Now we consider the following three cases:
λ=3 μ≠10 (1) 0=a a=μ−10≠0
(i) If and then third equation of is of the form , where
which is not true. So, the system is inconsistent. Thus, the system has no solution for
λ=3 μ≠10
and .
λ=3 μ=10 (1)
(ii) If and then third equation of is vanishes and the system will be in
echelon form having two equations in three variables. So, it has 3−2=1 free variables
z λ=3 μ=10
which is . Hence the given system has more than one solution for and .
z
λ≠3
(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 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
2 x +3 y +λz=3
Solution: The given system of liner equations is x +λy +3 z=2
Reduce the system to echelon form by means of elementary row operations,

¿¿
17
Matrices, Vectors, Fourier Analysis Summer 2021-2022

{
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:
(1) λ+ 3=0 λ=−3
(i) From third equation of , we see that if or then the equation becomes
0=5 λ=−3
, which is contradiction. Therefore, the system is inconsistent if . Thus, the
λ=−3
system has no solution for .
(ii) We know, if the number of variables is greater than the number of equations, then the
(1) λ=2
system has more than one solution. From third equation of , we see that if then it
0=0
becomes . In this case the system has three variables with two equations. So, the
λ=2
given system has more than one solution for .
(iii) We know, if the number of variables and the number of equations be equal, then the
(1)
system has unique solution. The system 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.

{
2 x +3 y +z=5
3 x− y +λz=2
x+7 y−6 z=μ

Solution: The given system of liner equations is

{
2 x +3 y +z=5
3 x− y +λz=2
x+7 y−6 z=μ
Reduce the system to echelon form by means of elementary operations,

18
Matrices, Vectors, Fourier Analysis Summer 2021-2022

¿ ¿
{
2 x +3 y + z=5
−11 y + (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:
z (1)
rd
(i) For a unique solution, the coefficient of in the 3 equation of 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 .
λ=8 μ=8 (1)
(ii) If and then third equation of 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 z .
λ=8 μ=8.
Hence the given system has more than one solution for and .
λ=8 μ≠8 (1) 0=a a=μ−8≠0
(iii) If and then third equation of is of the form , where
which is not true. So, the system is inconsistent. Thus, the system has no solution for
λ=8 μ≠8
and .

Example:
Find the values of k such that the following system of linear equations has non-zero solution.
x +ky +3 z=0
4 x+3 y + kz=0.
2 x+ y+ 2 z=0

Solution:
The augmented matrix C=[ A : B]

[ ]
1 k 3:0
~ 4 3 k :0
2 1 2:0
On interchanging first row and third row, we have

[ ]
2 1 2:0
~ 4 3 k :0
1 k 3:0
Reducing the system to row echelon form by the elementary row operations …

[ ][ ]
2 1 2
:0 R '2=R2−2 R1
0 1 k −4
~ :0 ' 1
1 R3=R3 − R 1
0 k− 2 :0 2
2

19
Matrices, Vectors, Fourier Analysis Summer 2021-2022

[ ]
2 1 2
:0
~
0 1 k−4

( )1
:0
0 0 2− k− (k −4 ) : 0
[ 1
R'3=R3 −(k − )R 2
2 ]
2
So,

( )
1
2− k − ( k−4 ) =0
2
2 9
⟹−k + k =0
2

9
⟹ k (−k + )=0
2
9
∴ k =0 ,
2

Example: A medicine company wishes to produce three types of medicine : type P , Q and R . To
manufacture a type P medicine requires 2 minutes each on machine I and II and 3 minutes on
machine III . A type of Q medicine requires 2 minutes on machine I , 3 minutes on machine II and 4
minutes of machine III . A type R medicine requires3 minutes on machine I , 4 minutes on machine II
and 3 minutes on machine III . There are 3.5 hours available on machine 1 , 4.5 hours available on
machine II and 5 hours available on machine III . 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 x , y and z be the number of medicines of types P, Q and R respectively. Then we have the

{
2 x +2 y+3 z=210
following system of linear equations: 2 x +3 y + 4 z=270
3 x+ 4 y +3 z=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 '
r 2=r 2 −r 1
0 1 1 : 60 '
0 2 −3 : −30 r 3=2 r 3 −3 r 1

[ ]
2 2 3 : 210
0 1 1 : 60 [ r 3=r 3−2 r 1 ]
'

0 0 −5 : −150
Hence the solution of the above system is x=30 , y=30 , z=30
Thus, the number of each type of medicine is 30.

20
Matrices, Vectors, Fourier Analysis Summer 2021-2022

Example: Determine the polynomial p ( x )=a 0+ a1 x +a 2 x 2whose graph passes through the points
(1,4) , (2 , 0) and (3,12).

Solution:
Given polynomial p ( x )=a 0+ a1 x +a 2 x 2
Substituting x=1 , 2 and 3 into p( x ) and the corresponding y− values produces the system of linear
a ,a
equations in the variables 0 1 and a 2 shown below:

{
p ( 1)=a0 + a1 ( 1 )+ a2 ( 1)2 =a0 +a1 + a2 =4
2
p ( 2)=a0 + a1 ( 2)+a2 ( 2) =a 0 +2 a1 + 4 a2 =0
2
p ( 3)=a0 +a1 ( 3)+a 2 ( 3 ) =a0 + 3 a1 + 9 a2 =12
Reducing this system to echelon form by the elementary operations,

{
a0 +a1 +a2 =4
a1 +3 a 2=−4 ¿ [ 2
L =L2 −L1 ¿ ] ¿ ¿
¿

¿
a1 + 5 a2 =12

{
a0 +a1 +a2 =4
a1 +3 a 2=−4 [ L3 =L3−L2 ]
¿

2 a2 =16
By back substitution method from 3rd equation, we have a 2= 8
From the 2nd equation, we get a 1 +24=−4 ∴ a1 =−28
and from 1st equation, we get
a 0−28+8=4 ∴ a0 =24
Hence, the solution of this system is
a 0=24 ,a 1=−28 and a 2=8 .
2
So, the polynomial function is p( x )=24−28 x +8 x
The graph p is shown in the following figure:

Example: Find the polynomial that fits the points (−2 , 3 ) , (−1 , 5 ) , ( 0 ,1 ) , ( 1 , 4 ) and ( 2 , 10 ).

Solution: We have provided five points, so we chose a fourth-degree polynomial function


2 3 4
p ( x )=a 0+ a1 x +a 2 x +a3 x + a4 x ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅(1)

21
Matrices, Vectors, Fourier Analysis Summer 2021-2022

Substitution the given points into p ( x ) products the system of linear equations listed below:
a 0−2 a1 +4 a2−8 a3 +16 a 4=3
a 0−a 1+ a2−a 3+ a4 =5
a 0=1
a 0+ a1 +a 2+ a3 +a 4=4
a 0+ 2 a1+ 4 a2+ 8 a3 +16 a 4=10
The solution of the above system is
−5 101 18 −17
a 0=1 , a1= , a 2= , a3 = , a4 =
24 24 24 24
Which means the polynomial function is
5 101 2 18 3 17 4 1 2 3 4
p ( x )=1− x+ x + x − x = (24−5 x +101 x +18 x −17 x )
24 24 24 24 24
The graph of p ( x ) is shown in the following figure:

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:
x 1+ x 2=20 junction 1
x 3 +20=x 4 junction 2
x 2+ x3 =10+10 junction 3
x 1 +10=x 5 junction 4
x 5 +10=x 4 junction 5
The augmented matrix is

22
Matrices, Vectors, Fourier Analysis Summer 2021-2022

[ ]
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
−20 ¿ [ 2 3 ¿ ] ¿
R ↔R ¿
0 0 1 −1 0 :
0 0 0 −1 1 : −10 ¿
1 0 0 0 −1 : −10

[ ]
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 [ R 5 =R5 +R2 ]
¿

0 0 0 −1 1 : −10
0 0 1 0 −1 : −10

[ ]
1 1 0 0 0 : 20
0 1 1 0 0 : 20
−20 ¿ [ 4
R =(−1) R4 ¿ ] ¿ ¿
1 −1 0 :
¿
0 0
0 0 0 1 −1 : 10 ¿
0 0 0 1 −1 : 10

[ ]
1 1 0 0 0 : 20
0 1 1 0 0 : 20
−10 ¿ [ 3 3 4 ¿ ] ¿
R =R +R ¿
0 −1 :
¿
0 0 1
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 [ R 2 =R2−R3 ] ¿

0 0 0 1 −1 : 10
0 0 0 0 0 : 0

23
Matrices, Vectors, Fourier Analysis Summer 2021-2022

[ ]
1 0 0 0 −1 : −10
0 1 0 0 1 : 30
0 0 1 0 −1 : −10 [ R 1 =R1−R2 ]
¿

0 0 0 1 −1 : 10
0 0 0 0 0 : 0
The corresponding system of equations are as follows:

{
x1 −x 5 ¿ −10
x2 x 5 ¿ 30
x3 −x 5 ¿ −10
x 4 −x 5 ¿ 10

The above system is in echelon form having 4 equations in 5 unknowns. So, it has (5−4 )=1 free
variable, which is
x5 .
Let 5
x =t ,
then by back substitution method, we have
x 4 =t +10 , x 3 =t−10 , x 2 =30−t , x 1=t−10 , where t is a real number.
So, this system has an infinite number of solutions.

Example:
I
Determine the currents I 1 , I 2 and 3 for the electrical network shown in the following figure.
Solution:
Applying Kirchhoff’s current law to each junction produces
I 1 + I 3=I 2 ; Junction 1 or junction 2
and applying Kirchhoff’s second law to two paths produces
R1 I 1 + R2 I 2 =3 I 1 + 2 I 2 =7 path 1
R2 I 2 + R 3 I 3 =2 I 2 +4 I 3 =8 path 2
So, we have the following system of three linear equations in
I
the I 1 , I 2 and 3

{
I 1 −I 2 + I3 ¿ 0
3I1 +2I2 ¿ 7
2I2 +4 I3 ¿ 8
The augmented matrix of the above system is

24
Matrices, Vectors, Fourier Analysis Summer 2021-2022

[ ]
1 −1 1 : 0
3 2 0 : 7
0 2 4 : 8
Reducing the system to echelon form by the elementary row operations

[ ]
1 −1 1 : 0
0 5 −3 : 7 [ R2 =R 2−3 R1 ] ¿

0 2 4 : 8

[ ]
1 −1 1 : 0
0 5 −3 : 7 [ R3 =5 R 3 −2 R 2 ] ¿

0 0 26 : 26

[ ][
1 −1 1 : 0
0
0
5
0
−3 : 7
1 : 1
1
R3 = R3
26
¿
]
[ ]
1 −1 0 : −1
0 : 10 ¿ [ 1 1 3 ¿ ] ¿
R =R −R ¿ ¿
0 5
0 0 1 : 1 ¿

[ ][
1 −1 0 : −1
0
0
1
0
0 : 2
1 : 1
1
R 2 = R2
5
¿
]
[ ]
1 0 0 : 1
0 1 0 : 2 [ R1 =R1 +R2 ] ¿

0 0 1 : 1
So, the solution of the above system is I 1=1 A ,
I 2=2 A and I 3=1 A .

Example:
I , I ,I , I , I
Determine the currents 1 2 3 4 5 and 6 for
I
the electrical network shown in the following
figure.

Solution:
Applying Kirchhoff’s current law to each junction produces
I 1 + I 3=I 2 junction 1
I 1 + I 4 =I 2 junction 2
I 3 + I 6 =I 5 junction 3
I 4 + I 6 =I 5 junction 4
and applying Kirchhoff’s second law to the three paths produces

25
Matrices, Vectors, Fourier Analysis Summer 2021-2022

{
2I1 +4 I2 ¿ 10 path 1
4 I 2 + I 3 +2 I 4 +2 I 5 ¿ 17 path 2
2I5 +4 I 6 ¿ 14 path 3
I 1 , I 2 , I 3 , I 4 , I 5 and I 6

{
Now we have the following system of seven linear equations in the variables
I1 −I 2 +I3 ¿ 0
I1 −I 2 +I4 ¿ 0
I3 −I +I6 ¿ 0
I4 −I 5 +I6 ¿ 0
2I1 +4 I2 ¿ 10
4 I2 +I3 +2 I 4 +2 I 5 ¿ 17
2I5 +4 I 6 ¿ 14
Using Gauss-Jordan elimination method, we have solution of the above system is
I 1=1 , I 2=2 , I 3=1 , I 4 =1 , I 5 =3 and I 6 =2
I =1 amp. I 4 =1 amp, I 5=3 amp and I 6 =2 amp.
which means I 1=1 amp, I 2=2 amp and 3

Example:
Determine the loop currents I 1 and I 2 of the following circuit using mesh analysis.
Solution:
For loop 1: 10 I 1 +20 I 1−20 I 2=70
⇒ 30 I 1−20 I 2 =70
⇒ 3 I 1−2 I 2=7

For loop 2: 20 I 2+20 I 2−20 I 1=−100


⇒−20 I 1+ 40 I 2=−100
⇒ I 1−2 I 2 =5
Thus, the system of linear equations is
3 I 1 −2 I 2=7
I 1−2 I 2=5
Therefore, I 1=1 A∧I 2=−2 A

Example:
I
Determine the loop currents I 1 , I 2 and 3 of the following circuit using mesh analysis.

26
Matrices, Vectors, Fourier Analysis Summer 2021-2022

Solution:
For loop 1: 10 I 1 +12 I 1 −10 I 2−12 I 3=24
⇒ 22 I 1−10 I 2−12 I 3=24
⇒ 11 I 1−5 I 2−6 I 3 =12

For loop 2: 24 I 2 +10 I 2 +4 I 2−10 I 1−4 I 3 =0


⇒−10 I 1 +38 I 2−4 I 3=0
⇒ 5 I 1−19 I 2 +2 I 3 =0

For loop 3: 12 I 3−12 I 1−4 I 2=−6


⇒ 12 I 1 + 4 I 2−12 I 3=6
⇒ 6 I 1 +2 I 2−6 I 3=3
Thus, the system of linear equation is
11 I 1−5 I 2−6 I 3=12
5 I 1 −19 I 2 +2 I 3=0
6 I 1+ 2 I 2−6 I 3=3

Hence solving the system, I 1=3.7 A , I 2=1.35 A , I 3=3.66 A .

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. 5 th
Avenue and 6th Avenue can each handle up to 2000 vehicles per hour without causing congestion,
whereas the maximum capacity of both 4 th 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.

x1 , x2 , x3 , x4
(a) Write a general expression involving the rates of flow 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.
27
Matrices, Vectors, Fourier Analysis Summer 2021-2022

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 + x 4
1300=x1 + x 2
1800=x2 +x 3
2000=x3 + x 4
x , x ,x ,x
This system of four linear equations in the four variables 1 2 3 4 may be written in the more
standard form
x1 +x 4 ¿ 1500
x 1 +x 2 ¿ 1300
x 2 +x 3 ¿ 1800
x 3 +x 4 ¿ 2000

28
Matrices, Vectors, Fourier Analysis Summer 2021-2022

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
0 1 1 0 1800 [ R 2 =R2−R1 ]
¿

0 0 1 1 2000

[ ]
1 0 0 1 1500
0 1 0 −1 −200
0 0
|
1 1 2000 [ R 3 =R3−R2 ]
¿

0 0 1 1 2000

[ ]
1 0 0 1 1500
0 1 0 −1 | −200
0 0 1 1 2000 [ R 4 =R4−R 3]
¿

0 0 0 0 0
The last augmented matrix is in row-reduced form and is equivalent to a system of three linear
x , x ,x ,x
equations in the four variables 1 2 3 4 . This we may express three of the variables-say,
x 1 , x 2 , x 3 in terms of x 4 . Setting x 4 =t (t a parameter), we may write the infinitely many solutions of
the system as
x 1=1500−t
x 2 =−200+t
x 3 =2000−t
x 4 =t

Observe that for a meaningful solution we must have 200≤t ≤1000 since
x 1 , x 2 ,x 3 and x 4 must all
be nonnegative and the maximum capacity of a street is 1000.
For example, picking t =300 gives the flow pattern
x 1=1200 , x 2 =100 , x 3 =1700 , x 4 =300
Selecting t =500 gives the flow pattern
x 1=1000 , x 2 =300 , x 3 =1500 , x 4 =500
x4
300 (a)
(b) In this case, must not exceed . Again, using results of part , we find, upon setting
x 4 =t =300 , x 1=1200 , x 2 =100 , x3 =1700 , x 4 =300
the flow pattern obtained earlier.
t =250 x 1=1250 , x 2 =50 , x 3 =1750 , x 4 =250 .
(c) Picking gives the flow pattern

29
Matrices, Vectors, Fourier Analysis Summer 2021-2022

Linear Programming Problem:


The linear programming is the modern method of mathematics to solve the system of linear
inequalities. The solution makes the objective linear function a minimum (or maximum) and which
satisfies the constraints and non-negative conditions.
General linear programming problems:
n
Let be Z a linear function by Z=∑ c i x i … … … … … … … (i)
i=1
where c iis set of n constants.
Let a ij be mn constants and b i be a set of m constants such that
a 11 x 1 +a 12 x 2+ … … … … … …+a 1n x n ( ≤ ,=,≥ ) b 1
a 21 x 1+ a22 x 2 +… … … … … …+ a2 n x n ( ≤ ,=, ≥ ) b2
………… ………………………………………… ………
………… ………………………………………… ………
a m 1 x 1+ am 2 x2 + … … … … … …+a mn x n (≤ ,=, ≥ ) b m
and finally let x 1 ≥ 0 , x 2 ≥ 0 , … … … … , x n ≥ 0 … … … … … ..(3)
(i) The problem of solving the values of x 1 , x 2 ,… , x n which make Z a minimum (or
maximum) and which satisfies equations (2) and (3) is called general linear
programming.
(ii) Z=c 1 x 1 +c 2 x 2 +… … …+ c n x n is called objective function.
(iii) System of linear inequalities eq n(2) is called constrains and in eq n(3) x i ≥ 0 is called non
negative restriction.
(iv) Solutions: Values of unknowns x 1 , x 2 ,… , x n which the constraints eqn(2) of a general
linear programming problem are called general solutions.
(v) Feasible solution: Any solution if GLPP which satisfies the non-negative restrictions of
the problem is called feasible solution of GLPP.
(vi) Optimum solution: Any feasible solution which optimizes (minimizes, maximizes) the
objective function is called optimum solution.

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

30
Matrices, Vectors, Fourier Analysis Summer 2021-2022

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:
Let
x = number of lamps L1
y = number of lamps L2
Objective function f ( x , y )=15 x+ 10 y

Convert the time from minutes to hours.

20 min = 1/3 h 30 min = 1/2 h 10 min = 1/6 h

L1 L2 Time

Manual 1/3 1/2 100

Machine 1/3 1/6 80

Writing the constraints as a system of inequalities we get

1 1
x + y ≤ 100
3 2

1 1
x + y ≤ 80
3 6

As the numbers of lamps are natural numbers, we have x ≥ 0∧ y ≥0

Represent the constraints graphically.

As x ≥ 0∧ y ≥0 , work in the first quadrant.

1 1
Solve the inequation graphically: x + y ≤ 100; and take a point on the plane, for example (0,0).
3 2

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.

31
Matrices, Vectors, Fourier Analysis Summer 2021-2022

The optimal solution, if unique, is a vertex. These are the solutions to systems:

1 1
x + y=100 ; x=0(0 ,200)
3 2

1 1
x + y=80; y=0(240 ,0)
3 6

1 1 1 1
x + y=100 ; x+ y=80 (210 , 60)
3 2 3 6

To determine which of them has the maximum or minimum values.

In the objective function, place each of the vertices that were determined in the previous step.

f (x , y )=15 x+ 10 y

f ( 0 ,200 )=15 ·0+ 10· 200=2000

f ( 240 , 0 )=15240+100=3,600

f (210 , 60)=15 ·210+10 · 60=3750

So, (210,60) is our required answer.

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

32
Matrices, Vectors, Fourier Analysis Summer 2021-2022

production capacity, the company can only manufacture 200 scientific and 170 handheld calculators
per day. The 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 = x
number of handheld calculators manufactured = y

Step 2: Identify the constraints on the decision variables.


The lower bound, as mentioned in the problem (there is an expected demand of at least 100 scientific
and 80 handheld calculators each day) are as follows.
Hence, x ≥ 100and y ≥ 80.
The upper bound owing to the limitations mentioned the problem statement (the company can only
manufacture 200 scientific and 170 handheld calculators per day) are as follows:
Hence, x ≤ 200and y ≤170.
In the problem statement, we can also see that there is a joint constraint on the values of x and y due
to the minimum order on a shipping consignment that can be written as:
x + y ≥ 200
Step 3: Write the objective function in the form of a linear equation.
In this problem, it is clearly stated that we have to optimize the net profit. As stated in the problem(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), the net profit function can be written as:
Profit (P) = −2 x+5 y

Step 4: Explicitly state the non-negativity restriction.


Since the calculator company cannot manufacture a negative number of calculators.
Hence, x ≥ 0 and y ≥ 0
Since we have formulated the problem, let’s convert the problem into a mathematical form to solve it
further.
Maximization of P = −2 x+5 y
subject to:
100 ≤ x ≤ 200
80 ≤ y ≤ 170
x + y ≥ 200

Step 5: Plot the constraints on the graph.


Let’s plot all the constraints defined in step 2 on a graph in a similar manner as we plot an equation.

33
Matrices, Vectors, Fourier Analysis Summer 2021-2022

Step 6: Highlight the feasible region on the graph.


After plotting the coordinates on the graph, shade the area that is outside the constraint limits (which
is not possible). The highlighted feasible area will look like this:

Step 7: Find the coordinates of the optimum point.


To find the coordinates of the optimum point, we will solve the simultaneous pair of linear equations.
Corner Points Equation, P = −2 x+5 y
A (100, 170) P = 650
B (200, 170) P = 450
C (200, 80) P=0
D (120, 80) P = 160
E (100, 100) P = 300
Step 8: Find the optimum point.
The above table shows that the maximum value of P is 650 that is obtained at
( x , y ) = A (100, 170).

Cryptographically Problem:
The process to write (encoded) and read (decoded) any secret messages by using matrices is known
as Cryptography.

Specific Aims: We will


 be able to encode a message using matrix multiplication;
 decode a coded message using the matrix inverse and matrix multiplication.

Algorithm to Encode a Message:


 Assign the numbers 1-26 to the letters (capital/small) in the alphabet given below and assign
the number 0 to a blank to provide for space between words.

34
Matrices, Vectors, Fourier Analysis Summer 2021-2022

A B C D E F G H I J K L M N
Blank
1 0 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

 Write the provided message corresponds to the sequence of numbers.


 Matrix, “A” (say) can be used as an encoding matrix, if elements are positive integer of the
considered matrix and inverse matrix exists.
 Divide the numbers in the sequence into groups of the order of matrix, “A” (or size of the
matrix) and use these groups as the columns of a matrix, “B” (say). Proceed down the
columns not across the rows.
 Write the provided message corresponds to the sequence. Then, multiply this matrix, “B” on
the left by matrix, “A”.
 Coded message will be written by picking the elements in each column from left of the
matrix “AB”.

Algorithm to Decode a Message:


 Find the inverse of encoding matrix, “A”, if exists.
 Divide the numbers in the sequence into groups of the order of matrix, “A” (or size of the
matrix) and use these groups as the columns of a matrix, “B” (say). Proceed down the
columns not across the rows.
 Multiply this matrix, “B” on the left by inverse matrix, “ A−1”.
 Writing the numbers in the columns of this matrix “ A−1 B” in sequence and using the letters
to correspondence numbers given below.

AO BP C QD ER F SG TH I U J VK W
Blank L MX NY Z
1150 2163 174 5
18 6197 20
8 92110 22
11 12
23 1324 1425 26

 These letters give decoded message.

Example: Encode the message SECRET CODE by using matrix A= [ 41 31].


Solution:

Step 1: The provided message “SECRET CODE ” corresponds to the sequence

S E C R E T space C O D E

19 5 3 18 5 20 0 3 15 4 5

35
Matrices, Vectors, Fourier Analysis Summer 2021-2022

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,

Step 3: Now,

 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.

Example: The encoded message is 7 6 28 20 23 5. Decode this message by using matrix,


A=
[ ]
1 1
1 0
.

Solution:

Step 1: When elements of the encoding matrix, A are positive and find inverse matrix of A .

−1
A =
[ 01 −11 ]
Step 2: The encoded message is 7 6 28 20 23 5.

Since the encoding matrix, A 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,

C=
[76 2820 235]
Step 3: Now,

36
Matrices, Vectors, Fourier Analysis Summer 2021-2022

A C=
−1
[ ][
0 1 7 28 23
1 −1 6 20 5
=
][
6 20 5
1 8 18 ]
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. 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. x 1 −3 x 2 =2 b. c.
−3 x 1 +9 x 2=3

Ans: Inconsistent Ans: Inconsistent Ans: Inconsistent

d. 2 x 1 −x 2 +3 x3 =5 e. −3 x+ 2 y −3 z=−8 f.
−x 1 +3 x 2 +5 x 3 =3 2 x− y+ z =4
x+2 y−4 z=−2
−4 x 1 +2 x 2 −6 x 3 =3 Ans.(2 , 2 ,2)

Ans: Inconsistent Ans: (3 , 1 ,2)

g. h. x +2 y+ 4 z=−13 i. x 1−x 2 +2 x 3 =5
3 x− y + z=5 2 x1 +x 2−x 3 =2
x+3 y =3
2 x1 −x 2 −x 3=4
Ans. (3 , 0 ,−4)
Ans. (−1 , 0 ,1) Ans: (2 ,−1 , 1)

j. 2 x− y − 5 z =4 k. 5 x+3 y=19 l. x 1 +2 x 2−2 x 3 =2


x + y +z=−3 2 x−7 y=−17 −x 1 +x 2 −2 x 3 =−1
−x − 4 y +z=4 Ans: (2 , 3)
x 1−4 x 2 −2 x 3 =8
Ans
: (−1 ,−1 ,−1) Ans: (2 ,−1 ,−1)

37
Matrices, Vectors, Fourier Analysis Summer 2021-2022

m. 2 x − 3 y + 4 z =8 n. 3 x+ y+ 2 z=14 o. x + y +z=0
2 y +5 z=22
3 x + 4 y −5z =−4 2 x+5 y −z=−22
x− y +z=0
5 x − 7 y +6 z =9 x + y−z=0
Ans:(2 ,−4 , 6)
Ans: (1 , 2, 3) Ans:(0 , 0 , 0)

p. −x + y −z =0 q. r. x + y+z=−1
3 x − y +2 z=−2 x− y+z=−5
2 x + 4 y +3 z =2 2 x+ y−z=5
Ans: (−2 , 0 , 2) Ans: (0 , 2 ,−3)
Ans: (−6 , 5 ,−1)

s. t. u. −x + 2 y +2 z =−2
3 x +2 y −z =9
x + 4 y +z =5
Ans: (2 , 1,−1)
Ans: (1 ,−1 , 2)
Ans: (−4 , 2 ,7)

2. 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: ( i ) λ=−2 , ( ii ) λ=1 , ( iii ) λ ≠1 , λ ≠−2.

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 −3 z=−3
2 x +λy −z =−2
x+2 y +λz=1 .
Ans: ( i ) λ=−5 , ( ii ) λ=2 , (iii ) λ ≠ 2 , λ ≠−5.

4. 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.

x + y + z=2
x+3 y + λz =6 .
x +2 y+ 3 z=μ

Ans: ( i ) λ=5 , μ ≠ 4 , ( ii ) λ=5 , μ=4 , (iii ) λ ≠ 5.

38
Matrices, Vectors, Fourier Analysis Summer 2021-2022

5. 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=λ
λx+ y+ z=λ2 .
Ans: ( i ) λ=−2 , ( ii ) λ=1 , ( iii ) λ ≠1 , λ ≠−2.

6. 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 x 3∧x 5 are free variables.

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.
a. b.

39
Matrices, Vectors, Fourier Analysis Summer 2021-2022

Ans: (a) Here x 3 is the free variable. The system has an infinite number of solutions. But to
remove negativity x 3must be between 0 ¿ 500.

(b) Here x 3 is the free variable. The system has an infinite number of solutions. But to
remove negativity x 3must be greater than 500.

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.

Ans: Here x 5 is the free variable. The system has an infinite number of solutions. But to
remove negativity x 5must start from 200.

10. 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 .

11. A company produces three products x , y , z every day. Their total production on a certain day
is 45 tons. It is found that the production of z exceeds the production of x by 8 tons while the
total production of ‘ x ’ and ‘ z ’ is twice the production of ‘ y ’. Determine the production
level of the each product.

40
Matrices, Vectors, Fourier Analysis Summer 2021-2022

Ans: x=1 ; y=15 ; z=19.

12. Determine the loop currents I 1 and I 2 of the following circuit using mesh analysis.
Where E1=28 , E 2=7 V , R 1=4 Ω, R2=1 Ω, R3=2 Ω .

Answer: I 1=−5 A , I 2=1 A .


13. Determine the loop currents using mesh analysis.

(a) E1=15 V , E2=6 V , E3 =10 V , R1=1 Ω, R2=2 Ω , R 3=2 Ω , R 4=2 Ω, R5=1 Ω .

(b) E1=15 V , E2=6 V , R1=1 Ω, R2=2 Ω , R3=2 Ω .

a) b)

Ans: (a) I 1=4.638 A , I 2=1.776 A , I 3=−2.844 A , (b) I 1=5.1 A , I 2=2.7 A .

41
Matrices, Vectors, Fourier Analysis Summer 2021-2022

14. Find the minimum and maximum values of the given objective function, subject to the
indicated constraints.
Objective function:
z=3 x +2 y
Constraints:
x≥0
y ≥0
x +3 y ≤ 15
4 x+ y ≤ 16
15. Find the minimum and maximum values of the given objective function, subject to the
indicated constraints.
Objective function:
z=4 x+ 3 y
Constraints:
x≥0
y ≥0
2 x+3 y ≥ 6
3 x−2 y ≤ 9
x +5 y ≤ 20

16.The company for production of electronic chips produces 2 types of graphics


cards (C1, C2), that are produced from 2 types of machines (M1, M2). The M1
machine produces a C1 graphics card for 1 min, C2 for 2 min. The M2 machine
produces a C1 graphics card for 3 min, C2 for 2 min. The C1 graphics card

𝑦 for C2) which maximizes the revenue generated from the production of
is sold for $20, C2 for $35. Determine the number of graphics cards (𝑥 for C1,

(Hints: 𝑥 + 2𝑦 ≤ 60, 3𝑥 + 2𝑦 ≤ 60, 𝑥 ≥ 0, 𝑦 ≥ 0 and the optimization


graphics cards for an hour.

equation is: z = 20𝑥 + 35𝑦)


Answer: The maximum value is: z ( 0 ,30 )=1050.
17.You are a civil engineer designing a bridge. The walkway needs to be made of
wooden planks. You are able to use either Sitka spruce planks (which weigh 3
pounds each), basswood planks (which weigh 4 pounds each), or a combination
of both. The total weight of the planks must be between 600 and 900 pounds in
order to meet safety code. If Sitka spruce planks cost $3.25 each and basswood
planks cost $3.75 each, how many of each plank should you use to minimize

(Hints: 3𝑥 + 4𝑦 ≥ 600, 3𝑥 + 4𝑦 ≤ 900, 𝑥 ≥ 0, 𝑦 ≥ and the optimization


cost while still meeting building code?

equation is: z = 3.25𝑥 + 3.75𝑦)


Answer: The minimum value is: z ( 0,150 )=¿ 562.50.

42
Matrices, Vectors, Fourier Analysis Summer 2021-2022

18. A storage solutions company manufactures large and small file folder cabinets.
Large cabinets require 50 pounds of metal to fabricate and small cabinets
require 30 pounds, but the company has only 450 pounds of metal on hand. If
the company can sell each large cabinet for $70 and each small cabinet for $58,
how many of each cabinet should it manufacture in order to maximize income?
(Hints: 50𝑥 + 30𝑦 ≤ 450, 𝑥 ≥ 0, 𝑦 ≥ 0 and the optimization equation is: z =
70𝑥 + 58𝑦)
Answer: The maximum value is: z ( 0 ,15 )=870.

19. A transport company has two types of trucks, Type A and Type B. Type A has a refrigerated
capacity of 20 m³ and a non-refrigerated capacity of 40 m³ while Type B has the same overall
volume with equal sections for refrigerated and non-refrigerated stock. A grocer needs to hire
trucks for the transport of 3,000 m³ of refrigerated stock and 4,000 m³ of non-refrigerated
stock. The cost per kilometer of a Type A is 30 and 40 for Type B. How many trucks of each
type should the grocer rent to achieve the minimum total cost?

20. Encode the message DO PRACTICE by using matrix, A= [ 11 10].


21. Encode the message HONESTY IS THE BEST POLICY by using matrix A= [ 11 10] given
above.

22. Encrypt the message GOOD STUDENTS by the provided matrix, B= [ 11 21].
23. The encoded message is 28 13 28 20 23 5. Decode this message by using matrix,
A=
[ ]
1 1
1 0
.

Supplementary:

MATLab command for finding unique solution (if exists) of a system of


equation:
3 x + 2 y − z =20
2 x +3 y −3 z =7
x − y +6 z =41
43
Matrices, Vectors, Fourier Analysis Summer 2021-2022

Ans: (5 , 6 , 7)

For Input Command Output

Coefficient matrix: >> A = [3 2 -1;2 3 -3;1 -1 6] A=

( )
3 2 −1 3 2 -1
A= 2 3 −3 2 3 -3
1 −1 6
1 -1 6
Right hand side matrix: >> B= [20;7;41] B=

()
20 20
B= 7 7
41
41
checking whether there >> if det(A)~=0 There exists a unique
exists a unique solution or disp ('There exists a solution for the given
not! unique solution for the system.
given system.')
else
disp ('There is no
unique solution for the
given system.')
end

()
x >> X=inv(A)*B X=
Solution set, X = y 5.0000
z
6.0000
where, X =A −1 B
7.0000

References:

 Linear Algebra and its applications by David C Lay


 Linear Algebra and its applications by Lay and Lay
 Linear Programming by Thomas S. Ferguson
 Linear Programming by George B. Dantzig, Mukund N. Thapa
 Operations Research by Ravindran, Phillips & Solberg
 Operations Research by H. Taha

44
Matrices, Vectors, Fourier Analysis Summer 2021-2022

45

You might also like