Chapter 3 Matrices
Chapter 3 Matrices
1
Matrix
• A Matrix is an array of numbers:
2
Matrix Operations
• Addition
• To add two matrices: add the numbers in the
matching positions:
3
Matrix Operations
• For addition and subtraction, the two matrices
must be the same size, i.e. the rows must match
in size, and the columns must match in size.
• Example: a matrix with 3 rows and 5
columns can be added to another matrix of 3
rows and 5 columns.
• But it could not be added to a matrix with 3
rows and 4 columns (the columns don't match
in size)
4
Matrix Operations
• Subtraction
• The negative of a matrix is also simple:
5
Matrix Operations
• Multiplication
• We can multiply a matrix by a constant (the
value 2 in this case):
We call the
constant a scalar,
so officially this is
called "scalar
multiplication".
6
7
Matrix Operations
• But to multiply a matrix by another matrix we
need to do the "dot product" of rows and
columns ... what does that mean? Let us see
with an example:
• To work out the answer for the 1st row and 1st
column:
8
Matrix Operations
13
Matrix Operations
• Transpose of a matrix
• To "transpose" a matrix, swap the rows and
columns.
• We put a "T" in the top right-hand corner to
mean transpose:
14
Matrix Operations
• Identity Matrix
• The "Identity Matrix" is the matrix equivalent of the
number "1":
16
Determinant of a Matrix
• What is it for?
• The determinant tells us things about the matrix that
are useful in systems of linear equations, helps us find
the inverse of a matrix, is useful in calculus and more.
• Symbol
• The symbol for determinant is two vertical lines
either side.
• Example:
• |A| means the determinant of the matrix A
17
Determinant of a Matrix
• Calculating the Determinant
• First of all the matrix must be square (i.e. have
the same number of rows as columns). Then it
is just basic arithmetic. Here is how:
18
Determinant of a Matrix
• For a 2×2 Matrix
• For a 2×2 matrix (2 rows and 2 columns):
19
Determinant of a Matrix
20
Determinant of a Matrix
• For a 3×3 Matrix
21
Determinant of a Matrix
22
Determinant of a Matrix
23
Inverse of a Matrix
What is the Inverse of a Matrix?
• This is the reciprocal of • The Inverse of a
a number: Matrix is the same
idea but we write it A-1
25
Inverse of a Matrix
• Definition
• 2x2 Matrix
• OK, how do we calculate the inverse?
• Well, for a 2x2 matrix the inverse is:
26
Inverse of a Matrix
29
Inverse of a Matrix
• The Inverse May Not Exist
• First of all, to have an inverse the matrix must
be "square" (same number of rows and
columns).
• But also the determinant cannot be zero (or
we end up dividing by zero). How about this:
30
Inverse of a Matrix
• 24-24? That equals 0, and 1/0 is undefined.
We cannot go any further! This Matrix has no
Inverse.
• Such a matrix is called "Singular", which only
happens when the determinant is zero.
31
Inverse of a Matrix
• Bigger Matrices
• The inverse of a 2x2 is easy ... compared to larger
matrices (such as a 3x3, 4x4, etc).
• For those larger matrices there are three main
methods to work out the inverse:
• Inverse of a Matrix using Elementary Row Operatio
ns (Gauss-Jordan)
• Inverse of a Matrix using Minors, Cofactors and
Adjugate
• Use a computer (such as the Matrix Calculator)
32
33
34
• Now we do our best to turn "A" (the Matrix on the left)
into an Identity Matrix. The goal is to make Matrix A
have 1s on the diagonal and 0s elsewhere (an Identity
Matrix) ... and the right hand side comes along for the
ride, with every operation being done on it as well.
• But we can only do these "Elementary Row
Operations":
• swap rows
• multiply or divide each element in a row by a constant
• replace a row by adding or subtracting a multiple of
another row to it
35
36
37
• And note: there is no "right way" to do this,
just keep playing around until we succeed!
• (Compare this answer with the one we got on
Inverse of a Matrix using Minors, Cofactors an
d
Adjugate. Is it the same? Which method do
you prefer?)
38
Assignment
39
40
41
42
Inverse of a Matrix
using Minors, Cofactors and Adjugate
• We can calculate the Inverse of a Matrix by:
• Step 1: calculating the Matrix of Minors,
• Step 2: then turn that into the Matrix of
Cofactors,
• Step 3: then the Adjugate, and
• Step 4: multiply that by 1/Determinant.
• But it is best explained by working through an
example!
43
Inverse of a Matrix
using Minors, Cofactors and Adjugate
• Example: find the Inverse of A:
45
Inverse of a Matrix
using Minors, Cofactors and Adjugate
• And here is the calculation for the whole
matrix:
46
Inverse of a Matrix
using Minors, Cofactors and Adjugate
• Step 2: Matrix of Cofactors
• This is easy! Just apply a
"checkerboard" of minuses to the
"Matrix of Minors". In other words,
we need to change the sign of
alternate cells, like this:
47
Inverse of a Matrix
using Minors, Cofactors and Adjugate
• Step 3: Adjugate (also called Adjoint)
• Now "Transpose" all elements of the previous
(cofactor matrix) matrix... in other words swap
their positions over the diagonal (the diagonal
stays the same):
48
Inverse of a Matrix
using Minors, Cofactors and Adjugate
• Step 4: Multiply by 1/Determinant
• Now find the determinant of the original matrix.
This isn't too hard, because we already calculated
the determinants of the smaller parts when we
did "Matrix of Minors".
50
Inverse of a Matrix
using Minors, Cofactors and Adjugate
• And now multiply the Adjugate by
1/Determinant:
52
Inverse of a Matrix
using Minors, Cofactors and Adjugate
53
Exercise
• Determine the inverse of the following matrix
by using elementary row operations and by
using minors and cofactors method
54
55
Application of Matrices
56
Application of Matrices
57
Application of Matrices Addition and
Subtraction
58
Application of Matrices Addition and
Subtraction
36 20
59
Application of Matrices Addition and
Subtraction
60
Application of Matrices Addition and
Subtraction
61
Application of Matrix Multiplication
62
Application of Matrix Multiplication
63
Application of Matrix Multiplication
60
93 64
Application of Matrix Multiplication
65
Application of Matrix Multiplication
66
Application of Matrix Multiplication
67
Application of Matrix Multiplication
68
Application of Matrices
69
Application of Matrices
70
Application of Matrices
71