Matrices and Matrix Operations
Matrices and Matrix Operations
Matrices and Matrix Operations
In Section 1.2 we used rectangular arrays of numbers, called augmented matrices, to abbreviate systems of linear
equations. However, rectangular arrays of numbers occur in other contexts as well. For example, the following rectangular
array with three rows and seven columns might describe the number of hours that a student spent studying three subjects
during a certain week:
Math 2 3 2 4 1 4 2
History 0 3 1 4 3 2 2
Language 4 1 3 1 0 0 2
If we suppress the headings, then we are left with the following rectangular array of numbers with three rows and
seven columns, called a “matrix”:
DEFINITION
A matrix is a rectangular array of numbers. The numbers in the array are called the entries in the matrix.
Remark It is common practice to omit the brackets from a matrix. Thus we might write 4 rather than [4]. Although
this makes it impossible to tell whether 4 denotes the number “four” or the matrix whose entry is “four,” this rarely
causes problems, since it is usually possible to tell which is meant from the context in which the symbol appears.
We shall use capital letters to denote matrices and lowercase letters to denote numerical quantities; thus we might write
When discussing matrices, it is common to refer to numerical quantities as scalars. Unless stated otherwise, scalars will
be real numbers; complex scalars will be considered in Chapter 10.
The entry that occurs in row i and column j of a matrix A will be denoted by . Thus a general matrix might be
written as
(1)
the first notation being used when it is important in the discussion to know the size, and the second being used when the size
need not be emphasized. Usually, we shall match the letter denoting a matrix with the letter denoting its entries; thus, for a
matrix B we would generally use for the entry in row i and column j, and for a matrix C we would use the notation .
The entry in row i and column j of a matrix A is also commonly denoted by the symbol . Thus, for matrix 1 above,
we have
we have , , , and .
Row and column matrices are of special importance, and it is common practice to denote them by boldface lowercase letters
rather than capital letters. For such matrices, double subscripting of the entries is unnecessary. Thus a general row
matrix a and a general column matrix b would be written as
, …,
A matrix A with n rows and n columns is called a square matrix of order n, and the shaded entries , in 2 are
said to be on the main diagonal of A.
(2)
Operations on Matrices
So far, we have used matrices to abbreviate the work in solving systems of linear equations. For other applications,
however, it is desirable to develop an “arithmetic of matric es” in which matrices can be added, subtracted, and multiplied
in a useful way. The remainder of this section will be devoted to developing this arithmetic.
DEFINITION
Two matrices are defined to be equal if they have the same size and their corresponding entries are equal.
In matrix notation, if and have the same size, then if and only if , or,
equivalently, for all i and j.
If , then , but for all other values of x the matrices A and B are not equal, since not all of their corresponding
entries are equal. There is no value of x for which since A and C have different sizes.
DEFINITION
If A and B are matrices of the same size, then the sum is the matrix obtained by adding the entries of B to the
corresponding entries of A, and the difference is the matrix obtained by subtracting the entries of B from
the corresponding entries of A. Matrices of different sizes cannot be added or subtracted.
Then
DEFINITION
If A is any matrix and c is any scalar, then the product is the matrix obtained by multiplying each entry of the matrix A
by c. The matrix is said to be a scalar multiple of A.
we have
If , , …, are matrices of the same size and , , …, are scalars, then an expression of the form
is called a linear combination of , , …, with coefficients , , …, . For example, if A, B, and C are the matrices
in Example 4, then
is the linear combination of A, B, and C with scalar coefficients 2, −1, and .
Thus far we have defined multiplication of a matrix by a scalar but not the multiplication of two matrices. Since matrices
are added by adding corresponding entries and subtracted by subtracting corresponding entries, it would seem natural to
define multiplication of matrices by multiplying corresponding entries. However, it turns out that such a definition would
not be very useful for most problems. Experience has led mathematicians to the following more useful definition of matrix
multiplication.
DEFINITION
If A is an matrix and B is an matrix, then the product is the matrix whose entries are determined as
follows. To find the entry in row i and column j of , single out row i from the matrix A and column j from the matrix
B. Multiply the corresponding entries from the row and column together, and then add up the resulting products.
Since A is a matrix and B is a matrix, the product is a matrix. To determine, for example, the entry
in row 2 and column 3 of , we single out row 2 from A and column 3 from B. Then, as illustrated below, we multiply
corresponding entries together and add up these products.
(3)
Then by 3, is defined and is a matrix; is defined and is a matrix; and is defined and is a matrix.
The products , , and are all undefined.
(4)
(5)
Partitioned Matrices
A matrix can be subdivided or partitioned into smaller matrices by inserting horizontal and vertical rules between selected
rows and columns. For example, the following are three possible partitions of a general matrix A—the first is a partition
of A into four submatrices , , , and ; the second is a partition of A into its row matrices , , and ; and
the third is a partition of A into its column matrices , , , and :
Matrix Multiplication by Columns and by Rows
Sometimes it may be desirable to find a particular row or column of a matrix product without computing the
entire product. The following results, whose proofs are left as exercises, are useful for that purpose:
(6)
(7)
If A and B are the matrices in Example 5, then from 6 the second column matrix of can be obtained by the computation
and from 7 the first row matrix of can be obtained by the computation
If , , …, denote the row matrices of A and , , …, denote the column matrices of B, then it follows from
Formulas 6 and 7 that
(8)
(9)
Remark Formulas 8 and 9 are special cases of a more general procedure for multiplying partitioned matrices (see Exercises 15,
16 and 17).
Row and column matrices provide an alternative way of thinking about matrix multiplication. For example, suppose that
Then
(10)
In words, 10 tells us that the product of a matrix A with a column matrix x is a linear combination of the column matrices
of A with the coefficients coming from the matrix x. In the exercises we ask the reader to show that the product of a
matrix y with an matrix A is a linear combination of the row matrices of A with scalar coefficients coming from y.
It follows from 8 and 10 that the jth column matrix of a product is a linear combination of the column matrices of A
with the coefficients coming from the jth column of B.
EXAMPLE 9 Columns of a Product as Linear Combinations
The column matrices of can be expressed as linear combinations of the column matrices of A as follows:
Matrix multiplication has an important application to systems of linear equations. Consider any system of m linear
equations in n unknowns.
Since two matrices are equal if and only if their corresponding entries are equal, we can replace the m equations in
this system by the single matrix equation
The matrix on the left side of this equation can be written as a product to give
If we designate these matrices by A, x, and b, respectively, then the original system of m equations in n unknowns has
been replaced by the single matrix equation
The matrix A in this equation is called the coefficient matrix of the system. The augmented matrix for the system is
obtained by adjoining b to A as the last column; thus the augmented matrix is
Matrices Defining Functions
The equation with A and b given defines a linear system to be solved for x. But we could also write this equation as
, where A and x are given. In this case, we want to compute y. If A is , then this is a function that associates with
every column vector x an column vector y, and we may view A as defining a rule that shows how a given x
is mapped into a corresponding y. This idea is discussed in more detail starting in Section 4.2.
The product is
so the effect of multiplying A by a column vector is to change the sign of the second entry of the column vector. For
the matrix
the product is
so the effect of multiplying B by a column vector is to interchange the first and second entries of the column vector,
also changing the sign of the first entry.
If we view the column vector x as locating a point in the plane, then the effect of A is to reflect the point about the
x-axis (Figure 1.3.1a) whereas the effect of B is to rotate the line segment from the origin to the point through a right
angle (Figure 1.3.1b).
Figure 1.3.1
Transpose of a Matrix
We conclude this section by defining two matrix operations that have no analogs in the real numbers.
DEFINITION
If A is any matrix, then the transpose of A, denoted by , is defined to be the matrix that results from
interchanging the rows and columns of A; that is, the first column of is the first row of A, the second column of
is the second row of A, and so forth.
Observe that not only are the columns of the rows of A, but the rows of are the columns of A. Thus the entry in row i
and column j of is the entry in row j and column i of A; that is,
(11)
In the special case where A is a square matrix, the transpose of A can be obtained by
interchanging entries that are
symmetrically positioned about the main diagonal. In 12 it is shown that can also be
obtained by “reflecting” A about its main diagonal.
(12)
DEFINITION
If A is a square matrix, then the trace of A, denoted by , is defined to be the sum of the
entries on the main diagonal of A. The trace of A is undefined if A is not a square matrix.