Matrices 1
Matrices 1
2. Determinants
3. Vector spaces
4. Linear Transformation
5. Orthogonality
CHAPTER ONE
Matrices and Systems of Linear Equations
Detailed Content:
Matrix algebra, addition and multiplication of matrices,
types of matrices, partitioned matrices, rank and trace
of a matrix, solving systems of linear equations: elimi-
nation, matrix methods, elementary row operations, row
reduction methods, Cramer’s rule, Echelon form.
1
Objectives
By the end of this topic, you will be able to:
e-References
Matrix Operations:
3
Proof:
Parts (a) - (c) are easy consequences of ordinary ad-
dition, as matrix addition is simply entry-wise addi-
tion. For part (d), we can consider the matrix A∗
obtained from A by multiplying each entry of A by
−1. ⊡
Exercise: Build up matrices A, B and C of your
choice and perform the above propositions.
Scalar Multiplication:
PROPOSITION: (MULTIPLICATION BY
SCALAR).
Suppose that A&B are m × n matrices, and that
c, d ∈ R. Suppose further that O represents the
m × n matrix with all entries zero. Then;
(a) c(A + B) = cA + cB.
(b) (c + d)A = cA + dA.
(c) 0A = O; and
(d) c(dA) = (cd)A.
Proof: These are all easy consequences of ordinary
multiplication, as multiplication by scalar c is simply
entry-wise multiplication by the number c.⊡
4
EER: Think about any two matrices: A3×4; B3×4
and scalars c = 2; d = −3. Check out the above
propositions.
Matrix Multiplication:
To multiply any two or more matrices, always check
for compartibility first.
5
Then A(B +C) = AB +AC.
(b) Suppose that A and B are m × n matrices and
C is an n × p matrix.
Then (A+B)C = AC +BC.
PROPOSITION: Suppose that A is an m × n
matrix, B is an n × p matrix, and that c ∈ R. Then
c(AB) = (cA)B = A(cB).
Exercise:
Formulate the following matrices of your own and per-
form the above propositions:
A2×2; B2×3; C3×4
Discussion Exercise:
Transpose of a matrix, AT .
An inverse Matrix
A diagonal matrix
A Symmetric matrix
6
Rank of a matrix
Trace of a matrix
2 Linear Equations
3x + 2y = 5;
6x + 4y = 5 :
It is easy to see that the two lines are parallel and do not
intersect, so that this system of two linear equations has
no solution.
Example 1.1.2.
Try to draw the two lines
3x + 2y = 5;
x+y =2:
It is easy to see that the two lines are not parallel and
intersect at the point (1; 1), so that this system of two
linear equations has exactly one solution.
Example 1.1.3.
8
Try to draw the two lines
3x + 2y = 5;
6x + 4y = 10 :
Generally
Consider a system of two nondegenerate linear equations
in two unknowns x and y, which can be put in the stan-
9
dard form
k1x + c1y = b1
k2x + c2y = b2
Then;
1. The system has exactly one solution iff
k1 c1
̸=
k2 c2
2. The system has no solution iff
k1 c1 b1
= ̸=
k2 c2 b2
3. The system has infinitely many solutions iff
k1 c1 b1
= =
k2 c2 b2
In general, we shall study a system of m linear equations
of the form
10
with n variables x1, x2, · · · , xn.
In Equation (1), we may not be able to see geometrically
what is going on (unlike the two dimensional case). We
therefore need to study the problem from a more algebraic
viewpoint.
If we omit reference to the variables, then system (1) can
be represented by the array
a11 a12 · · · a1n|b1
a
21 a22 · · · a2n|b2
(2)
. ... ... ...
..
am1 am2 · · · amn|bm
of all the coefficients. This is known as the augmented
matrix of the system. Here the first row of the array
represents the first linear equation, and so on.
We also write Ax = b, where
a11 a12 · · · a1n b1
21 a22 · · · a2n
a b
2
A= . ... . . . ... and b = .
.. ..
am1 am2 · · · amn bm
11
x1
x
2
and x = .
..
xn
A represent the coefficient matrix, b constant term and
X represents the variables.
Example 1.1.4.
The array
1 3 1 5 1|5
0 1 1 2 1|4
2 4 0 7 1|3
represents the system of 3 linear equations.
(Can you write down the equations? )
Note that the system can also be written as,
x
1
1 3 1 5 1 x2
5
0 1 1 2 1 x3 = 4
2 4 0 7 1 x4
3
x5
A solution to the system (1) is a list of values for the
12
unknown or a vector v = (k1, k2, k3, ....kn) such that x1 =
k1, x2 = k2, ...xn = kn. In that case, if v is a solution
vector, then it satisifies the equation, for example, a11k1 +
a12k2 + · · · + a1nkn = b1
(c1a11+c2a21+...+cmam1)x1+...+(c1a1n+c2a2n+...++cmamn)xn
Consider a system of equations with rows numbers L1, L2, ..., Lm,
then, the following operations on a system of linear equa-
tions are called elementary operations.
1. Interchange two of the equations, ie Li → Lj
2. Replace an equation by a nonzero multiple of itself ie
kLi → Li
3. Replace an equation by the sum of a multiple of an-
other equation and itself kLi + Lj → Lj . Also kLi +
nLj → Lj applies.
14
Let us continue with Example 1.1.4.
Example 1.2.1.
Let us interchange the first and second rows of the array
to obtain
0 1 1 2 1|4
1 3 1 5 1|5
2 4 0 7 1|3
Then this represents the system of equations
x2 + x3 + 2x4 + x5 = 4;
x1 + 3x2 + x3 + 5x4 + x5 = 5;
2x1 + 4x2 + 7x4 + x5 = 3;
(3)
Example 1.2.2.
Let us add 2 times the second row to the first row of the
15
array of Example 1.1.4 to obtain
1 5 3 9 3|13
0 1 1 2 1|4
2 4 0 7 1|3
This then represents the system of equations
Example 1.2.3.
Let us now multiply the second row of the array of Ex-
ample 1.1.4 by 2 to obtain
1 3 1 5 1|5
0 2 2 4 2|8
2 4 0 7 1|3
16
This then represents the system of equations
x1 + 3x2 + x3 + 5x4 + x5 = 5;
2x2 + 2x3 + 4x4 + 2x5 = 8;
2x1 + 4x2 + 7x4 + x5 = 3;
(5)
Triangular Form
Consider the following system of equation
The leading unknowns in the system, x1, x3, x4, are called
pivot variables, and the other unknowns, x2 and x5, are
called free variables.
Definition:
A rectangular array of numbers is said to be in row
echelon form if the following conditions are satisfied:
(1) The left-most non-zero entry of any non-zero row has
value 1. These are called the pivot entries.
(2) All zero rows are grouped together at the bottom of
18
the array.
(3) The pivot entry of a non-zero row occurring lower in
the array is to the right of the pivot entry of a non-zero
row occurring higher in the array.
19
Consider the array (2) corresponding to the system (1).
(a) Interchanging the ith and j th rows of (2) corre-
sponds to interchanging the ith and j th equations in
(1).
(b) Adding a multiple of the ith row of (2) to the j th
row corresponds to adding the same multiple of the ith
equation in (1) to the j th equation.
(c) Multiplying the ith row of (2) by a non-zero con-
stant corresponds to multiplying the ith equation in
(1) by the same non-zero constant.
In all three cases, the collection of solutions to the system
(1) remains unchanged.
20
to either yield a degenerate equation with no solution
or an equivalent simpler system in triangular or echelon
form.
Backword eliminataion which is a back-substitution
to find the solution of the simpler system.
It involves the following steps
1. Find the first unknown in the system with a nonzero
coefficient (maybe x1)
2. If the first unknown (say x1) has zero coefficient in
the first equation, interchange with another equation so
that the first unknown (say x1) appears with a nonzero
coefficient in the first equation.
3. Use x1 as a pivot variable with coefficeint say (a11)
and eliminate x1 from all other equations except the first
one.
4. Examine each new equation that do not have x1. If any
equations takes the form 0x1 + 0x2 + ... + 0xn = b ∀b ̸= 0
then the sytem has no solution so stop the computation.
Otherwise, if b = 0 or if any equation is a product of the
other, then delete that equation from the system.
Example:
21
Solve the system using Gaussian elimination
x − 3y − 2z = 6
2x − 4y − 3z = 8
−3x + 6y + 8z = −5
x − 3y − 2z = 6
2y + z = −4
−3y + 2z = 13
3/2L2 + L3 → L3
x − 3y − 2z = 6
2y + z = −4
7z = 14
22
Solve
x + 2y − 3z = 1
2x + 5y − 8z = 4
3x + 8y − 13z = 7
x + 2y − 3z = 1
y − 2z = 2
2y − 4z = 4
x + 2y − 3z = 1
y − 2z = 2
23
U = (−3 − k, 2 − 2k, k) ∀k ∈ R.
x1 + 3x2 + x3 + 5x4 + x5 = 5;
x2 + x3 + 2x4 + x5 = 4;
2x1 + 4x2 + 7x4 + x5 = 3;
(6)
x1 + 3x2 + x3 + 5x4 + x5 = 5;
x2 + x3 + 2x4 + x5 = 4;
x4 + x5 = 1;
(10)
x4 + x5 = 1.
x2 + x3 = 2 + t.
x1 = −6 + t + 2s.
26
Hence
x1 − 2x3 − x5 = −6;
x2 + x3 − x5 = 2;
x4 + x5 = 1;
(11)
x4 + x5 = 1.
x2 + x3 = 2 + t.
x1 = −6 + t + 2s.
Hence
Definition:
A rectangular array of numbers is said to be in reduced
row echelon form if the following conditions are satisfied:
(1) The left-most non-zero entry of any non-zero row has
28
value 1. These are called the pivot entries.
(2) All zero rows are grouped together at the bottom of
the array.
(3) The pivot entry of a non-zero row occurring lower in
the array is to the right of the pivot entry of a non-zero
row occurring higher in the array.
(4) Each column containing a pivot entry has 0’s every-
where else in the column.
We now investigate how we may reduce a given array to
reduced row echelon form. Here, we basically take an
extra step to convert an array from row echelon form to
reduced row echelon form. We shall illustrate the ideas
by continuing on an earlier example.
Example 1.4.1:
Consider
0 0 5 0 15 5
0 2 4 7 1 3
.
0 1 2 3 0 1
0 1 2 4 1 2
29
This can be reduced to row echelon form
0 1 2 4 1 2
0 0 1 0 3 1
.
0 0 0 1 1 1
0 0 0 0 0 0
Step 1: Cover all zero rows at the bottom of the array.
We now have
0 1 2 4 1 2
0 0 1 0 3 1
.
0 0 0 1 1 1
× × × × × ×
Step 2: We now try to make all the entries above the
pivot entry on the bottom row zero (here again we do not
count any covered rows). This can be achieved by adding
suitable multiples of the bottom row to the other rows.
So let us add −4 times row 3 to row 1 to obtain
0 1 2 0 −3 −2
0 0 1 0 3 1
.
0 0 0 1 1 1
× × × × × ×
30
Step 3: Now cover the bottom row. We then obtain
0 1 2 0 −3 −2
0 0 1 0 3 1
.
× × × × × ×
× × × × × ×
Step 4: Repeat Steps 2–3 on the uncovered array, and
as many times as necessary so that eventually the whole
array gets covered. So let us continue. Following Step 2,
we add −2 times row 2 to row 1 to obtain
0 1 0 0 −9 −4
0 0 1 0 3 1
.
× × × × × ×
× × × × × ×
Following Step 3, we cover row 2 to obtain
0 1 0 0 −9 −4
× × × × × ×
.
× × × × × ×
× × × × × ×
31
Following Step 2, we do nothing!! Following Step 3, we
cover row 1 to obtain
× × × × × ×
× × × × × ×
.
× × × × × ×
× × × × × ×
Step ∞ :
Uncover everything! We then have
0 1 0 0 −9 −4
0 0 1 0 3 1
.
0 0 0 1 1 1
0 0 0 0 0 0
in reduced row echelon form.
Again, in practice, we do not actually cover any entries of
the array, so repeat the same argument without covering
anything!!
The method described above is called the Gauss-Jordan
elimination.
32
5 Solving a System of Linear Equations
33
reduced to row echelon form, and that this contains a
row of the form
0| ·{z
·· 0} 1
n of them
0x1 + · · · + 0xn = 1,
34
representing the system
x2 − 9x5 = −4;
x3 + 3x5 = 1;
x4 + x5 = 1
35
Consider the system of 4 linear equations
5x3 + 15x5 = 5;
2x2 + 4x3 + 7x4 + x5 = 3;
x2 + 2x3 + 3x4 = 1;
x2 + 2x3 + 4x4 + x5 = 2;
(12)
36
representing the system
x2 + 2x3 + 4x4 + x5 = 2;
x3 + 3x5 = 1;
x4 + x5 = 1;
(15)
x2 − 9x5 = −4;
x3 + 3x5 = 1;
x4 + x5 = 1;
(17)
(x1, x2, x3, x4, x5) = (s, 9t−4, −3t+1, −t+1, t); s, t ∈ R
EER:
Solve the system
38
6 Homogeneous Systems
x1 = x2 = · · · = xn = 0.
39
Indeed, if we reduce the array (19) to row echelon form
or reduced row echelon form, then it is not difficult to see
that the last column is a zero column and so cannot be
a pivot column.
On the other hand, if the system (18) has a non-trivial so-
lution, then we can multiply this solution by any non-zero
real number different from 1 to obtain another non-trivial
solution. We have therefore proved the following simple
result.
PROPOSITION 1B:
The homogeneous system (18) either has the trivial
solution as its only solution or has infinitely many
solutions.
The purpose of this section is to discuss the following
stronger result.
PROPOSITION 1C:
Suppose that the system (18) has more variables than
equations; in other words, suppose that n > m. Then
there are infinitely many solutions.
To see this, let us consider the array (19) representing the
system (18). Note that (19) has m rows, corresponding
40
to the number of equations. Also (19) has n + 1 columns,
where n is the number of variables. However, the col-
umn of (19) on the extreme right is a zero column, cor-
responding to the fact that the system is homogeneous.
Furthermore, this column remains a zero column if we
perform elementary row operations on the array (19). If
we now reduce (19) to row echelon form by elementary
row operations, then there are at most m pivot columns,
since there are only m equations in (18) and m rows in
(19). It follows that if we exclude the zero column on the
extreme right, then the remaining n columns cannot all
be pivot columns. Hence at least one of the variables is
a free variable. By assigning this free variable arbitrary
real values, we end up with infinitely many solutions for
the system (18).
41
examples are the pattern of traffic flow through a city
and distribution of products from manufacturers to con-
sumers through a network of wholesalers and retailers.
A network consists of a set of points, called the nodes, and
directed lines connecting some or all of the nodes. The
flow is indicated by a number or a variable. We observe
the following basic assumptions:
Example:
The picture below represents a system of one way streets
in a particular part of some city and the traffic flow along
the streets between the junctions:
We first equate the total flow into each node with the
total flow out of the same node:
We then equate the total flow into and out of the network:
x1 + x2 − x3 = 200;
x2 − x4 = 100;
x3 − x5 = 100;
x4 − x5 = −200;
x1 = 400;
(20)
43
From which you can find the general solution (x1, · · · , x5) =
(400, t − 100, t + 100, t − 200, t), where t ≥ 200.
EER:
The picture below represents the quantities of a partic-
ular product that flow from manufacturers M1, M2, M3,
through wholesalers W1, W2, W3 and retailers R1, R2, R3, R4,
to consumers:
Equating the total flow into each node with the total flow
out of the same node:
We then equate the total flow into and out of the network:
Where the general solution (x1, · · · , x8) = (t−100, 100, 600, 400, t−
300, 100, 500, t), where t ≥ 300.
46
to be positive if the positive direction of the loop is
from + to −, and negative if the positive direction
of the loop is from − to +.
Example 1.8.1:
Consider the electric circuit shown in the diagram below:
Next, let us consider the right hand loop, and let us take
the positive direction to be clockwise. By Ohm’s law,
the voltage drop across the 20Ω resistor is 20I3, while the
voltage drop across the 4Ω resistor is −4I2. On the other
hand, the voltage drop across the 16V electrical source is
negative, since the positive direction of the loop is from
− to +. The Voltage law applied to this loop now gives
20I3 − 4I2 − 16 = 0, and we have the linear equation
48
We now have a system of three linear equations
I1 − I2 − I3 = 0;
2I1 + I2 = 5;
I2 − 5I3 = −4.
(21)
I1 + I2 − I3 = 0.
Next, let us consider the left hand loop, and let us take
the positive direction to be clockwise. By Ohm’s law,
49
Figure 4: Electric Flow 2
Next, let us consider the outer loop, and let us take the
positive direction to be clockwise. By Ohm’s law, the
voltage drop across the 8Ω resistor on the top is 8I1,
50
the voltage drop across the 8Ω resistor on the right is
8I3, while the voltage drop across the 8Ω resistor is 5I1.
On the other hand, the voltage drop across the 30V and
20V electrical sources are both negative, since the positive
direction of the loop is from − to + in each case. The
Voltage law applied to this loop now gives 8I1 + 8I3 +
5I1 − 50 = 0, and we have the linear equation
I1 + I2 − I3 = 0;
13I1 − 6I2 = 20;
13I1 + 8I3 = 50.
(22)
51
EER:
52
c) Use your answer in part (b) to solve the system of
linear equations.
53
4. Solve the following system of linear equations
x1 − x2 − 7x3 + 7x4 = 5;
−x1 + x2 + 8x3 − 5x4 = −7;
3x1 − 2x2 − 17x3 + 13x4 = 14;
2x1 − x2 − 11x3 + 8x4 = 7.
54
9 Machine Learning Application
55