8.3 Matrix Arithmetic
In Section, we used a special class of matrices, the augmented matrices, to assist us in solving systems of linear equations. In this section, we study matrices as mathematical objects of their own accord, temporarily divorced from systems of linear equations. To do so conveniently requires some more notation. When we write , we mean is an by matrix1 and is the entry found in the th row and th column. Schematically, we have
With this new notation we can define what it means for two matrices to be equal.
Essentially, two matrices are equal if they are the same size and they have the same numbers in the same spots.2 For example, the two matrices below are, despite appearances, equal.
Now that we have an agreed upon understanding of what it means for two matrices to equal each other, we may begin defining arithmetic operations on matrices. Our first operation is addition.
As an example, consider the sum below.
It is worth the reader's time to think what would have happened had we reversed the order of the summands above. As we would expect, we arrive at the same answer. In general, for matrices and , provided they are the same size so that the sum is defined in the first place. This is the commutative property of matrix addition. To see why this is true in general, we appeal to the definition of matrix addition. Given and ,
where the second equality is the definition of , the third equality holds by the commutative law of real number addition, and the fourth equality is the definition of . In other words, matrix addition is commutative because real number addition is. A similar argument shows the associative property of matrix addition also holds, inherited in turn from the associative law of real number addition. Specifically, for matrices , , and of the same size, . In other words, when adding more than two matrices, it doesn't matter how they are grouped. This means that we can write without parentheses and there is no ambiguity as to what this means.3 These properties and more are summarized in the following theorem.
The identity property is easily verified by resorting to the definition of matrix addition; just as the number is the additive identity for real numbers, the matrix comprised of all 's does the same job for matrices. To establish the inverse property, given a matrix , we are looking for a matrix so that . By the definition of matrix addition, we must have that for all and . Solving, we get . Hence, given a matrix , its additive inverse, which we call , does exist and is unique and, moreover, is given by the formula: . The long and short of this is: to get the additive inverse of a matrix, take additive inverses of each of its entries. With the concept of additive inverse well in hand, we may now discuss what is meant by subtracting matrices. You may remember from arithmetic that ; that is, subtraction is defined as `adding the opposite (inverse).' We extend this concept to matrices. For two matrices and of the same size, we define . At the level of entries, this amounts to
Thus to subtract two matrices of equal size, we subtract their corresponding entries. Surprised?
Our next task is to define what it means to multiply a matrix by a real number. Thinking back to arithmetic, you may recall that multiplication, at least by a natural number, can be thought of as `rapid addition.' For example, . We know from algebra4 that , so it seems natural that given a matrix , we define . If , we have
In other words, multiplying the matrix in this fashion by is the same as multiplying each entry by . This leads us to the following definition.
One may well wonder why the word `scalar' is used for `real number.' It has everything to do with `scaling' factors.6 A point in the plane can be represented by its position matrix, :
Suppose we take the point and multiply its position matrix by . We have
which corresponds to the point . We can imagine taking to in this fashion as a dilation by a factor of in both the horizontal and vertical directions. Doing this to all points in the plane, therefore, has the effect of magnifying (scaling) the plane by a factor of .
As did matrix addition, scalar multiplication inherits many properties from real number arithmetic. Below we summarize these properties.
As with the other results in this section, Theorem can be proved using the definitions of scalar multiplication and matrix addition. For example, to prove that for a scalar and matrices and , we start by adding and , then multiplying by and seeing how that compares with the sum of and .
As for , we have
which establishes the property. The remaining properties are left to the reader. The properties in Theorems and establish an algebraic system that lets us treat matrices and scalars more or less as we would real numbers and variables, as the next example illustrates.
While the solution to the previous example is written in excruciating detail, in practice many of the steps above are omitted. We have spelled out each step in this example to encourage the reader to justify each step using the definitions and properties we have established thus far for matrix arithmetic. The reader is encouraged to solve the equation in Example Example 1 as they would any other linear equation, for example: .
We now turn our attention to matrix multiplication - that is, multiplying a matrix by another matrix. Based on the `no surprises' trend so far in the section, you may expect that in order to multiply two matrices, they must be of the same size and you find the product by multiplying the corresponding entries. While this kind of product is used in other areas of mathematics,7 we define matrix multiplication to serve us in solving systems of linear equations. To that end, we begin by defining the product of a row and a column. We motivate the general definition with an example. Consider the two matrices and below.
Let denote the first row of and denote the first column of . To find the `product' of with , denoted , we first find the product of the first entry in and the first entry in . Next, we add to that the product of the second entry in and the second entry in . Finally, we take that sum and we add to that the product of the last entry in and the last entry in . Using entry notation, . We can visualize this schematically as follows
To find where denotes the second row of and denotes the third column of , we proceed similarly. We start with finding the product of the first entry of with the first entry in then add to it the product of the second entry in with the second entry in , and so forth. Using entry notation, we have . Schematically,
Generalizing this process, we have the following definition.
Note that in order to multiply a row by a column, the number of entries in the row must match the number of entries in the column. We are now in the position to define matrix multiplication.
There are a number of subtleties in Definition which warrant closer inspection. First and foremost, Definition tells us that the -entry of a matrix product is the th row of times the th column of . In order for this to be defined, the number of entries in the rows of must match the number of entries in the columns of . This means that the number of columns of must match8 the number of rows of . In other words, to multiply times , the second dimension of must match the first dimension of , which is why in Definition, is being multiplied by a matrix . Furthermore, the product matrix has as many rows as and as many columns of . As a result, when multiplying a matrix by a matrix , the result is the matrix . Returning to our example matrices below, we see that is a matrix and is a matrix. This means that the product matrix is defined and will be a matrix.
Using to denote the th row of and to denote the th column of , we form according to Definition.
Note that the product is not defined, since is a matrix while is a matrix; has more columns than has rows, and so it is not possible to multiply a row of by a column of . Even when the dimensions of and are compatible such that and are both defined, the product and aren't necessarily equal.9 In other words, may not equal . Although there is no commutative property of matrix multiplication in general, several other real number properties are inherited by matrix multiplication, as illustrated in our next theorem.
The one property in Theorem which begs further investigation is, without doubt, the multiplicative identity. The entries in a matrix where comprise what is called the main diagonal of the matrix. The identity matrix has 's along its main diagonal and 's everywhere else. A few examples of the matrix mentioned in Theorem are given below. The reader is encouraged to see how they match the definition of the identity matrix presented there.
The identity matrix is an example of what is called a square matrix as it has the same number of rows as columns. Note that to in order to verify that the identity matrix acts as a multiplicative identity, some care must be taken depending on the order of the multiplication. For example, take the matrix matrix from earlier
In order for the product to be defined, ; similarly, for to be defined, . We leave it to the reader to show and . In other words,
and
While the proofs of the properties in Theorem are computational in nature, the notation becomes quite involved very quickly, so they are left to a course in Linear Algebra. The following example provides some practice with matrix multiplication and its properties. As usual, some valuable lessons are to be learned.
Example Example 2 illustrates some interesting features of matrix multiplication. First note that in part 1, neither nor is the zero matrix, yet the product is the zero matrix. Hence, the the zero product property enjoyed by real numbers and scalar multiplication does not hold for matrix multiplication. Parts 2 and 3 introduce us to polynomials involving matrices. The reader is encouraged to step back and compare our expansion of the matrix product in part 3 with the product from real number algebra. The exercises explore this kind of parallel further.
As we mentioned earlier, a point in the -plane can be represented as a position matrix. We now show that matrix multiplication can be used to rotate these points, and hence graphs of equations.
When we started this section, we mentioned that we would temporarily consider matrices as their own entities, but that the algebra developed here would ultimately allow us to solve systems of linear equations. To that end, consider the system
In Section, we encoded this system into the augmented matrix
Recall that the entries to the left of the vertical line come from the coefficients of the variables in the system, while those on the right comprise the associated constants. For that reason, we may form the coefficient matrix , the unknowns matrix and the constant matrix as below
We now consider the matrix equation .
We see that finding a solution to the original system corresponds to finding a solution for the matrix equation . If we think about solving the real number equation , we would simply `divide' both sides by . Is it possible to `divide' both sides of the matrix equation by the matrix ? This is the central topic of Section.
Exercises
For each pair of matrices and in Exercises -, find the following, if defined
- ,
- ,
- ,
- ,
- ,
- ,
- ,
In Exercises -, use the matrices
to compute the following or state that the indicated operation is undefined.
Let
Compute , and . What effect did each of the matrices have on the rows of ? Create so that its effect on is to multiply the bottom row by . How would you extend this idea to matrices with more than two rows?
In Exercises -, consider the following scenario. In the small village of Pedimaxus in the country of Sasquatchia, all 150 residents get one of the two local newspapers. Market research has shown that in any given week, 90% of those who subscribe to the Pedimaxus Tribune want to keep getting it, but 10% want to switch to the Sasquatchia Picayune. Of those who receive the Picayune, 80% want to continue with it and 20% want switch to the Tribune. We can express this situation using matrices. Specifically, let be the `state matrix' given by
where is the number of people who get the Tribune and is the number of people who get the Picayune in a given week. Let be the `transition matrix' given by
such that will be the state matrix for the next week.
Let's assume that when Pedimaxus was founded, all 150 residents got the Tribune. (Let's call this Week 0.) This would mean
Since 10% of that 150 want to switch to the Picayune, we should have that for Week 1, 135 people get the Tribune and 15 people get the Picayune. Show that in this situation is indeed
- Assuming that the percentages stay the same, we can get to the subscription numbers for Week 2 by computing . How many people get each paper in Week 2?
- Explain why the transition matrix does what we want it to do.
- If the conditions do not change from week to week, then remains the same and we have what's known as a Stochastic Process 11 because Week 's numbers are found by computing . Choose a few values of and, with the help of your classmates and calculator, find out how many people get each paper for that week. You should start to see a pattern as .
If you didn't see the pattern, we'll help you out. Let
Show that This is called the steady state because the number of people who get each paper didn't change for the next week. Show that as .
Now let
Show that as .
Show that for any matrix of the form
This means that no matter how the distribution starts in Pedimaxus, if is applied often enough, we always end up with 100 people getting the Tribune and 50 people getting the Picayune.
Let and be arbitrary complex numbers. Associate and with the matrices
Show that complex number addition, subtraction and multiplication are mirrored by the associated matrix arithmetic. That is, show that , and produce matrices which can be associated with the complex numbers , and , respectively.
Let
Compare to . Discuss with your classmates what constraints must be placed on two arbitrary matrices and so that both and exist. When will ? In general, what is the correct formula for ?
In Exercises -, consider the following definitions. A square matrix is said to be an upper triangular matrix if all of its entries below the main diagonal are zero and it is said to be a lower triangular matrix if all of its entries above the main diagonal are zero. For example,
from Exercises - above is an upper triangular matrix whereas
is a lower triangular matrix. (Zeros are allowed on the main diagonal.) Discuss the following questions with your classmates.
- Give an example of a matrix which is neither upper triangular nor lower triangular.
- Is the product of two upper triangular matrices always upper triangular?
- Is the product of two lower triangular matrices always lower triangular?
Given the matrix
write as where is a lower triangular matrix and is an upper triangular matrix?
- Are there any matrices which are simultaneously upper and lower triangular?
Answers
For and
For and
For and
- is not defined
- is not defined
For and
- is not defined
- is not defined
For and
- is not defined
- is not defined
For and
- is not defined
- is not defined
- is not defined
For and
- is undefined
- is undefined
- interchanged and of . multiplied of by 5. replaced in with .
Adapted from Precalculus, 3rd corrected edition, by Carl Stitz and Jeff Zeager (stitz-zeager.com), licensed under CC BY-NC-SA 3.0. Changes were made: reformatted as an accessible XYZ web edition. License: CC-BY-NC-SA-3.0.