Professional Documents
Culture Documents
Matrices
1 2 3
A=
5 6 7
(ii) Heres a 3 3 square matrix:
1 2 3
A=5 6 7
8 9 10
(iii) Column vectors are matrices with only one column:
1
b=5
8
(iv) Row vectors are matrices which only have one row:
b = (1 2 3) .
Unless specifically stated otherwise, we will assume that vectors are column vectors.
1.1
.
.
.
.
..
..
. . ..
.
am1 am2 am3 . . . amn
We refer to the elements via double indices as follows
(i) The first index represents the row.
(ii) The second index represents the column.
Example
a32 is the element in row 3, column 2 of the matrix A.
Notation/Conventions:
Use lowercase boldface (or underlined) letters for vectors
a b c
(or
a,
b,
c)
B C
(or
A,
B,
C)
is a vector element
is a matrix element
1.2
1 0 0 ... 0 0
0 1 0 ... 0 0
1 0 0
0
0
1
.
.
.
0
0
I = 0 1 0 , I = .. .. .. . . .. ..
. . . . . .
0 0 1
0 0 0 ... 1 0
0 0 0 ... 0 1
All elements of the zero matrix, 0, are equal to zero, e.g.
0 0 0 ... 0 0
0 0 0 ... 0 0
0 0 0
0
0
0
.
.
.
0
0
0 = 0 0 0 , 0 = .. .. .. . . .. ..
. . . . . .
0 0 0
0 0 0 ... 0 0
0 0 0 ... 0 0
A diagonal matrix only has non-zero elements on the main
diagonal. These non-zero elements can have any value, e.g.
d11 0 . . .
0
0
0
0
d11 0 0
0 d22 . . .
.
.
.
.
.
..
..
..
..
D = 0 d22 0 , D = ..
0 0 d33
0 0 . . . dn1,n1 0
0 0 ...
0
dnn
are square diagonal matrices.
1.3
Matrix equality
Two matrices are equal if they have the same size and if their
corresponding elements are identical , i.e.
A=B
if and only if
aij = bij
A=
A+B=
1 2 3
5 6 7
B=
1 + 10 2 + 1 3 + 23
5 + 5 6 + 16 7 + 3
1.4
10 1 23
5 16 3
11 3 26
10 22 10
Example
1 2 3
A=
5 6 7
31 32 33
3 6 9
3A=
=
35 36 37
15 18 21
1.3.4 Matrix Vector multiplication
Before defining the product of a matrix and a vector, let us
recall the notion of the dot product (or, scalar product) of two
vectors.
Let a Rn and b Rn be two column vectors with n real
elements each:
a1
b1
a
b
2
2
a = a3 ,
b = b3 .
..
..
.
.
an
bn
1.5
T
a1
a
2
T
a = a3 = a1 a2 a3 . . . an .
..
.
an
Then the product of the row vector aT and the column vector
b can be defined as follows:
def
(2)
Example
2
5
5
a = 1 , b =
2 ; a b = 2 1 3 2
3
4
4
5
2
= 1 2 = 10 2 12 = 4.
4
3
1.6
m1
aT1
aT2
A = ..
.
aTm
aT1
aT2
A x = .. = b
.
aTm x
for i = 1, ..., m.
j=1
1.7
(3)
Example
A=
1 2 3
5 6 7
3
x=2
4
( 1 2 3 ) 2
1 2 3
4
.
Ax =
2 =
5 6 7
3
4
( 5 6 7 ) 2
4
The vector products are simply the dot products of the respective row aTi with the column vector x
13+22+34
Ax =
53+62+74
and hence
b=
3 + 4 + 12
15 + 12 + 28
1.8
19
55
x
A b
Example
A=
1 2 3
5 6 7
3
x=2
4
Evaluate Ax as follows:
3
2
4
1 2 3
5 6 7
Now place the elements of the resulting vector at the intersection of the column vector and the rows of the matrix:
1 2 3
5 6 7
3
2
4
13+22+34
19
=
53+62+74
55
1.9
mp
A=
1 2 3
5 6 7
1 2 3
B=5 6 7
8 9 10
23
33
1 2 3 2
C=5 6 7 2
8 9 10 7
5
D=
8
3
34
9
7
42
We can form
AB the result is a 2 3 matrix
AC the result is a 2 4 matrix
CD the result is a 3 2 matrix
It is not possible to form
BA
or
1.10
AD
T
a1
T
a2
A = .. and B = b1 b2 . . . bp
.
aTm
then the matrix matrix product is
aT1
aT2
b1
b1
aT1
aT2
bp
bp
AB = ..
Rmp
.
.
.
.
aTm b1 aTm b2 . . . aTm bp
Element-wise this is
n
X
aij bjk = cik
b2 . . .
b2 . . .
...
...
aT1
aT2
j=1
1.11
(4)
Example
A=
1 2
3 4
B=
4 3 2
2 1 1
4
3
(1
2)
(1
2)
2
1
AB =
4
3
(3 4)
(3 4)
2
1
(1 2)
2
1
2
(3 4)
1
AB =
34+42 33+41 32+41
Giving the final result
C=
20
13
10
1.12
B
A C
Example
A=
1 2
3 4
B=
4 3 2
2 1 1
Evaluate AB as follows
4
3
2
2
1
1
1 2 (1 4 + 2 2) (1 3 + 2 1) (1 2 + 2 1)
3 4 (3 4 + 4 2) (3 3 + 4 1) (3 2 + 4 1)
Place the elements at the intersection of the rows of the left
matrix and the columns of the right matrix
The result
4
3
2
2
1
1
1 2 (1 4 + 2 2) (1 3 + 2 1) (1 2 + 2 1)
3 4 (3 4 + 4 2) (3 3 + 4 1) (3 2 + 4 1)
therefore gives
AB =
8 5 4
20 13 10
1.13
1 2
2 2
12+23 12+21
=
4 1
3 1
42+13 42+11
8 4
=
11 9
2 2
3 1
1 2
4 1
21+24 22+21
=
31+14 32+11
10 6
=
7 7
1 1
1 1
0 0
=
2 2
1 1
0 0
1 1
1 1
1 1
2 2
1.14
1 1
1 1
1 1
2 2
1 1
2 2
2 1
2 2
3 0
1 3
4 3
8 6
4 3
8 6
distributive law
A(BC) = (AB)C
associative law
1.15
T
A = a13 a23 a33 . . . am3
..
...
... . . . ...
.
A=
1 2 3
5 6 7
1 5
AT = 2 6
3 7
3 2 1
A= 2 7 0
1 0 8
The matrix transpose also satisfies the following rules:
i) (AT )T = A for any matrix A;
ii) (A + B)T = AT + BT and (AB)T = BT AT ,
provided that matrices A and B have compatible dimensions.
1.16
?<
T
(AB) =
aT1
aT1
...
b1 aT2
b2 aT2
b1 . . .
b2 . . .
...
...
aTm b1
aTm bp
...
bT1
bT2
a1 bT1
a1 bT2
am
am
T
(AB) = ..
.
..
.
bTp a1 bTp a2 . . . bTp am
since
bT1
bT2
= B T AT
B = ..
.
bTp
T
a2 . . .
a2 . . .
...
...
bT1
bT2
and AT =
a1 a2 . . . am .
>?
a11 a12
A=
a21 a22
is written det A or |A| or
a11 a12
1 2
4 7
det A = 7 8 = 15.
a21 a23
a21 a22
a22 a23
a12
+ a13
= a11
a31 a32
a32 a33
a31 a33
= a11(a22a33 a32a23) a12(a21a33 a31a23)
+ a13(a21a32 a31a22)
That is the 3 3 determinant is defined in terms of determinants of 2 2 sub-matrices of A. These are called the minors
of A.
1.18
Example
a21 a23
2+3
1.19
General determinant
The value of an n n determinant equals the sum of the products of the elements in any row (or column) and their cofactors, i.e.
n
X
|A| =
aij cij , for i = 1, . . . , n 1, or n
j=1
or
|A| =
n
X
aij cij ,
for
j = 1, . . . , n 1, or n
i=1
Example
For a 3 3 matrix
det A = a11c11 + a12c12 + a13c13
(1st row)
or
det A = a12c12 + a22c22 + a32c32
(2nd column)
Points to note:
the determinant det A is equal to zero if
(i) rows or columns of A are multiples of each other,
(ii) rows or columns are linear combinations of each other,
(iii) entire rows or columns are zero;
if det A = 0 the matrix A is called a singular matrix;
for any square matrices A and B there holds
det A = det(AT ),
A=
is given by
3 2
7 5
B = A1 =
5 2
7 3
since
5
2
7
3
AB =
3 2 (3 5 2 7) (3 2 + 2 3)
7 5 (7 5 5 7) (7 2 + 5 3)
which gives
AB =
1 0
0 1
as required.
1.21
=I
CT
=
det A
1 1 2
A = 3 1 2 .
3 2 1
1 2
3 2
3 1
(1)
det A = 1
3 1 + 2 3 2
2 1
= 1 3 + 1 (3) + 2 3
=6
Since the determinant is nonzero an inverse exists.
1.22
3 2
1
2
2 1 3 1
1 2 1 2
M=
2 1 3 1
1 2 1 2
1 2 3 2
3 3 3
= 5 7 1
4 8 2
3 1
3 2
1 1
3 2
1 1
3 1
3 3 3
C = 5 7 1 .
4 8 2
It follows that
A1
3 5 4
1
1
= CT = 3 7 8 .
6
6
3 1 2
1 0 0
1 1 2
3 5 4
1
A1A = 3 7 8 3 1 2 = 0 1 0 .
6
0 0 1
3 2 1
3 1 2
This way of computing the inverse is only useful for hand
calculations in the cases of 2 2 or 3 3 matrices.
1.23