The past few sections introduced us to matrix-vector multiplication as a means of thinking geometrically about the solutions to a linear system. In particular, we rewrote a linear system as a matrix equation and developed the concepts of span and linear independence in response to our two fundamental questions.
In this section, we will explore how matrix-vector multiplication defines certain types of functions, which we call matrix transformations, similar to those encountered in previous algebra courses. In particular, we will develop some algebraic tools for thinking about matrix transformations and look at some motivating examples. In the next section, we will see how matrix transformations describe important geometric operations and how they are used in computer animation.
We will begin by considering a more familiar situation; namely, the function , which takes a real number as an input and produces its square as its output.
Remember that composing two functions means we use the output from one function as the input into the other; that is, . What function results from composing ?
In the preview activity, we considered familiar linear functions of a single variable, such as . We construct a function like this by choosing a number ; when given an input , the output is formed by multiplying by .
In this section, we will consider functions whose inputs are vectors and whose outputs are vectors defined through matrix-vector multiplication. That is, if is a matrix and is a vector, the function forms the product as its output. Such a function is called a matrix transformation.
Let’s discuss a few of the issues that appear in this activity. First, notice that the shape of the matrix and the dimension of the input vector must be compatible if the product is to be defined. In particular, if is an matrix, needs to be an -dimensional vector, and the resulting product will be an -dimensional vector. For the associated matrix transformation, we therefore write meaning takes vectors in as inputs and produces vectors in as outputs. For instance, if
Second, we can often reconstruct the matrix if we only know some output values from its associated linear transformation by remembering that matrix-vector multiplication constructs linear combinations. For instance, if is an matrix , then
.
That is, we can find the first column of by evaluating . Similarly, the second column of is found by evaluating .
Let’s look at some examples and apply these observations.
To begin, suppose that is the matrix transformation that takes a two-dimensional vector as an input and outputs , the two-dimensional vector obtained by rotating counterclockwise by , as shown in Figure 2.5.7.
Suppose that we work for a company that makes baked goods, including cakes, doughnuts, and eclairs. The company operates two bakeries, Bakery 1 and Bakery 2. In one hour of operation,
Bakery 1 produces 10 cakes, 50 doughnuts, and 30 eclairs.
We would like to describe a matrix transformation where describes the number of hours the bakeries operate and describes the total number of cakes, doughnuts, and eclairs produced. That is, where is the number of cakes, is the number of doughnuts, and is the number of eclairs produced.
If , what are the values of and , and what is the shape of the associated matrix ?
We can determine the matrix using Proposition 2.5.6. For instance, will describe the number of cakes, doughnuts, and eclairs produced when Bakery 1 operates for one hour and Bakery 2 sits idle. What is this vector?
Suppose that the company receives an order for a certain number of cakes, doughnuts, and eclairs. Can you guarantee that you can fill the order without having leftovers?
In these examples, we glided over an important point: how do we know these functions can be expressed as matrix transformations? We will take up this question in detail in the next section and not worry about it for now.
It sometimes happens that we want to combine matrix transformations by performing one and then another. In the last activity, for instance, we considered the matrix transformation where is the result of rotating the two-dimensional vector by . Now suppose we are interested in rotating that vector twice; that is, we take a vector , rotate it by to obtain , and then rotate the result by again to obtain .
This process is called function composition and likely appeared in an earlier algebra course. For instance, if and , the composition of these functions obtained by first performing and then performing is denoted by
Composing matrix transformations is similar. Suppose that we have two matrix transformations, and . Their associated matrices will be denoted by and so that and . If we apply to a vector to obtain and then apply to the result, we have
Notice that this implies that the composition is itself a matrix transformation and that the associated matrix is the product .
If and are matrix transformations with associated matrices and respectively, then the composition is also a matrix transformation whose associated matrix is the product .
Notice that the matrix transformations must be compatible if they are to be composed. In particular, the vector , an -dimensional vector, must be a suitable input vector for , which means that the inputs to must be -dimensional. In fact, this is the same condition we need to form the product of their associated matrices, namely, that the number of columns of is the same as the number of rows of .
We will explore the composition of matrix transformations by revisiting the matrix transformations from Activity 2.5.3.
Let’s begin with the matrix transformation that rotates a two-dimensional vector by to produce . We saw in the earlier activity that the associated matrix is . Suppose that we compose this matrix transformation with itself to obtain , which is the result of rotating by twice.
What is the matrix associated to the composition ?
In the previous activity, we imagined a company that operates two bakeries. We found the matrix transformation where describes the number of cakes, doughnuts, and eclairs when Bakery1 runs for hours and Bakery 2 runs for hours. The associated matrix is .
We will describe a matrix transformation where is a two-dimensional vector describing the number of cups of flour and sugar required to make cakes, doughnuts, and eclairs.
Use Proposition 2.5.6 to write the matrix associated to the transformation .
Suppose that Bakery 1 operates for 75 hours and Bakery 2 operates for 53 hours. How many cakes, doughnuts, and eclairs are produced? How many cups of flour and sugar are required?
Suppose we run a company that has two warehouses, which we will call and , and a fleet of 1000 delivery trucks. Every morning, a delivery truck goes out from one of the warehouses and returns in the evening to one of the warehouses. It is observed that
70% of the trucks that leave return to . The other 30% return to .
The distribution of trucks is represented by the vector when there are trucks at location and trucks at . If describes the distribution of trucks in the morning, then the matrix transformation will describe the distribution in the evening.
xxxxxxxxxx
1
​
Messages
Suppose that all 1000 trucks begin the day at location and none at . How many trucks are at each location that evening? Using our vector representation, what is ?
In the same way, suppose that all 1000 trucks begin the day at location and none at . How many trucks are at each location that evening? What is the result and what is ?
Suppose that is the matrix transformation that transforms the distribution of trucks one morning into the distribution of trucks in the morning one week (seven days) later. What is the matrix that defines the transformation ?
As we will see later, this type of situation occurs frequently. We have a vector that describes the state of some system; in this case, describes the distribution of trucks between the two locations at a particular time. Then there is a matrix transformation that describes the state at some later time. We call the state vector and the transition function, as it describes the transition of the state vector from one time to the next.
We call this situation where the state of a system evolves from one time to the next according to the rule a discrete dynamical system. In Chapter 4, we will develop a theory that enables us to make long-term predictions about the evolution of the state vector.
A discrete dynamical system consists of a state vector along with a transition function that describes how the state vector evolves from one time to the next. Powers of the matrix determine the long-term behavior of the state vector.
In Example 2.5.5 and Example 2.5.4, we wrote matrix transformations in terms of the components of . This exercise makes use of that form.
Let’s return to the example in Activity 2.5.3 concerning the company that operates two bakeries. We used a matrix transformation with input , which recorded the amount of time the two bakeries operated, and output , the number of cakes, doughnuts, and eclairs produced. The associated matrix is .
If , write the output as a three-dimensional vector in terms of and .
Suppose that a bicycle sharing program has two locations and . Bicycles are rented from some location in the morning and returned to a location in the evening. Suppose that
60% of bicycles that begin at in the morning are returned to in the evening while the other 40% are returned to .
Suppose that ,, and record the amounts of time that the three plants are operated and that and record the amount of milk and yogurt produced. If we write and , find the matrix that defines the matrix transformation .
If describes the amounts of time that the three plants are operated, how much milk and yogurt is produced? How much electricity and labor are required?
Find the matrix that describes the matrix transformation that gives the required amounts of electricity and labor when the each plants is operated an amount of time given by the vector .
Suppose that two species and interact with one another and that we measure their populations every month. We record their populations in a state vector , where and are the populations of and , respectively. We observe that there is a matrix
such that the matrix transformation is the transition function describing how the state vector evolves from month to month. We also observe that, at the beginning of July, the populations are described by the state vector .
xxxxxxxxxx
1
​
Messages
What will the populations be at the beginning of August?
We will record the number of present students and the number of absent students in a state vector and note that that state vector evolves from one day to the next according to the transition function . On Tuesday, the state vector is .
xxxxxxxxxx
1
​
Messages
Suppose we initially have 1000 students who are present and none absent. Find .