452
Relations, Functions, and Matrices
An n × n matrix a is invertible if there exists an n × n matrix b such that
a # b = b # a = i
In this case b is called the inverse of a, denoted by a
−1
.
■
PRaCtiCe 53 Let
i = c
1 0
0 1
d a = c
a 11 a 12
a 12 a 22
d
Verify that i # a = a # i = a.
example 71
Let
a = £
−1
2 −3
2
1
0
4 −2
5
§
b = £
−5
4 −3
10 −7
6
8 −6
5
§
Then, following the rules of matrix multiplication, it can be shown (Practice 54)
that a # b = b # a = i, so b = a
−1
.
■
PRaCtiCe 54 For the matrices A and B of Example 70,
a. Compute a # b.
b. Compute b # a.
It is easy to write an algorithm for matrix multiplication by simply following the definition. A pseudocode version of the algorithm follows, where bracket
notation A3i, j 4 replaces the subscript notation a ij .
algoRIthm MaTrixMulTiplicaTioN
//computes n × p matrix A # B for n × m matrix A, m × p matrix B
//stores result in C
for i = 1 to n do
for j = 1 to p do
C3i, j 4 = 0
for k = 1 to m do
C3i, j 4 = C3i, j 4 + A3i, k 4 * B3k, j 4
end for
end for
end for
write out product matrix C
Relations, Functions, and Matrices
An n × n matrix a is invertible if there exists an n × n matrix b such that
a # b = b # a = i
In this case b is called the inverse of a, denoted by a
−1
.
■
PRaCtiCe 53 Let
i = c
1 0
0 1
d a = c
a 11 a 12
a 12 a 22
d
Verify that i # a = a # i = a.
example 71
Let
a = £
−1
2 −3
2
1
0
4 −2
5
§
b = £
−5
4 −3
10 −7
6
8 −6
5
§
Then, following the rules of matrix multiplication, it can be shown (Practice 54)
that a # b = b # a = i, so b = a
−1
.
■
PRaCtiCe 54 For the matrices A and B of Example 70,
a. Compute a # b.
b. Compute b # a.
It is easy to write an algorithm for matrix multiplication by simply following the definition. A pseudocode version of the algorithm follows, where bracket
notation A3i, j 4 replaces the subscript notation a ij .
algoRIthm MaTrixMulTiplicaTioN
//computes n × p matrix A # B for n × m matrix A, m × p matrix B
//stores result in C
for i = 1 to n do
for j = 1 to p do
C3i, j 4 = 0
for k = 1 to m do
C3i, j 4 = C3i, j 4 + A3i, k 4 * B3k, j 4
end for
end for
end for
write out product matrix C
