Name: __________________
Introduction to Matrices
The following matrix, stolen from a rusted lockbox in the back of a large, dark lecture hall in a school called Hogwart’s, is the gradebook for Professor Severus Snape’s class in potions.
Poison | Cure | Love philter | Invulnerability | |
---|---|---|---|---|
Granger, | ||||
Longbottom, | ||||
Malfoy, | ||||
Potter, | ||||
Weasley, |
When I say this is a “matrix” I’m referring to the numbers in boxes. The labels (such as “Granger, ” or “Poison”) are labels that help you understand the numbers in the matrix, but they are not the matrix itself.
Each student is designated by a row. A row is a horizontal list of numbers.
1. Below, copy the row that represents all the grades for “Malfoy, .”
Each assignment is designated by a column, which is a vertical list of numbers. (This is easy to remember if you picture columns in Greek architecture, which are big and tall and...well, you know...vertical.)
2. Below, copy the column that represents all the grades on the “Love philter” assignment.
I know what you’re thinking, this is so easy it seems pointless. Well, it’s going to stay easy until tomorrow. So bear with me.
The dimensions of a matrix are just the number of rows, and the number of columns...in that order. So a “” matrix means rows and columns.
3. What are the dimensions of Dr. Snape’s gradebook matrix?
For two matrices to be equal, they must be exactly the same in every way: same dimensions, and every cell the same. If everything is not precisely the same, the two matrices are not equal.
4. What must and be, in order to make the following matrix equal to Dr. Snape’s gradebook matrix?
Finally, it is possible to add or subtract matrices. But you can only do this when the matrices have the same dimensions!!! If two matrices do not have exactly the same dimensions, you cannot add or subtract them. If they do have the same dimensions, you add and subtract them just by adding or subtracting each individual cell.
As an example: Dr. Snape has decided that his grades are too high, and he needs to curve them downward. So he plans to subtract the following grade-curving matrix from his original grade matrix.
5. Below, write the new grade matrix.
6. In the grade-curving matrix, all rows except the fourth one are identical. What is the effect of the different fourth row on the final grades?
Name: __________________
Introduction to Matrices—Homework
1. In the following matrix...
a. What are the dimensions?
b. Copy the second column here:
c. Copy the third row here:
d. Write another matrix which is equal to this matrix.
2. Add the following two matrices.
3. Add the following two matrices.
4. Subtract the following two matrices.
5. Solve the following equation for and . (That is, find what and must be for this equation to be true.)
6. Solve the following equation for and . (That is, find what and must be for this equation to be true.)
Name: __________________
Multiplying Matrices I
Just to limber up your matrix muscles, let’s try doing the following matrix addition.
1.
2. How many times did you add that matrix to itself?
3. Rewrite problem as a multiplication problem. (Remember what multiplication means—adding something to itself a bunch of times!)
This brings us to the world of multiplying a matrix by a number. It’s very straightforward. You end up with a matrix that has the same dimensions as the original, but all the individual cells have been multiplied by that number.
Let’s do another example. I’m sure you remember Professor Snape’s grade matrix.
Poison | Cure | Love philter | Invulnerability | |
---|---|---|---|---|
Granger, | ||||
Longbottom, | ||||
Malfoy, | ||||
Potter, | ||||
Weasley, |
Now, we saw how Professor Snape could lower his grades (which he loves to do) by subtracting a curve matrix. But there is another way he can lower his grades, which is by multiplying the entire matrix by a number. In this case, he is going to multiply his grade matrix by . If we designate his grade matrix as then the resulting matrix could be written as . (Remember that the cells in a matrix are numbers! So is just the grades, not the names.)
4. Below, write the matrix .
Finally, it’s time for Professor Snape to calculate final grades. He does this according to the following formula: “Poison” counts , “Cure” counts , “Love philter” counts , and the big final project on “Invulnerability” counts . For instance, to calculate the final grade for “Granger, ” he does the following calculation: .
To make the calculations easier to keep track of, the Professor represents the various weights in his grading matrix which looks like the following:
The above calculation can be written very concisely as multiplying a row matrix by a column matrix, as follows.
A “row matrix” means a matrix that is just one row. A “column matrix” means...well, you get the idea. When a row matrix and a column matrix have the same number of items, you can multiply the two matrices. What you do is, you multiply both of the first numbers, and you multiply both of the second numbers, and so on...and you add all those numbers to get one big number. The final answer is not just a number—it is a matrix, with that one big number inside it.
5. Below, write the matrix multiplication that Professor Snape would do to find the grade for “Potter, .” Show both the problem (the two matrices being multiplied) and the answer (the matrix that contains the final grade).
Name: __________________
Homework—Multiplying Matrices I
1. Multiply.
2. Multiply.
3. Multiply.
4.Solve for .
Name: __________________
Multiplying Matrices II
Just for a change, we’re going to start with...Professor Snape’s grade matrix!
Poison | Cure | Love philter | Invulnerability | |
---|---|---|---|---|
Granger, | ||||
Longbottom, | ||||
Malfoy, | ||||
Potter, | ||||
Weasley, |
As you doubtless recall, the good Professor calculated final grades by the following computation: “Poison” counts , “Cure” counts , “Love philter” counts , and the big final project on “Invulnerability” counts . He was able to represent each student’s final grade as the product of a row matrix (for the student) times a column matrix (for weighting).
1. Just to make sure you remember, write the matrix multiplication that Dr. Snape would use to find the grade for “Malfoy, .” Make sure to include both the two matrices being multiplied, and the final result!
I’m sure you can see the problem with this, which is that you have to write a separate matrix multiplication problem for every student. To get around that problem, we’re going to extend our definition of matrix multiplication so that the first matrix no longer has to be a row—it may be many rows. Each row of the first matrix becomes a new row in the answer. So, Professor Snape can now multiply his entire student matrix by his weighting matrix, and out will come a matrix with all his grades! Let’s try it. Do the following matrix multiplication. The answer will be a matrix with the final grades for “Malfoy, ,” “Potter, ,” and “Weasley, .”
2.
OK, let’s step back and review where we are. Yesterday, we learned how to multiply a row matrix times a column matrix. Now we have learned that you can add more rows to the first matrix, and they just become extra rows in the answer.
For full generality of matrix multiplication, you just need to know this: if you add more columns to the second matrix, they become additional columns in the answer! As an example, suppose Dr. Snape wants to try out a different weighting scheme, to see if he likes the new grades better. So he adds the new column to his weighting matrix. The first column represents the original weighting scheme, and the second column represents the new weighting scheme. The result will be a matrix where each row is a different student and each column is a different weighting scheme. Got all that? Give it a try now!
3.
Name: __________________
Homework—Multiplying Matrices II
1. Matrix is . Matrix is the product .
a. Find the product .
b. Find the product .
2. Multiply.
3. Multiply.
4.
a. Multiply.
b. Now, multiply —but not by manually multiplying it out! Instead, plug , , and into the formula you came up with in part .
5. Multiply.
6.
a. Find the and values that will make this matrix equation true.
b. Test your answer by doing the multiplication to make sure it works out.
7.
a. Find the “some matrix” that will make this matrix equation true.
b. Test your answer by doing the multiplication to make sure it works out.
Name: __________________
The “Identity” and “Inverse” Matrices
This assignment is brought to you by one of my favorite numbers, and I’m sure it’s one of yours...the number . Some people say that is the loneliest number that you’ll ever do. (Bonus: who said that?) But I say, is the multiplicative identity.
Allow me to demonstrate.
1.
2.
3.
4.
You get the idea? is called the multiplicative identity because it has this lovely property that whenever you multiply it by anything, you get that same thing back. But that’s not all! Observe...
5.
6.
The fun never ends! The point of all that was that every number has an inverse. The inverse is defined by the fact that, when you multiply a number by its inverse, you get .
7. Write the equation that defines two numbers and as inverses of each other.
8. Find the inverse of .
9. Find the inverse of .
10. Find the inverse of .
11. Is there any number that does not have an inverse, according to your definition in
So, what does all that have to do with matrices? (I hear you crying.) Well, we’ve already seen a matrix which acts as a multiplicative identity! Do these problems.
12.
13.
Pretty nifty, huh? When you multiply by another matrix, you get that other matrix back. That’s what makes this matrix (referred to as ) the multiplicative identity.
Remember that matrix multiplication does not, in general, commute: that is, for any two matrices and , the product is not necessarily the same as the product . But in this case, it is: times another matrix gives you that other matrix back no matter which order you do the multiplication in. This is a key part of the definition of , which is...
Definition: The matrix is defined as the multiplicative identity if it satisfies the equation:
Which, of course, is just a fancy way of saying what I said before. If you multiply I by any matrix, in either order, you get that other matrix back.
14. We have just seen that acts as the multiplicative identity for a matrix.
a. What is the multiplicative identity for a matrix?
b. Test this identity to make sure it works.
c. What is the multiplicative identity for a matrix? (I won’t make you test this one...)
d. What is the multiplicative identity for a matrix?
e. Trick question! There isn’t one. You could write a matrix that satisfies , but it would not also satisfy —that is, it would not commute, which we said was a requirement. Don’t take my word for it, try it! The point is that only square matrices (*same number of rows as columns) have an identity matrix.
So what about those inverses? Well, remember that two numbers and are inverses if . As you might guess, we’re going to define two matrices and as inverses if . Let’s try a few.
15. Multiply:
16. Multiply:
You see? These two matrices are inverses: no matter which order you multiply them in, you get . We will designate the inverse of a matrix as , which looks like an exponent, but isn’t really, it just means inverse matrix—just as we used to designate an inverse function. Which leads us to...
- Definition
- The matrix is defined as the multiplicative inverse of if it satisfies the equation:
- (where I is the identity matrix)
Of course, only a square matrix can have an inverse, since only a square matrix can have an I! Now we know what an inverse matrix does, but how do you find one?
17. Find the inverse of the matrix
a. Since we don’t know the inverse yet, we will designate it as a bunch of unknowns: will be our inverse matrix. Write down the equation that defines this unknown matrix as our inverse matrix.
b. Now, in your equation, you had a matrix multiplication. Go ahead and do that multiplication, and write a new equation which just sets two matrices equal to each other.
c. Now, remember that when we set two matrices equal to each other, every cell must be equal. So, when we set two different matrices equal, we actually end up with four different equations. Write these four equations.
d. Solve for , and .
e. So, write the inverse matrix .
f. Test this inverse matrix to make sure it works!
Name: __________________
Homework: The “Identity” and “Inverse” Matrices
- Matrix is .
- Write the identity matrix for Matrix .
- Show that it works.
- Find the inverse matrix .
- Show that it works.
- Matrix B is
- Can you find a matrix that satisfies the equation
- Is this an identity matrix for ? If so, demonstrate. If not, why not?
- Matrix is . Write the identity matrix for .
- Matrix is .
- Find the inverse matrix .
- Test it.
Name: __________________
The Inverse of the Generic Matrix
Today you are going to find the inverse of the generic matrix. Once you have done that, you will have a formula that can be used to quickly find the inverse of any matrix.
The generic matrix, of course, looks like this:
Since its inverse is unknown, we will designate the inverse like this:
Our goal is to find a formula for in terms of our original variables , and . That formula must not have any , or in it, since those are unknowns! Just the original four variables in our original matrix . Then we will find similar formulae for , and and we will be done.
Our approach will be the same approach we have been using to find an inverse matrix. I will walk you through the steps—after each step, you may want to check to make sure you’ve gotten it right before proceeding to the next.
1. Write the matrix equation that defines as an inverse of .
2. Now, do the multiplication, so you are setting two matrices equal to each other.
3. Now, we have two matrices set equal to each other. That means every cell must be identical, so we get four different equations. Write down the four equations.
4. Solve. Remember that your goal is to find four equations—one for , one for , one for , and one for where each equation has only the four original constants , and
5. Now that you have solved for all four variables, write the inverse matrix .
6. As the final step, to put this in the form that it is most commonly seen in, note that all four terms have an in the denominator. (Do you have a instead? Multiply the top and bottom by ) we can write our answer much more simply if we pull out the common factor of . (This is similar to “pulling out” a common term from a polynomial. Remember how we multiply a matrix by a constant? This is the same thing in reverse.) So rewrite the answer with that term pulled out.
You’re done! You have found the generic formula for the inverse of any matrix. Once you get the hang of it, you can use this formula to find the inverse of any matrix very quickly. Let’s try a few!
7. The matrix
a. Find the inverse—not the long way, but just by plugging into the formula you found above.
b. Test the inverse to make sure it works.
8. The matrix
a. Find the inverse—not the long way, but just by plugging into the formula you found above.
b. Test the inverse to make sure it works.
9. Can you write a matrix that has no inverse?
Name: ______________________
Using Matrices for Transformation
You are an animator for the famous company Copycat Studios. Your job is to take the diagram of the “fish” below (whose name is Harpoona) and animate a particular scene for your soon-to-be-released movie.
In this particular scene, the audience is looking down from above on Harpoona who begins the scene happily floating on the surface of the water. Here is a picture of Harpoona as she is happily floating on the surface.
Here is the matrix that represents her present idyllic condition.
1. Explain, in words, how this matrix represents her position. That is, how can this matrix give instructions to a computer on exactly how to draw Harpoona?
2. The transformation is applied to Harpoona.
a. Write the resulting matrix below.
b. In the space below, draw Harpoona after this transformation.
c. In the space below, answer this question in words: in general, what does the transformation do to a picture?
3. Now, Harpoona is going to swim three units to the left. Write below a general transformation that can be applied to any matrix to move a drawing three units to the left.
4. Harpoona—in her original configuration before she was transformed in either way—now undergoes the transformation .
a. Write the new matrix that represents Harpoona below.
b. In the space below, draw Harpoona after this transformation.
c. In the space below, answer this question in words: in general, what does the transformation do to a picture?
5. Now: in the movie’s key scene, the audience is looking down from above on Harpoona who begins the scene happily floating on the surface of the water. As the scene progresses, our heroine spins around and around in a whirlpool as she is slowly being sucked down to the bottom of the sea. “Being sucked down” is represented visually, of course, by shrinking.
a. Write a single transformation that will rotate Harpoona by and shrink her.
b. Apply this transformation four times to Harpoona’s original state, and compute the resulting matrices that represent her next four states.
c. Now draw all four states—preferably in different colors or something.
Name: ______________________
Homework: Using Matrices for Transformation
1. Harpoona’s best friend is a fish named Sam, whose initial position is represented by the matrix:
Draw Sam.
2. When the matrix
is multiplied by any matrix, it effects a powerful transformation on that matrix. Below, write the matrix . (You may use as an approximation for .)
3. Draw Sam’s resulting condition, .
4. The matrix will, of course, do the opposite of . Find . (You can use the formula for the inverse matrix that we derived in class, instead of starting from first principles. But make sure to first multiply the into , so you know what the four elements are!)
5. Sam now undergoes this transformation, so his new state is given by . Find and graph his new position.
6. Finally, Sam goes through again, so his final position is . Find and graph his final position.
7. Describe in words: what do the transformations and do, in general, to any shape?
Name: __________________
Homework: Calculators
- Solve on a calculator:
- Solve on a calculator: