What is a matrix?
A matrix is a rectangular array of elements
The elements may be of any type (e.g. integer, real, complex,
logical, or even other matrices).
In this course we will only consider matrices that have integer, real,
or complex elements.
5012
3492
3142
Specifying matrix elements
a
ij denotes the element of the matrix A on
the i
th
row and j
th
column.
A
column j
row i
501
234
926
314
•a
12
= 0
•a
21
= 2
•a
23
= -4
•a
32
= 2
•a
41
= 3
•a
43
= 4
Matrix operations: scalar multiplication
Multiplying an m n matrix by a scalar results in an m n matrix with each
of its elements multiplied by the scalar.
e.g.
826
12418
864
2010
413
629
432
105
2
1239
18627
1296
3015
413
629
432
105
3
Matrix operations: addition…
Adding or subtracting an m
…Matrix operations: multiplication…
Example 2
i.e. the number of columns in the first matrix must equal
the number of rows in the second matrix!
invalid!
113
201
124
862
351
…Matrix operations: multiplication…
Matrix multiplication is NOT commutative
In general, if A and B are two matrices then A B ≠ B A
i.e. the order of matrix multiplication is important!
e.g.
10
22
10
02
10
21
10
42
10
21
10
02
…Matrix operations: transpose…
If B = A
T
, then b
ij
=
a
ji
i.e. the transpose of an m
…Matrix operations: transpose…
(A B)
T
= B
T
A
T
Note the reversal of order.
Justification (not a proof):
e.g. if A is 3 2 and B is 2 4
then A
T
is 2 3 and B
T
is 4 2
so A
T
B
T
cannot be multiplied
but B
T
A
T
can be multiplied.
Special matrices: row and column
A 1
n matrix is called a
row matrix.
e.g.
An m
1 matrix is called a
column matrix.
e.g.
1 columns
3 rows
3
1
5
6 columns
1 rows
211215
Special matrices: square
An n
n matrix is called a
square matrix.
i.e. a square matrix has the same number
of rows and columns.
e.g.
4705
7350
0523
5031
211
010
210
21
32
1
Special matrices: diagonal
A square matrix is diagonal if non-zero elements only occur on the leading diagonal.
i.e. a
ij
= 0 for
i
≠
j
e.g.
Premultiplying a matrix by a diagonal matrix scales each row by the diagonal
element.
Postmultiplying a matrix by a diagonal matrix scales each column by the diagonal
element.
4000
0300
0020
0001
200
010
000
20
02
1
Special matrices: triangular
A
lower triangular
matrix is a square matrix having all elements
above the leading diagonal zero.
e.g.
An
upper triangular
matrix is a square matrix having all elements
below the leading diagonal zero.
e.g.
4705
0350
0023
0001
12
01
Special matrices: null
The null matrix, 0, behaves like 0 in arithmetic addition
and subtraction.
Null matrices can be of any order and have all of their
elements zero.
0000
0000
0000
0000
00
00
00
00
00
000
0
00
0
0
Special matrices: identity…
The identity matrix, I, behaves like 1 in arithmetic multiplication.
Identity matrices are diagonal. They have 1s on the diagonal and 0s
elsewhere.
e.g.
In the world of the matrix the identity truly is ‘the one’.
1000
0100
0010
0001
100
010
001
10
01
1
II
II
…Special matrices: identity
The identity matrix multiplied by any compatible matrix results in
the same matrix.
i.e. I A = A
e.g.
Any matrix multiplied by a compatible identity matrix results in the
same matrix.
i.e. A I = A
e.g.
Multiplication by the identity matrix is thus commutative.
51
13
51
13
10
01
51
13
10
01
51
13
Determinant of a 22 matrix…
Matrices can represent geometric transformations, such
as scaling, rotation, shear, and mirroring.
2 2 matrices can represent geometric transformations
in a 2–dimensional space, such as a plane.
Determinants of 2 2 matrices give us information
about how such transformations change the area of
shapes.
Determinants are also useful to define the inverse of a
matrix.
…Determinant of a 22
matrix…
The determinant of a 2 2 matrix is the product
of the 2 leading diagonal terms minus the
product of the cross- diagonal.
i.e. if A is a 2 2 matrix, then the determinant of
A is denoted by det(A)
= |
A|
=
a
11
a
22
–
a
21
a
12
e.g.
det
31
26
31
26
362120
det
25
13
25
13
231511
…Determinant of a 22 matrix
|A B| = |A| |B|
Note the order is not important.
Justification (not a proof):
We will shortly see that A and B can represent geometric
transformations, and A B represents the combined transformation of
B followed by A. The determinant represents the factor by which the
area is changed, so the combined transformation changes area by a
factor |A B|. Looking at the individual transformations, the area of
the first is changed by a factor |B|, and the second by |A|. The
overall transformation is thus changed by a factor |B| |A|, which is
the same as |A| |B|.
Inverse of a matrix
In arithmetic multiplication the inverse of a number c is 1/c
since
c 1/c = 1 and 1/c c = 1
For matrices the inverse of a matrix A is denoted by A
-1
A A
-1
= I
A
-1
A = I
where I is the identity matrix.
Multiplication of a matrix by its inverse is thus commutative.
We shall only consider the inverse of 2 2 matrices.
Inverse of a 22 matrix…
The inverse of a 2 2 matrix A is given by
Note:
The leading term is 1/determinant;
The diagonal elements are swapped;
The cross-diagonal elements change their sign.
a
11a
12
a
21a
22
1
1
a
11a
12
a
21a
22
a
22a
12
a
21a
11
…Inverse of a 22 matrix…
Example 2
Note that the determinant is zero so the inverse does
not exist for this matrix.
Matrices with zero determinant can have no inverse.
Such matrices are called singular.
22
33
1
1
22
33
32
32
1
0
32
22
invalid!
…Inverse of a 22 matrix…
(A B)
-1
= B
-1
A
-1
Note the reversal of order.
Justification (not a proof):
B
-1
A
-1
A B = B
-1
(A
-1
A) B = B
-1
B = I
so B
-1
A
-1
is the inverse of A B
i.e. (A B)
-1
= B
-1
A
-1
29
Matrix Solution of Linear
Systems
When solving systems of
linear equations, we can
represent a linear system of
equations by an
augmented
matrix
, a
matrix which stores the
coefficients and constants
of the linear system and
then manipulate the
augmented matrix to obtain
the solution of the system.
Example:
x + 3y = 5
2x – y = 3
1 3 5
2 13
The augmented matrix
associated with the above
system is
30
Generalization
Linear system:
Associated
augmented matrix:
11 12 1
21 22 2
a a k
a a k
2222121
1212111
kxaxa
kxaxa
Operations that Produce
Row-Equivalent Matrices
1. Two rows are interchanged:
2. A row is multiplied by a nonzero
constant:
3. A constant multiple of one row is added
to another row:
i j
R R
i i
kR R
j i i
kR R R
Augmented Matrix Method
Example 1
Solve
x + 3y = 5
2x – y = 3
1. Augmented system
2. Eliminate 2 in 2
nd
row by
row operation
3. Divide row two by -7 to
obtain a coefficient of 1.
4. Eliminate the 3 in first
row, second position.
5. Read solution from matrix
:
1 2
2 2
2 1 1
1 3 5
2 13
2
1 3 5
0 7 7
/ 7
1 35
0 11
3
102
2, 1;(2,1)
011
R R
R R
R R R
x y
R
2
Augmented Matrix Method
Example 2
Solve
x + 2y = 4
x + (1/2)y = 4
1.Eliminate fraction in second equation
by multiplying by 2
2.Write system as augmented matrix.
3.Multiply row 1 by -2 and add to row 2
4.Divide row 2 by -3
5.Multiply row 2 by -2 and add to row
1.
6.Read solution : x = 4, y = 0
7.(4,0)
2 4
1
4 2 8
2
1 24
2 18
1 2 4
0 30
1 24
0 10
1 04
0 10
x y
x y x y
Augmented Matrix Method
Example 3
Solve
10x - 2y = 6
-5x + y = -3
1. Represent as augmented matrix.
2. Divide row 1 by 2
3. Add row 1 to row 2 and replace row 2
by sum
4. Since 0 = 0 is always true, we have a
dependent system. The two equations
are identical, and there are infinitely
many solutions.
10 2 6
5 1 3
5 1 3
5 1 3
5 13
0 0 0
Augmented Matrix Method
Example 4
Solve
Rewrite second equation
Add first row to second row
The last row is the equivalent
of 0x + 0y = -5
Since we have an impossible
equation, there is no
solution. The two lines are
parallel and do not intersect.
5 2 7
5
1
2
x y
y x
5 2 7
5 2 2
5 2 7
5 2 2
5 2 7
0 0 5
x y
x y
Barnett/Ziegler/Byleen Finite
Mathematics 11e 36
Possible Final Matrix Forms for a
Linear System in Two Variables
Form
1:
Unique Solution
(Consistent and Independent)
1 0
0 1
m
n
Form
2:
Infinitely Many Solutions
(Consistent and Dependent)
1
0 0 0
m n
Form
3:
No Solution (Inconsistent)
1
0 0
m n
p