MAT251 Notes on 3.3 Matrices [and matrix multiplication] A matrix is

MAT251 Notes on 3.3 Matrices [and matrix multiplication]
A matrix is a rectangular array with m horizontal rows and n vertical columns. The
element in the ith row and jth column is denoted a i j or a[i, j], and the matrix is denoted by
A = [a i j] or A =
. Matrices provide a convenient way to store data of
various sorts, and the set of all matrices of a given size has a rich algebraic structure. We
consider briefly only a few properties of matrices that are useful in discrete mathematics.
Matrices of a given size can be added by adding the corresponding entries:
Addition of two matrices of different sizes is not defined.
Clearly a matrix can be added to itself; that is, A+A results in a matrix in which each
element is double the corresponding element in A. This generalizes to another operation called
.
scalar product:
An important use of matrices in discrete mathematics is representing a digraph by an
adjacency matrix. Such matrices will always have as many rows and columns as the number of
vertices in the digraph. For example, the relation L, defined on S = {1, 2, 3, 4}, by L = {(x, y) :
x 0 S, y 0 S, x # y} = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)}.
Its picture may be drawn as
C
1
3
C
C
2
Its adjacency matrix is
C
4
. The four loops correspond to the 1's on the main diagonal.
We see that this relation is (R) because the diagonal elements are all nonzero.
We define the transpose of a matrix A, denoted by AT , to be the matrix in which rows
and columns are interchanged. For example,
.
Clearly a relation is (S) if and only if M = M T , where M is its adjacency matrix.
A special type of multiplication can be defined for matrices, if their sizes can be matched
in the suitable manner; that is, the second dimension of the first matrix must equal the first
dimension of the second matrix.
For example,
is a product of a 2 by 3 matrix and a 3 by 4 matrix,
. Their product in reverse order is not defined.
If M is the adjacency matrix for a relation [which shows which vertices are adjacent to
others], then M*M shows which vertices can be reached in exactly two steps from another.
In fact, this product shows how many ways a vertex can be reached in two steps.
Consider the relation with adjacency matrix M =
. Now M 2 =
and it
shows for example that there are exactly 3 ways to reach from vertex 1 to vertex 3 in two steps.
An interesting consequence of this matrix multiplication is an easy way to check for
transitivity of a relation. Any nonzero entry in the squared matrix in the same position as a
zero in the adjacency matrix shows that the relation is not transitive. The preceding
calculation shows the relation above is transitive, because every vertex that can be reached in two
steps from a given vertex can also be reached in one step.
MAT251 Exercises3.3
1.Consider the matrix
a) a11 = 1
b) a13 = 5
2. Consider the matrix
b) b12 = 2
b) b21 = 3
p111. 1 – 8
. Evaluate
c) a31 = 2
d)
= 1 + (-2) + 1 = 0
. Evaluate
c) b23 = 1
d)
=1+0+4+3=8
3. Consider the matrices
a) AT =
. Calculate the following:
b) CT =
c) A + B =
d) A + C = NOT defined
e) (A + B)T =
f) AT + BT =
g) B + BT =
h) C + CT = NOT defined
4.For the matrices in Exercise 3, calculate the following when they exist.
a) A + A =
b) 2A =
c) A + A + A =
d) 4A + B =
be matrices in M 4, 3 defined by a i j = (-1)i + j and b i j = i + j.
5. Let
Hence,
and
. Find the following:
a) AT =
b) A + B =
d) AT + BT =
e) (A + B)T =
c) AT + B = NOT defined
f) A + A =
6. Let A and B be matrices in M 3, 3 defined by A[i, j] = ij and B[i, j] = i + j2
Hence
a) Find A + B =
b) Calculate
c) Does A equal its transpose AT ? Yes.
d) Does B equal its transpose BT ? No.
7. Consider A =
and B =
. Calculate the following:
a) AB =
b) BA =
c) A2 = AA =
d) B2 = BB =
8. a) For the matrices in Exercises 7, calculate
(A + B)2 =
A2 + 2AB + B2 =
b) The answers in part a) are not the same,
because (A + B)2 = A2 + AB + BA + B2 and AB … BA.