For more information, please see full course syllabus of Pre Calculus
For more information, please see full course syllabus of Pre Calculus
Matrices
 A matrix (plural: matrices) is a rectangular array where each entry is a number.
 For a matrix with m rows and n columns, we say it has an order of m×n (This property is sometimes called `size' or `dimension'). We can also write order as A_{m ×n}. If a matrix has equal numbers of rows and columns (m=n), we call it a square matrix.
 Matrices are usually denoted by capital letters.
 Two matrices A and B are equal if they have the same order and all their entries are equal.
 We can also talk about some specific entry in row i and column j (where i and j are standing in for numbers). As we use capitals to denote a matrix (A), we often use the corresponding lower case to denote its entries (a). We can talk about a specific entry by using the subscript ij on the letter (a_{ij}) to denote the i^{th} row and j^{th} column.
 With this idea in mind, we can see a matrix as a series of entries represented by various a_{ij}. This means instead of having to write the entire matrix out (like above) or just using a letter to denote the whole thing (A), we can refer to it by using a single representative entry to stand in for all entries:
Since i and j can change, a_{ij} is a placeholder for all of the entries in A.A = [ a_{ij} ].  Given some matrix A and a scalar (real number) k, we can multiply the matrix by the number:
That is, every entry of A is multiplied by k. [Note that this is just like multiplying a vector by a scalar.]kA = [ k ·a_{ij} ].  Given two matrices A and B that have the same order (m×n, the number of rows and columns), we can add the two matrices together:
That is, we add together entries that come from the same "location" in each matrix to create a new matrix. [Note that this is very similar to adding vectors componentwise.]A + B = [a_{ij} + b_{ij} ].  If A is an m×n matrix and B is an n ×p matrix, we can multiply them together and create a new matrix AB that is order m×p, and which is defined as
where c_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + …+ a_{in}b_{nj}. That is, entry c_{ij} of AB (the entry in its i^{th} row and j^{th} column) is the sum of the products of corresponding entries from A's i^{th} row & B's j^{th} column. [The idea of matrix multiplication can be very confusing at first. Check out the video to see a lot of visual references to help explain what's going on here.]AB = [c_{ij}],  To multiply two matrices together, we have to first be sure that their orders are compatible. The numbers of columns in the first matrix must equal the number of rows in the second matrix.
 Multiplication in the real numbers is commutative, that is, x·y = y ·x: which side you multiply from does not affect the product. ( 5·7 = 7 ·5, 8(−3) = (−3)8 ). However, matrix multiplication is not commutative in general. That is, for most matrices A and B, AB ≠ BA.
 The zero matrix is a matrix that has 0 for all of its entries. A zero matrix can be made with any order. It is denoted by 0. [If you need to show its order: 0_{m×n}.]
 The identity matrix is a square matrix that has 1 for all its entries on the main diagonal and 0 for all other entries. It can be any order, so long as it is square. It is denoted by I. (If you need to show it is order n ×n, you can denote by: I_{n}.) Notice that for any matrix A, IA = A = A I. [ I effectively works the same as multiplying a real number by 1.]
Note: Many teachers and textbooks first introduce matrices as a way to solve systems of linear equations through augmented matrices, row operations, and GaussJordan elimination. If you're looking for that, watch the first part of the lesson Using Matrices to Solve Systems of Linear Equations.
Matrices

 To add two matrices together, we add together entries that come from the same "location" in each matrix to create a new matrix. [This is very similar to adding vectors together componentwise.]
 Just like we can represent numbers with letters and symbols, we can represent matrices with letters and symbols as well. Simply plug in what you know each matrix is from the problem.
A+B = ⎡
⎢
⎢
⎣8 0 −7 −2 ⎤
⎥
⎥
⎦+ ⎡
⎢
⎢
⎣4 −9 −3 9 ⎤
⎥
⎥
⎦  From there, add them together based on location:
⎡
⎢
⎢
⎣8 0 −7 −2 ⎤
⎥
⎥
⎦+ ⎡
⎢
⎢
⎣4 −9 −3 9 ⎤
⎥
⎥
⎦= ⎡
⎢
⎢
⎣8+4 0−9 −7−3 −2+9 ⎤
⎥
⎥
⎦= ⎡
⎢
⎢
⎣12 −9 −10 7 ⎤
⎥
⎥
⎦

 



 A "plain" number in front of a matrix is called a scalar. When we multiply a matrix by a scalar, the scalar multiplies every entry of the matrix. [This is very similar to multiplying a vector by a scalar.]
 Just like we can represent numbers with letters and symbols, we can represent matrices with letters and symbols as well. Simply plug in what you know each matrix is from the problem.
−4X = −4 ⎡
⎢
⎢
⎣−6 9 2 −5 ⎤
⎥
⎥
⎦  From there, multiply every entry of the matrix by the scalar:
−4 ⎡
⎢
⎢
⎣−6 9 2 −5 ⎤
⎥
⎥
⎦= ⎡
⎢
⎢
⎣(−4)(−6) (−4)9 (−4)2 (−4)(−5) ⎤
⎥
⎥
⎦= ⎡
⎢
⎢
⎣24 −36 −8 20 ⎤
⎥
⎥
⎦

 



 Multiplying a matrix by a scalar (a "normal" number) is as simple as having the scalar multiply every entry of the matrix. Adding or subtracting two matrices causes entries from the same location to combine through addition or subtraction, respectively.
 Begin by multiplying the scalars on to each matrix. (Notice that we can't combine them yet because the scalars are in the way. You couldn't do the addition in 7·4 + 2·8 before doing the multiplication for the same reason.) For this, we have two options: we could multiply (−3) on to Q, then add the resulting matrix, or we can multiply (3) on to Q, then subtract the resulting matrix. Either will work, but let's use (−3) just to help us see cancellation more easily.
5P − 3Q = 5 ⎡
⎢
⎢
⎣7 1 0 −5 ⎤
⎥
⎥
⎦−3 ⎡
⎢
⎢
⎣−4 6 2 −4 ⎤
⎥
⎥
⎦= ⎡
⎢
⎢
⎣35 5 0 −25 ⎤
⎥
⎥
⎦+ ⎡
⎢
⎢
⎣12 −18 −6 12 ⎤
⎥
⎥
⎦  Now we can combine the matrices through addition:
⎡
⎢
⎢
⎣35 5 0 −25 ⎤
⎥
⎥
⎦+ ⎡
⎢
⎢
⎣12 −18 −6 12 ⎤
⎥
⎥
⎦= ⎡
⎢
⎢
⎣47 −13 −6 −13 ⎤
⎥
⎥
⎦

 



 The order of a matrix is a way of talking about its "size" or "dimensions". It tells us how many rows and columns the matrix has. Order is given in the format m ×n:
Order of a matrix: (# of rows) ×(# of columns)  For the first matrix in the question (the leftmost matrix), to find the order we just need to count how many rows and columns it has. It has a total of four rows and four columns, so its order is 4×4. [We would also call it a square matrix because the lengths of its "sides" are equal.]
 For the rest of the matrices, it's just a matter of counting up rows and columns. Second matrix from left: five rows and two columns, so 5×2. Third matrix from left: one row and one column, so 1 ×1. Fourth matrix from left: two rows and four columns, so 2 ×4.

 We will do this problem by matrix multiplication. We will need to multiply A and B together. Unlike matrix addition and scalar multiplication, matrix multiplication is very difficult to explain with words. If you are not already familiar with it, make sure to watch the video lesson and pay careful attention. It is much better explained with diagrams and watching steps happen, so make sure to check out the video. If you are already familiar with it, remember, we take the rows of the first matrix and multiply them against the columns of the second matrix. This creates the entry for the corresponding row and column.
 Following this idea, let's work out the first row, first column entry (the top left).
Thus, to find the first row, first column for the product of the two matrices, we take the first row of A and the first column of B:AB = ⎡
⎢
⎢
⎣2 5 −1 −3 ⎤
⎥
⎥
⎦⎡
⎢
⎢
⎣3 −4 0 6 ⎤
⎥
⎥
⎦
Then we multiply them together (similar to how we did a dot product with vectors) as follows:First row of A: 2 5 ⎢
⎢First column of B: 3 0
And this gives us the first row, first column entry for the product2 ·3 + 5 ·0 = 6 ⎡
⎢
⎢
⎣2 5 −1 −3 ⎤
⎥
⎥
⎦⎡
⎢
⎢
⎣3 −4 0 6 ⎤
⎥
⎥
⎦= ⎡
⎢
⎢
⎣6 ? ? ? ⎤
⎥
⎥
⎦  Repeat this process for each of the entries in the prouct:
Then simplify:⎡
⎢
⎢
⎣2 5 −1 −3 ⎤
⎥
⎥
⎦⎡
⎢
⎢
⎣3 −4 0 6 ⎤
⎥
⎥
⎦= ⎡
⎢
⎢
⎣2 ·3 + 5 ·0 2 ·(−4) + 5 ·6 (−1) ·3 + (−3) ·0 (−1) ·(−4) + (−3) ·6 ⎤
⎥
⎥
⎦⎡
⎢
⎢
⎣2 ·3 + 5 ·0 2 ·(−4) + 5 ·6 (−1) ·3 + (−3) ·0 (−1) ·(−4) + (−3) ·6 ⎤
⎥
⎥
⎦= ⎡
⎢
⎢
⎣6 22 −3 −14 ⎤
⎥
⎥
⎦

 



 Unlike "normal" multiplication, matrix multiplication is not commutative. That is, the side we multiply on has a huge effect on what the result is. To show that AB and BA are different for this problem, we need to start off by finding out what AB and BA are. [If you're unfamiliar with how to do matrix multiplication, make sure to watch the video lesson. It's very difficult to explain with written words, but watching it can really help you make sense of it.]
 Let's start off by computing AB:
Following the rules of matrix multiplication, we getAB = ⎡
⎢
⎢
⎣3 1 −5 2 ⎤
⎥
⎥
⎦⎡
⎢
⎢
⎣4 −2 6 −7 ⎤
⎥
⎥
⎦⎡
⎢
⎢
⎣3 ·4 + 1 ·6 3 ·(−2) + 1 ·(−7) −5 ·4 + 2 ·6 −5 ·(−2) + 2 ·(−7) ⎤
⎥
⎥
⎦= ⎡
⎢
⎢
⎣18 −13 −8 −4 ⎤
⎥
⎥
⎦  Next, we compute BA:
Following the rules of matrix multiplication, we getBA = ⎡
⎢
⎢
⎣4 −2 6 −7 ⎤
⎥
⎥
⎦⎡
⎢
⎢
⎣3 1 −5 2 ⎤
⎥
⎥
⎦⎡
⎢
⎢
⎣4 ·3 − 2 ·(−5) 4 ·1 −2 ·2 6 ·3 − 7 ·(−5) 6 ·1 − 7 ·2 ⎤
⎥
⎥
⎦= ⎡
⎢
⎢
⎣22 0 53 −8 ⎤
⎥
⎥
⎦  Finally, to show that AB ≠ BA, we just compare the two of them:
Clearly AB ≠ BA, so we have shown what the question asked.AB = ⎡
⎢
⎢
⎣18 −13 −8 −4 ⎤
⎥
⎥
⎦⎢
⎢BA = ⎡
⎢
⎢
⎣22 0 53 −8 ⎤
⎥
⎥
⎦

 



 




 For a matrix multiplication to be possible, the orders of the matrix must be compatible. That is, if some matrix X has an order of m×n and some matrix Y has an order of p ×q, the only way for XY to be possible is for n=p to be true. We can see it as the "inner" order numbers must be equal:
For two matrices to be able to multiply each other, the number of columns in the left matrix must match the number of rows in the right matrix. Assuming two matrices are compatible for multiplication, the resulting matrix will have an order based on the "outer" order numbers.X_{m ×n} Y_{p ×q} ⇒ n = p X_{m ×n} Y_{n ×q} = (XY)_{m ×q}  To make this problem easier, begin by finding the order for each of the matrices: A has four rows and four columns, so order 4×4. B has one row and four columns, so order 1×4. C has four rows and two columns, so order 4 ×2.
 We can check to see if it is compatible and what type of matrix a given combination would produce by checking against orders:
The inner order numbers are equal, so it is compatible. The resulting matrix will have an order that uses the outer order numbers.AC ⇒ [4 ×4 ] [4 ×2] ⇒ [4 ×2]  Repeat this process for the other combinations:
Because the inner order numbers are different, the matrices are incompatible for multiplication.AB ⇒ [4 ×4 ] [1 ×4] Impossible!
The inner order numbers are equal, so it is compatible. The resulting matrix will have an order that uses the outer order numbers.BC ⇒ [1 ×4 ] [4 ×2] ⇒ [1 ×2]  Things are a little bit different for the multiplication of BAC since it uses three matrices, but we can work it out based on starting with BA or AC and still get the same result:
(BA)C ⇒ ⎛
⎝[1 ×4 ] [4 ×4 ] ⎞
⎠[4 ×2] ⇒ [ 1 ×4 ] [4 ×2] ⇒ [1 ×2]
Thus BAC works fine for matrix multiplication, and we also see that the only important thing for matrix multiplication is that all of the inner orders pair up, and the resulting matrix comes from the outermost orders.B(AC) ⇒ [1 ×4 ] ⎛
⎝[4 ×4 ] [4 ×2 ] ⎞
⎠⇒ [1 ×4 ] [4 ×2 ] ⇒ [1 ×2]

 For matrix multiplication, remember, we take the rows of the first matrix and multiply them against the columns of the second matrix. This creates the entry for the corresponding row and column. [If you're unfamiliar with how to do matrix multiplication, make sure to watch the video lesson. It's very difficult to explain with written words, but is shown with lots of diagrams and careful steps in the video to make it clear.]
 Put the matrices sidebyside so we can see how to match things up:
By the rules of matrix multiplication, we getAB = ⎡
⎢
⎢
⎢
⎣2 1 −3 0 −2 1 1 −1 4 ⎤
⎥
⎥
⎥
⎦⎡
⎢
⎢
⎢
⎣0 −3 1 2 −2 −1 1 5 2 ⎤
⎥
⎥
⎥
⎦⎡
⎢
⎢
⎢
⎣2 ·0 + 1 ·2 −3 ·1 2 ·(−3) + 1 ·(−2) −3 ·5 2 ·1 + 1 ·(−1) −3 ·2 0 ·0 −2 ·2 + 1 ·1 0 ·(−3) −2 ·(−2)+1 ·5 0 ·1 −2 ·(−1) + 1 ·2 1 ·0−1 ·2+4 ·1 1 ·(−3) −1 ·(−2)+4 ·5 1 ·1 −1 ·(−1) + 4 ·2 ⎤
⎥
⎥
⎥
⎦  From there, just simplify to find
⎡
⎢
⎢
⎢
⎣−1 −23 −5 −3 9 4 2 19 10 ⎤
⎥
⎥
⎥
⎦


 


 




 Begin by doing the scalar multiplication and the matrix addition:
⎡
⎢
⎢
⎣6 −3 0 −15 3 0 9 −3 ⎤
⎥
⎥
⎦⎛
⎜
⎜
⎜
⎜
⎜
⎝⎡
⎢
⎢
⎢
⎢
⎢
⎣−2 4 4 −3 ⎤
⎥
⎥
⎥
⎥
⎥
⎦⎞
⎟
⎟
⎟
⎟
⎟
⎠  At this point, we're left with two matrices multiplying each other
Considering their orders of 2 ×4 and 4 ×1, we see that they are compatible for matrix multiplication and that the result will have an order of 2×1.⎡
⎢
⎢
⎣6 −3 0 −15 3 0 9 −3 ⎤
⎥
⎥
⎦⎡
⎢
⎢
⎢
⎢
⎢
⎣−2 4 4 −3 ⎤
⎥
⎥
⎥
⎥
⎥
⎦  Carry out the matrix multiplication:
⎡
⎢
⎢
⎣6 ·(−2) −3 ·4 + 0 ·4 −15 ·(−3) 3 ·(−2) + 0 ·4 + 9 ·4 −3 ·(−3) ⎤
⎥
⎥
⎦= ⎡
⎢
⎢
⎣21 39 ⎤
⎥
⎥
⎦
 


 We can work with a matrix equation very similarly to how we're used to working with an equation. As long as we do the exact same operation to both sides, the equation holds up, just like normal algebra. Our goal is to solve for X. Start off by writing it out with A and B plugged in:
3X = 2A−B ⇒ 3X = 2 ⎡
⎢
⎢
⎣4 2 −1 3 ⎤
⎥
⎥
⎦− ⎡
⎢
⎢
⎣2 −8 7 5 ⎤
⎥
⎥
⎦  Simplify the right side:
3X = ⎡
⎢
⎢
⎣8 4 −2 6 ⎤
⎥
⎥
⎦− ⎡
⎢
⎢
⎣2 −8 7 5 ⎤
⎥
⎥
⎦= ⎡
⎢
⎢
⎣6 12 −9 1 ⎤
⎥
⎥
⎦  We can now solve for X:
3X = ⎡
⎢
⎢
⎣6 12 −9 1 ⎤
⎥
⎥
⎦⇒ 1 3·3X = 1 3· ⎡
⎢
⎢
⎣6 12 −9 1 ⎤
⎥
⎥
⎦⇒ X = ⎡
⎢
⎢
⎢
⎣2 4 −3 1 3⎤
⎥
⎥
⎥
⎦

 


*These practice questions are only helpful when you work on them offline on a piece of paper and then use the solution steps function to check your answer.
Answer
Matrices
Lecture Slides are screencaptured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.
 Intro
 Introduction
 Definition of a Matrix
 Examples of Matrices
 Talking About Specific Entries
 Using Entries to Talk About Matrices
 Scalar Multiplication
 Matrix Addition
 Matrix Multiplication
 Matrix Multiplication and Order (Size)
 Matrix Multiplication is NOT Commutative
 Special Matrices  Zero Matrix (0)
 Special Matrices  Identity Matrix (I)
 Example 1
 Example 2
 Example 3
 Example 4
 Intro 0:00
 Introduction 0:08
 Definition of a Matrix 3:02
 Size or Dimension
 Square Matrix
 Denoted by Capital Letters
 When are Two Matrices Equal?
 Examples of Matrices 6:44
 Rows x Columns
 Talking About Specific Entries 7:48
 We Use Capitals to Denote a Matrix and Lower Case to Denotes Its Entries
 Using Entries to Talk About Matrices 10:08
 Scalar Multiplication 11:26
 Scalar = Real Number
 Example
 Matrix Addition 13:08
 Example
 Matrix Multiplication 15:00
 Example
 Matrix Multiplication, cont.
 Matrix Multiplication and Order (Size) 25:26
 Make Sure Their Orders are Compatible
 Matrix Multiplication is NOT Commutative 28:20
 Example
 Special Matrices  Zero Matrix (0) 32:48
 Zero Matrix Has 0 for All of its Entries
 Special Matrices  Identity Matrix (I) 34:14
 Identity Matrix is a Square Matrix That Has 1 for All Its Entries on the Main Diagonal and 0 for All Other Entries
 Example 1 36:16
 Example 2 40:00
 Example 3 44:54
 Example 4 50:08
Precalculus with Limits Online Course
Transcription: Matrices
Hiwelcome back to Educator.com.0000
Today, we are going to talk about matrices.0002
In some way, matrices are a natural extension of vectors.0004
Consider that we can express a vector as a horizontal array of numbers, where an array is just a bunch of different spaces to put numbers.0007
So, each component from a vector would be an entry in that array of numbers.0014
So, if we had some vector, (5,47,8), we could also put that as 5, and then a little bit of space, and then 47, and then a little bit of space, and then 8.0018
We have this array that is three different locations for numbers to go, this rectangular array.0026
A matrix takes this idea and expands on it.0031
The vector was just a single lineit was just a single row going on.0034
Instead of just having columns of numbers (we had that single row with three different columns),0040
we can take that, and we can have rows and columns.0044
This allows us to show lots of information in a single array.0050
Just like a vector allowed us to show more information than a single number, a matrix will allow us to show even more information than a single vector.0053
So, it is a way to compact lots of information in this single, really useful thing.0060
And we will end up seeing how they are useful later on.0064
Matrices have a huge number of uses, both in math and other fieldsthey are really, really useful things0067
for science, computer science, engineering, business, economics...so many things.0073
But it is going to take a couple of lessons before we can see how useful they are,0079
because we have to just get the basics of how they work learned before we can really see an application.0082
But in two lessons, we will see how ridiculously easy they make it to solve linear systems.0087
So, once we have matrices learned, and have a good understanding of them, we will be able to solve linear systems easily, which is really cool.0093
Also, I want to mention: this lesson right here is going to be on how matrices work, what a matrix is, and how they interact in various different ways.0101
But many teachers and textbooks don't start with matrices as how a matrix works;0111
they start with it as specifically using it to solve linear equations0116
through augmented matrices, row operations, and GaussJordan elimination.0120
If that is what you are looking for, you have a math class and you are trying to get more understanding of those things,0125
you are going to want to take a look at the lesson Using Matrices to Solve Systems of Linear Equations.0130
The first half of that lesson will go over augmented matrices, row operations, GaussJordan elimination...0135
And there will be some examples about how that stuff works there.0141
So, if that is what you are looking for right now, you might want to go check that out, as opposed to this lesson.0143
However, that said, you are going to end up coming back to everything that is in this lesson.0147
It is just a question of if you introduce the idea of matrices through that stuff first, and then go on to talk about how they work;0151
or if you talk about how matrices work, and then you get to that stuff later.0157
I prefer talking about matrices first, and then getting to the applications; but it depends, from teacher to teacher and textbook to textbook.0160
So, in your case, you might be interested in watching that lesson first.0166
But you are going to end up coming back to this lesson and watching it anyway.0168
And some of the stuff in that lesson will make more sense if you watch this one first.0171
So, you might even find it worthwhile to watch this lesson before you get around to watching that, if you have time.0174
All right, let's get into this: a single object is a matrix, but if we are talking about multiple of them, in the plural, it is matrices.0178
It is a rectangular array where each entry is a number.0189
So, an array is just...imagine a bunch of boxes stacked together to make a rectangle of boxes.0191
And inside of each box, you can put in numbers; so you can put a number here, a number here, a number here, a number here, a number here...0198
And we call each of those places where you could put a number an entry.0204
We have some a = some number here, some number here, going all the way down to some number here,0208
some number here, some number here, going all the way down to some number here;0214
and the same thing going right as well...and then there are a bunch of numbers in the middle.0217
So, it is just a rectangular arraya bunch of places to put numbers in this nice rectangular thing.0222
It is like looking at a piece of grid paper and boxing off some part of it, and then writing a number inside of each of the grids.0228
All right, for a matrix with m rows and n columns (notice that it has m rows and n columns), we say it has an order of m by n.0237
We can put these two things together to talk about the order of the matrix.0255
This property is also sometimes called size or dimension; those are sometimes used as synonyms for order.0259
For the most part, we will just use "order" in this course, but I might say "size" occasionally.0264
We can also write order as A_{m x n}: we write a little part underneath it, m x n.0268
So, if we mainly want to talk about some specific matrix, A for example, we can talk about A.0274
But if we want to mention its order as we are talking about A, we can write its order down to the side as a subscript, m x n.0279
If a matrix has equal numbers of rows and columns, if they are the same number of rows and columns,0286
m = n, we call it a square matrix, because we have a square object.0291
Matrices are usually denoted by capital letters, like A, but you might see other ones, as well.0296
Two matrices, A and B, are equal if they have the same order (they are the same size), and all of their entries are equal.0303
They have the same size, and then, if we go to any given one of the locations over here, it is the same as the same location over here.0310
We go to some location here; it is the same as the location over here.0317
You choose one location here; it is the same thing as this location here.0320
So, they have to look exactly the same for them to be equal to each other.0323
I also really want to drive home this fact that it is an m x n matrix with rows by columns.0327
It is always rows by columns; I found this a little bit confusing at first, but I would recommend:0338
the way to think about this, as a row, is something that goes leftright; a column is something that goes updown.0344
So, whenever we are talking about stuff in math, we normally talk leftright, then updown,0353
(x,y) when we are talking about rectangular coordinates.0358
So, when we are on the plane, we talk about the horizontal stuff, and then the vertical stuff,0361
which is why we talk about the rows, which horizontal thing we are talking about,0367
and then the columns, which vertical thing we are talking about.0371
It might get a little bit confusing as you work through it.0374
But just always remember: it is rows then columns; this order of rows, then columns, ends up being very important0376
for a lot of stuffthe way we talk about specific entries.0383
So, it is just really important to remember this "rows by columns."0385
The best mnemonic I can offer you is thinking in terms of the fact that rows are leftright; columns are updown;0389
and we go leftright, then updown, so it is rows, then columns, rows by columns.0396
But it is something that you just have to remember.0401
All right, with this idea in mind, that it is rows by columns, let's look at a couple of examples.0404
If we have a 3x3 matrix, then that means we have 3 rows, and we have 3 columns.0413
If we have a 2x3 matrix, then we have 2 rows, and we have 3 columns.0421
If we have a 5x1 matrix, then we have 5 rows, and we have 1 columnthe same thing for all of them.0428
Also, I want to point out some of the numbers here.0436
We can have just whole numbers, like 17; but it is also perfectly fine to have decimal numbers, like 4.2.0438
We can have negative numbers, like 19; we can also have irrational numbers, like √2 or π.0445
We can have fractions: 5/7, 1/2; anything that is a real number at all can be one of the entries in a matrix.0452
Any number at all can be something inside of a matrix.0459
Talking about specific entries: we can also talk about some specific entry that is in row i and column j in our matrix.0464
And so, i and j are just standing in for numbers; we will swap them out for numbers later, when we need to.0471
In A that is a 3x3, this matrix right here, the entry in row 2, column 3 is 8.0476
So, we go to row 2: 1, 2; so we are on this one here; and column 3: 1, 2, the third column; so we are on this column here.0486
They end up intersecting right here, and so, we have row 2, column 3, is 8.0498
All right, we can expand on this idea: we use capitals to denote a matrix, like A.0510
So, we can often use corresponding lowercase letters to denote the entries inside of it0517
so, A to denote the entire matrix, and a if we want to talk about some specific entry inside of it.0522
We can talk about a specific entry by using a subscript, ij, where a subscripthere is our number, and then ij,0528
or any subscript, is just numbers that are down and to the right of the number; that is where we have our subscripts.0535
So, we have ij on it; so we can combine those two, and we have a_{i,j}, subscript ij.0543
And that will denote the i^{th} row and j^{th} column.0549
i came first, so that is talking about the rows; j came second, so that is talking about the columns.0552
So, a_{i,j} is the i^{th} row, j^{th} column.0558
So, that means we could talk about a_{1,1}: that would be first row, first column, so we would get 17.0563
We could talk about a_{2,1}; that would be second row, first column; so that would be 0.0570
Second row, second column is also 0; we could have a_{2,3}, second row, third column; so that would be 8.0576
That is exactly what we figured out at the beginning: row 2, column 3, is a_{2,3}.0585
Or we could have a_{3,2}, third row, second column, which gets us 3.0590
So, this gives us another way to talk about where a number is.0597
We can talk about it in terms of this entry, and a subscript to say which of the entries it is.0601
With this idea in mind, we have another way to talk about a matrix.0607
As opposed to a matrix being the entire matrix, or a matrix just being this capital letter that represents it,0610
we can see it as a series of entries represented by this a_{i,j}.0615
There is a first row first column, first row second column, first row third; then second row first column, second row second column, third row second column, etc.0620
It is just a bunch of entries making up the whole thing.0628
With this idea in mind, instead of having to write the entire matrix like this...we don't have to do the entire matrix.0632
We don't also have to just use a single letter to denote the whole thing, like just A.0642
We can instead refer to it by using a single representative entry to stand in for all entries, a_{i,j}.0647
So, it is like saying, "Here is some a_{i,j} that is talking about all of the different things at once."0653
So, we can see what happens to this one that is representing all of them at once.0659
Notice: since i and j can change, a_{i,j} is a placeholder for all of the entries in A.0664
It is not just one thing; it is all of them at once.0670
In a way, it is representing all of them at once by letting us see how something happens to one of them in there.0674
So, i,j is i^{th} row, j^{th} column; so we have another way to talk about a matrix.0680
All right, at this point we are ready to actually talk about how we can do some basic arithmetic with our matrices.0686
Given some matrix A and a scalar (that is to say, just a real number k), we can multiply the matrix by that number.0692
k times the matrix A becomes k times a_{i,j}, that is, each of the entries of our matrix A gets multiplied by k.0699
So, every entry of A is multiplied by k.0708
Notice that this is just like multiplying a vector by a scalar.0711
If we have some vector, and we multiply it by a scalar, then that scalar multiplies on each of the components of the vector.0714
It is scaling the vector; it is multiplying each of the components.0721
So, if we have a scalar, and we multiply a matrix, that scalar multiplies each of the entries,0723
because a matrix doesn't have components; it has entries, because we have to talk about every row.0728
A vector is just a single row, but a matrix is many, so we talk about multiplying all of the entries.0734
So, other than that distinction between entries or components, it is very much the same thing.0739
A scalar on a vector multiplies each of its numbers.0744
A scalar on a matrix multiplies each of its numbersit is basically the same thing.0747
So, let's look at a quick example: if we have 3 multiplying on the matrix 1, 4, 10; 19, 7, 20;0752
then we have that 3 multiplies on the first row, first column;0759
and that is going to get 3 times 1, which gets us 3; so the same location is now multiplied by 3.0763
3 times 4 gets us 12; the same location is just multiplied by 3.0769
3 times 10 gets us 30; 3 times 19 is 57; 3 times 17 is 21; 3 times 20 is 60; great.0773
Matrix addition: given two matrices, A and B, that have the same order (they have to have the same order;0783
otherwise it won't workwe will see why that is in just a second), we can add the two matrices together.0789
So, A + B: every i^{th} row, j^{th} column of the resultant matrix will end up being a_{i,j} + b_{i,j}.0794
That is to say, we are adding together entries that come from the same location.0803
If this one was from this place over here, and this one was from this place over here, these two different numbers,0809
we add them together, and that comes out to be that new place in our new matrix that we are creating.0813
Note that this is very similar to adding vectors componentwise; it is very much the same thing as when we added vectors.0818
If you add two vectors, you just take the first components, and you put them together;0824
the second componentsyou put them together; the third componentsyou add them together, until you get through the entire vector.0828
If we are doing it with a matrix, it is the same thing, except, instead of components, we now have to do it to each of the entries.0833
So, first row, first column entries: you add them together; first row, second column entriesyou add them together, until you get done with that row.0838
Then second row, first column entriesyou add them together; second row, second column entriesyou add them together;0845
second row, third column...etc., until you have made it through all of the rows and all of the columns.0850
You take a given location; you put the things together from that location; that gives you the value for the same location in the new matrix.0854
Let's look at an example: if we have the matrix 4, 8, 3, 7, and 1, 3, 3, 0, we take first row, first column in both of them,0862
so 4 + 1; and that puts out 5 in the first row, first column of our new matrix.0870
The same thing for first row, second column: 8 and 3 are in them, respectively: 8 + 3 becomes 11; first row, second column0875
is the same location as what it just came from, in our new matrix.0884
The same thing over here: 3 + 3 becomes 0; and finally, 7 + 0 becomes positive 7; great.0887
So, we are keeping the location and adding them together, and that is what we get in our new matrix.0895
Matrix multiplication: now, this one is going to be very different.0900
The previous two made sense; they were a lot like what we were used to doing with vectors.0905
You multiply everything with a scalar; you add based on location with addition.0909
Matrix multiplicationthis one is going to twist your brain a little bit.0914
So, it is confusing at first; but the applications in a couple of lessons will hopefully make us see0917
why we end up doing this kind of confusing thing, because there ends up being some purpose to this stuff.0923
But for now, we are not going to really have a very good understanding of why that has to be the case.0929
So, we just want to be careful and follow the rules precisely and pay close attention when you multiply matrices.0933
It is really, really easy to make mistakes with multiplying matrices, especially the first couple of times you are doing it.0938
So, you really have to be very careful and pay attention.0944
So, just follow these rules carefully; it is going to be confusing at first, but don't worry.0946
As we work through a bunch of examples, it will make a lot more sense.0950
The formal definition, the first thing that we are going to see, is probably the most confusing thing of all.0953
But as we see it in action, it will start to make a lot more sense.0957
So, just work through it; you will end up understanding this by the time we get to the examplesno problem.0959
All right, if we have some matrix A, and it is an m x n matrix, and B is an n x p matrix, we can multiply them together.0964
Notice that the m here and the m here match up: there are m rows and n columns in our first matrix,0971
and n rows, p columns in our second matrix; so the number of columns in the first matrix0979
matches up with the number of rows in the second matrix; that is an important ideait will come up later on.0984
We can multiply them together, and we create a new matrix, AB.0989
That is going to end up being m x p, the things that didn't match up.0994
Or they could match up; but they don't have to match up.0998
And we define AB as: AB, the i^{th} row, j^{th} column of AB becomes c_{i,j},1000
where c_{i,j} is equal to a_{i,1}b_{1,j} + a_{i,2}b_{2,j},1007
up until we get to a_{i,n}b_{n,j}.1013
What does that mean? Let's look at that a little bit.1016
a_{i,1} is the i^{th} row of A, first entry.1018
The b_{1,j} is the first entry of the j^{th} column, because it is the first row, but in our j^{th} column.1029
So, it is the first entry; so it is the first entry, i^{th} row, A; first entry, j^{th} column, B.1035
a_{i,2} is second entry, i^{th} row of A; and b_{2,j} is second entry, j^{th} column of B.1042
So, we multiply those together; we add them together with the other ones.1050
We keep doing this down the line, where it is the n^{th} entry of i^{th} row of A,1052
and the n^{th} entry of the j^{th} column of B.1057
Notice that the n^{th} entry, in both of those cases, ends up being the last entry of that matrix.1061
If A is an m x n matrix, then for our A right here, i,n, well, the i^{th} row has to stop at the n^{th} entry,1065
because it only has n many columns to work its way through.1073
The same thing with b_{n,j}: the n^{th} entry in the j^{th} column has to stop there,1076
because it has only n many rows to work through, to have things there.1081
So, that ends up stopping; and they stop at the same place, which is useful.1084
All right, so that is the entry c_{i,j} of AB, the product of the two.1088
The entry in its i^{th} row and its j^{th} column is the sum of the products1092
of corresponding entries from A's i^{th} row and B's j^{th} column.1099
So, we are looking at the i^{th} row of our first oneour first matrix, A, its i^{th} row1103
times the j^{th} column of B, our second matrix.1109
We are multiplying them together, based on first entries, second entries, third entries, fourth entries...1115
We multiply them together, and then we add them all up together.1121
And that ends up giving us the value for the resultant product matrix in its i^{th} row and j^{th} column.1124
I know that it is confusing right now; it will make a lot more sense as soon as we start working on examples.1130
So, we can see this visually as taking the i^{th} row (this is the i^{th} row of A),1135
and then herethis would end up being the j^{th} column of B.1144
Our first matrix's i^{th} row, times the second matrix's j^{th} column: we multiply them together,1154
where a_{i,1} is multiplied times b_{1,j}, plus a_{i,2} times b_{2,j}...1162
The first entry here is multiplied times the first entry here; the second entry here, times the second entry here;1167
the third entry here, times the third entry here.1173
We multiply them all together like that; then we sum everything up.1178
And that ends up producing c_{i,j}, which is the i^{th} row and j^{th} column.1182
All right, that is what we end up getting here.1193
All right, we are ready for an example.1195
Let's look at how we would find the entry in the first row and third column of the product from the matrices below.1198
If we are looking for the first row, then that is going to be the first row of our first matrix, so 2, 1.1204
Then, the third column: columns are going to come from the second matrix: so third column...1, 2, 3..the third column here: 5, 0.1213
So, the first entries are 2 times 5; so that is 2 times 5, plus 1 times 0; that gets us 10, so 10 is what goes here in the first row and third column.1223
That is what we end up getting; we end up getting this number 10.1246
We are taking that first row, the third column; we are multiplying together in this strange way.1250
We are adding up, and we are plugging that in for the entry in the matrix that we are creating.1256
Now, notice that this bears some resemblance to dot products.1264
We can think of this i^{th} row as being a vector, because it just has a bunch of pieces to it.1267
It has a bunch of components to it, since it is just one dimension in one way.1272
It is just a vector in one way: 2 and then 1.1276
And then, we have this j^{th} column over here; we can think of this as also being a column vector.1280
We have this vector here and this vector here; we are taking the dot product of them: 2, 1 dotted with 5,0.1285
2 times 5 is 10; 1 times 0 is 0; so we get a total of 10.1292
So, we can think of it as being the i^{th} row, dotted with the j^{th} column.1296
If you think that is confusingif you never really had a very good understanding of how dot products work in vectorsthat is perfectly fine.1301
Don't worry about that; just think of it in terms of multiplying and multiplying like this.1307
But if the dot product stuff made a lot of sense to you in vectors,1311
you can think of it as turning this row into a vector briefly, turning this column into a vector briefly,1314
taking the dot product, and then moving on and doing the same thing with new vectors in a sortof vector set.1318
It is not exactly like vectors, because we are working inside of a matrix.1324
But it is working very much under that same idea of multiplying based on location of entry, and then adding it all together.1327
All right, let's work this whole thing out: we will use red to talk about everything that this first row is going to.1335
What is the size of this going to come out to?1340
First, let's figure that out, so we can draw in bars for where we are going to multiply.1342
This is a 1, 2, 3...so it is a 3 x 2 matrix, because it has 2 columns.1347
And this has 2 rows and 3 columns, so it is a 2 x 3 matrix; so the 2 and the 2 match up here,1354
so it is going to end up coming out over here; our size is a 3 x 3 matrix.1362
And that also makes sense, because in our first matrix, we have three rows; and in our second matrix, we have three columns.1366
So, each of the things that will come out in our product is a way of putting a row and a column together.1372
Three rows; three columns; they end up stacking into a 3 x 3 product matrix.1377
All right, with that in mind, we know that what is going to have to come out of this is a 3 x 3 matrix.1383
So, I will leave enough room, approximately, to put in a 3 x 3 matrix inside of there.1388
The first one: the first row, first column, will give us the location that is the first row, first column in our product matrix.1394
2 times 2 and 1 times 3, then added together: 2 times 2 is 4; 1 times 3 is positive 3; so 4 + 3 is 7.1402
2, 1 on 1, 3 (first row on second column): 2 times 1 is 2; 1 times 3 is 3; add those together, and you get 1.1414
2, 1 on 5, 0: 2 times 5 is 10; 1 times 0 is 0; so we get 10.1424
So, there is our first row, after we have worked through all three columns.1430
The next one; let's use a new color here: 3, 4 on 2, 3; 3 times 2 gets us 6; 4 times 3 gets us 12; so it comes out to 6.1435
3, 4 on 1, 3; 3 times 1 is 3; 4 times 3 is 12; so that gets us 15 when we add them together.1447
3, 4 on 5, 0; 3 times 5 is 15; 4 times 0 is still 0; so that totals to 15.1454
The last one, the final color: 0, 5 on 2, 3; 0 times 2 is 0; 5 times 3 is 15; 0 times 1 is 0; 5 times 3 is +15;1460
and 0 times 5 is 0; 5 times 0 is 0; 0; and that is our final result.1474
So, we are working through, taking a row in our first matrix, then multiplying it against a column in our second matrix.1481
And we are doing location of entry: first entries, second entries, third entries, fourth entries, as many as we have entries.1491
We multiply the location of entries (first entries together, second entries together, third entries together...)1497
multiply based on that, and then sum up the whole thing; and that is what gets us what comes out1501
as our product for that row number and that column number.1506
It makes a lot more sense after you just end up working with it, after you end up getting some practice in.1510
As soon as you start working on examples like this yourself, as soon as you do some practice homework, it will make a lot more sense.1515
But we will also get the chance to work on another example a little bit later.1520
All right, matrix multiplication and order: to multiply two matrices together, we have to first be sure that their orders are compatible.1524
We have talked about this a little bit so far.1530
The numbers of columns in the first matrix must equal the number of rows in the second matrix.1532
The number of columns in the first matrix must be the same as the number of rows in the second matrix.1538
And then, what comes out of it is this m x p; so AB_{m x p}.1544
So, we have n columns in our first matrix, times n rows in our second matrix.1549
Why is this the case? We can just believe this rule, but let's also get a sense for why it is the case.1558
Well, consider this: if I have, say, a 3 x 2 matrix (let's use red, so we can see how it matches here),1563
and then we have something here, something here, something here, something here, something here, something here;1582
notice that if you look at the length of any row, the length of any row is 2.1589
The length of a row is based on how many columns you have, because each column is an entry.1594
If we look at a row, then it is going to span all of those columns; so it is going to be a question1599
of how many times it has something to go inside of the row.1603
Well, that is going to be a question of how many columns are going through that row.1606
So, the number of entries in a row is going to be based on the number of columns.1610
Similarly, if we have a 2 x 3 matrix, then it is going to be 2 rows, 3 columns.1615
If we grab some column, how many entries are going to be in the column?1624
Well, it is how many rows it goes deep.1628
So, the number of rows is going to tell us how many entries are in a given column.1631
Now, the way matrix multiplication works is: it is this thing, the row, times this thing, the column.1637
It is the row times the column; well, this whole thing has to be first entries against first entries,1644
second entries against second entries, third entries against third entries...1650
So, we have to have the number of entries match up.1653
If we have a different length in the row than the columnthey are different lengths, row versus columnwe are not going to have them match up.1656
This thing doesn't really make sense; so we are required...the idea of this is for the length here to match up to the length here.1664
And that is why we have this requirement: because the length of a row is based on how many columns it has.1670
The length of a column is based on how many rows it has.1675
So, that is why we have to have these matching here.1678
Otherwise, it won't make sense for the way we have this thing defined, because we will have something longer than the other thing;1682
and what do you multiply by then?because you don't have the same number of entries; it doesn't make any sense.1687
When you take dot products with vectors, they have to have the same number of components for you to be able to take a dot product.1692
It is sort of the same thing going on here.1696
Matrix multiplication is not commutative; this is absolutely mindblowing,1699
because it is not something that we have seen anywhere else in math at this point, I am pretty sure.1704
So, at this point, we probably want to know what it means to be commutative,1709
before we try to understand matrices not being commutative.1713
Let's look at that: commutative means that x times y is the same thing as y times x1716
that this operation from the left is the same thing as the operation from the right.1722
x on the left of y is the same thing as x on the right of y; x times y equals y times x.1726
It doesn't matter which direction that x multiplies from; you get the same thing out of it, at least in the real numbers.1733
5 times 7 is the same thing as 7 times 5; 8 times 3 is the exact same thing as 3 times 8.1738
So, that is something we are pretty used to that makes a lot of sense to us.1746
It doesn't matter which direction you multiply from; it comes out to be the same thing.1749
So, we have never had to worry about it.1751
Well, it is time to start worrying about it: matrices are not commutative, in general.1753
That is, for most matrices A and B, AB is not equal to BA.1758
It is totally different if A multiplies on the left side, or if A multiplies on the right side; you will get totally different things.1764
Now, there are some cases when AB will be equal to BA; it is not an absolute, hardandfast rule that AB can never equal BA.1770
It is just like 99% of the time that AB will not be equal to BA.1778
Given two random matrices, chances are that they are not going to end up being the same, depending on the order of multiplication.1782
So, you have to pay attention to who is multiplying from which side.1790
You will have totally different things, depending on changing the order of multiplication, usually.1793
There are some cases where it won't be, but for the most part, they are totally different things.1797
So, you can't rely on having x times y equal to y times x, because all of a sudden, it is not equal to the same thing.1801
You are going to have to pay attention to the order that things are multiplying.1807
Let's look at an example to really make this clear.1811
If we have this first matrix, 4, 2, 3, 1, and 3, 0, 5, 2; then we know we are going to get a 2 x 2 matrix out of this, because they are both 2 x 2.1813
So, 4, 2, 3, 5....4 times 3 gets us 12; 2 times 5 gets us 10; so that comes out to 2.1822
4, 2 on 0, 2: 4 times 0 is 0; 2 times 2 is 4; 3 on 1...let's use a new color here; 3, 1 on 3, 5; 3 times 3 gets us 9; 1 times 5 gets us 5; so 14 total.1829
3, 1 on 0, 2; 3 times 0 is 0; 1 times 2 is 2; OK, so that is what that first matrix came out to be.1846
What about this one here, where we flipped the order of multiplying them?1854
We have 3, 0 on 4, 3 now; once again, it is going to come out as a 2 x 2 matrix: 3, 0 on 4, 3:1857
3 times 4 is 12; 0 times 3 is 0; so we have 12.1865
At this point, we already see that we are not the same; on the first one we did, that first multiplication,1869
our first row, first column was 2; in the second one, our first row, first column, was 12.1875
2 versus 12 is totally different; we know that these matrices cannot be the same anymore,1881
because one of their entries is different, and that is enough to say that they are not equal.1886
However, let's get a sense for just how different they are; let's look at the rest of this thing.1890
3, 0...the first row, on the second column now...on 2, 1: 3 times 2 gets us 6; 0 times 1 gets us 0; so 6.1894
5, 2 on 4, 3; 5 times 4 is 20; 2 times 3 is 6; so 26.1902
5, 2 on 2, 1: 10 + 2 gets us 8.1911
So, notice: these things are totally and utterly different.1916
2, 4, 14, 2 is completely different than 12, 6, 26, 8.1921
This is a case that really helps us see how different these things are.1929
AB is not equal to BA in a single one of its entries; we get totally different things.1934
So, the order of multiplication, if you are multiplying from the left or you are multiplying from the rightthat really, really matters.1940
And that is going to affect how we pay attention to doing matrix algebra in the next two lessons.1945
That is something to think about later on.1949
But for right now, you just have to be aware that AB and BA are totally different.1951
Swapping the order of matrix multiplication means you have to do it again,1955
because you have no idea what is going to come out of it until you actually work through it.1958
All right, finally, we have two special matrices to talk about.1962
First, the zero matrix: the zero matrix is a matrix that hasno big surprise0 for all of its entries.1966
A zero matrix can be made with any order at all.1973
It is denoted by a 0 as bold; however, if you are writing it by hand, normally you can just tell by writing a zero;1975
and people will know, from context, that that 0 is supposed to be a zero matrix, depending on how the problem is working.1982
But if you really want to denote it, you could probably put some underlines underneath it, or something,1987
to show that it is really importantwhatever you want to be able to see that it is definitely a matrix.1991
But for the most part, just writing a 0, if it is next to other matrices...people will know what you are talking about.1997
If you need to show its order, you can write it with a subscript of m x n; that tells us that that zero matrix will have m rows, n columns.2002
So, for example, if we had 3 x 3, then we have 3 rows and 3 columns of nothing but zeroes.2010
If we have 5 x 2, then we have 5 rows and 2 columns of nothing but zeroes.2017
For any matrix A, A  A comes out to be the zero matrix, because each of its entries will be subtracted2023
by it entries again, so each entry will turn into a 0; we get the zero matrix.2029
And also, the zero matrix, times A, equals the zero matrix, which is equal to A times the zero matrix.2033
So, the zero matrix, multiplying on some other matrix, by the left or the right, turns it into the zero matrix.2039
The zero matrix, through multiplication, crushes other matrices into the zero matrix.2045
All right, finally: the identity matrix: the identity matrix is a square matrix2050
(it is always going to be a square) that has 1 for all of its entries on the main diagonal, and 0 for other entries.2056
It can be any order, as long as it is a square.2064
It is denoted with the symbol I; so you just write that out like a normal capital I.2067
If you need to show what its order is (and remember, its order is going to have to be n x n,2073
because it has to have the same number of rows and columns; we can't have different numbers there),2077
we can use just I with a subscript of n, because we don't have to say n x n,2080
because it has to be square, so we just use one number, one letter.2084
So, if we want to talk about I_{2}, then that would be a 2 x 2 matrix with 1's on the diagonal, and 0's everywhere else.2088
If we want to talk about I_{5}, the identity matrix as a 5 x 5, then that is 1's on this main diagonal,2099
from the top left down to the bottom right; and it is going to be 0's everywhere else on the thing.2104
Why is this identity matrix useful? For any matrix A, any matrix at all, as long as they match in orders appropriately,2116
and there is always going to be some identity matrix that will match up appropriately with any given matrix,2123
identity matrix A is equal to A, and A times the identity matrix is equal to A.2128
The identity matrix, multiplied from the left, or the identity matrix, multiplied from the right, comes out to be2134
just whatever matrix we had started with that wasn't the identity matrix.2140
The identity matrix effectively works the same as multiplying a real number by 1.2143
5 times 1 just comes out to be 5; 20 billion times 1 just comes out to be 20 billion.2148
The identity matrix works the same way: I times A just comes out to be A; I times C just comes out to be C.2153
So, whatever matrix we have, we multiply by the identity matrix; it is the multiplicative identity.2161
It just leaves it as it normally was; it leaves its identity aloneit leaves it the same.2166
All right, we are ready for some examples.2172
First, a little bit of scalar multiplication: let's do the scalar multiplication, and then we will do the subtraction or addition.2174
2 times 5, 7, 2, 11, 3, 4; its order stays the same, so 2 times 5 is 10; 2 times 7 is 14;2180
2 times 2 is 4; 2 times 11 is 22; 2 times 3 is 6; and 2 times 4 is 8.2189
So, at this point, I am going to change this into a plus, and I am going to say that we had 3 here.2196
+ 3 times something is the same thing as 3 times something.2202
We can pull that negative out and put it on the scalar instead.2205
We do that here: 3 times 3 gets us 9; 3 times 2 gets us +6; 3 times 2 gets us 6; 3 times 6 gets us 18; 3 times 0 gets us 0; 3 times 5 gets us +15.2209
At this point, we are ready to combine them: we combine the two things together.2224
We do it based on location: so 10 and 9 will go in the first row, first column, because they came from the first row and first column.2229
10 and 9 gets us 1; it is going to have the same order here.2235
14 and 6 gets us 8; 6 and 4 gets us 2; 22 and 18 gets us +4; 6 and 0 gets us +6; 8 and 15; and we have 7; and there is our matrix.2239
All right, now we could have done this a different way.2262
At this point up here, we chose to do plus onto a negative scale, but we could have left it with subtraction.2265
If we had chosen to leave it as subtraction, our first matrix would have remained the same: 10, 14...2272
still the same scalar, so nothing is going to change here from that first matrix.2279
And now, it is going to be minus...we could multiply that scalar by it instead.2283
So, we are going to leave it as a subtraction, but we are just going to multiply that +3 as if it wasn't changed over.2288
So, 3 times 3 gets us 9; 3 times 2 gets us 6; 3 times 2 gets us +5; 3 times 6 gets us +18; 0; and 15.2297
All right, notice: the only difference between these two matrices is this negative sign having hit everything.2308
At this point, we can subtract, and we would end up having 10  9; 10  9 comes out to be 1.2315
14  6; well,  6 becomes + 6; 14 + 6 becomes 8; 4  6 is 2; 22  18 is 4; 6  0 is 6; 8  15 becomes + 15; 8 + 15 becomes +7.2323
So, we end up getting the exact same thing.2343
Whichever way we do it ends up coming out to be the same thing, which is what we had hoped.2345
I would, for the most part, recommend doing this method that I did here, where you make it addition, and you put the negative on the scalar.2350
You swap it from being subtraction to addition, and then you put the negative on the scalar.2359
And then, you multiply that through, because it gives you one less thing to have to keep track of,2364
as opposed to having to remember the entire time, "I am subtracting; I am subtracting; I am subtracting,"2367
because then, if you forget to subtract just once, your answer is gone; you now have the wrong answer.2371
But if you put the negative on it there, then you remember to multiply by the negative the whole time through.2375
And then, from there, it is just addition.2380
I think it is easier that way; but if you think it would be easier by doing subtraction, go ahead and do that.2382
Whatever works best for you is what you want to use.2386
But I personally would recommend multiplying by the negative, and then doing addition, as opposed to keeping around subtraction.2388
But they will both work just fine.2394
The next example: A is this matrix; B is this matrix; C is this matrix; if the matrix multiplication below is possible,2396
give the order, the size, of the matrix that it would result in.2402
So, we have AB times B...OK, to do that, the first thing we are going to have to do is talk about what each one of these sizes are.2406
If we have 3 rows, 2 columns, that is a 3 x 2 matrix for A.2414
B is 2 columns, 3 rows, so that is a 2 x 3 matrix for B.2420
And C is 3 rows, 3 columns; it is square, so we have a 3 x 2 matrix here.2426
Great; so at this point, it is a question of comparingdo these things match up?2433
AB is going to be 3 x 2, multiplying against a matrix that is 2 x 3.2436
To do this, we have to have...the first one's number of columns has to match the second one's number of rows.2450
But an easier way to do this is to just think in terms of the inner numbers.2455
Are the inner numbers the same? Well, the inner numbers are both 2; so now, what is going to result is the outer numbers.2458
We get those outer numbers as the resultant size of the matrix; so we will get a 3 x 3 matrix in the end.2464
If we reversed this and looked at B times A, then we would have a 2 x 3 matrix times a 3 x 2 matrix.2470
We check: are the inner numbers the same? 3 and 3 are the same, so it becomes the outer numbers; those will be our resultant.2477
So, we will get a 2 x 2; so notice, AB and BA are very different in the end.2483
And we can see that, just based on the fact that they have totally different orders.2487
So, you can end up getting different sizes, as well, based on it.2490
Not only are they not commutative (we can't rely on AB being the same thing as BA); we can't even rely on the size remaining the same.2493
Next, let's look at C on B: that is a 3 x 3 times a 2 x 3; so in this case, do they match up?2503
Does 2 match up with 3are they the same number?2515
No, they don't match up; so we have no solution here.2517
A on C: a 3 x 2 matrix multiplied with a (sorry, I need to switch to green) 3 x 3 matrixdo they match up?2520
3 and 2 don't match up; so we don't have anything that comes out of that, as a result.2534
And finally, CAB: well, can we multiply multiple matrices together?2539
Surewe do one matrix multiplication; that comes out as another matrix; and then just multiply the resultant thing.2543
So, let's see if we can work through this: CAB is a 3 x 3, multiplied by a 3 x 2, multiplied by a 2 x 3.2548
So, our first question that we want to do...let's work from the left to the right.2560
So, we will look at what CA became, and then we will multiply by B.2563
So, CA...we have a 3 here; we have a 3 here; so that is going to result in a 3 x 2 (that is what CA would come out as),2567
times B still (we have to do B), 2 x 3; so now we askdo they match on the inside?2576
They match on the inside, so what is going to result is a 3 x 3; there is our answer.2582
Let's also look at it if we had gone from another directionif instead of going from the left, we came from the right.2588
We would hope that that would work out, because if it didn't, then there are some issues with how we have this stuff set up.2591
So, let's look at CAB, if we had done CAB from the right side to the left.2596
We have the same thing: a 3 x 3 is C; A is 3 x 2; and B is a 2 x 3.2605
So now, we are working from the right side; so what does AB come out to be?2613
Well, that is a 2 here and a 2 here, so that comes out to be 3.2617
And look, we already did thiswe already figured out what AB is.2619
We know that that should come out to be a 3 x 3; so from there, we have a 3 x 3 matrix.2622
And then, what came out of a AB is a 3 x 3 matrix; the 3's match up, so what we get in the end is a 3 x 3 matrix.2628
So, that checks out; either way we did it, it is the same.2638
One last thing to point out here: look, if we had a 3 x 3, if we had CAB one more time...a 3 x 2, and then a 2 x 3...2641
well, what we can do is say, "Do the inner parts match?"2654
The inner part here matches, and the inner parts here match.2658
Ultimately, what is going to happen is that all of the inner parts are required to match for multiplication to happen.2661
But they all disappear; the only thing that ends up making it out in the end is things on the far edges, the 3 and 3 on both sides.2665
So, what is going to come out in the end is a 3 x 3.2674
So, if you have multiple matrices multiplying against each other, you can just check and make sure that all of the inner numbers match up against each other.2677
And then, the size of the resulting thing will end up just being the far edge numbers, which were, in this case, 3 and 3.2683
All right, the next example is a big, big one of matrix multiplication.2691
We are going to work to simplify this, so first, let's see what size our product is going to come out to be.2695
So, we have a 3 x 3 and a 3 x 3; it is possibleno surprise there, since it was given to us as a problem.2700
That is going to come out as a 3 x 3 matrix.2705
At this point, let's work it out; since we are working with a 3 x 3 matrix, we will leave a nice, big chunk of space for us to work inside of.2709
So, we are going to work this out: the first row times the first column will get the number that is going to go2716
in our first row, first column of our resultant product matrix.2726
So, 6 (the first entry of the first row), times the first entry of the first column, 2, added to 22730
(the second entry of the first row), times the second entry of our first column, plus 3 times the final entry,2739
the third entry, of our first row, times the final of entry, the third entry, of our first column:2749
we work that out; we get 12 + 8  3; we get 15 + 8, so we get 7.2754
We have 7 for the entrythat first row, first column entry.2765
That is what is going on behind the scenes.2769
We are taking that row; we are taking that column; we are multiplying them based on how the entries multiply together,2772
matching the entries, multiplying matching entries, and then summing up the whole thing.2778
We can see that as I just wrote it out there.2781
So, clearly, this takes a lot of arithmetic: we are doing three multiplications and three additionsit is tough to do this.2785
I would recommend, if you aren't excellent at doing mental math: really try to keep some scratch paper that you are doing on the side.2791
Be very, very careful working with your calculator; it is so easy to make mistakes in matrix multiplication,2798
Especially the first couple of times you are doing itit is something you really have to be careful with the first couple of times.2803
And it is something you always have to be careful with, because you can always easily make mistakes.2807
Even I will very easily make mistakes with matrix multiplication.2811
But if you just stay focused and pay attention to these rules carefully, and you work carefully,2814
you can always make sure that you get the answer right.2819
But just really be careful with matrix multiplication.2821
It is an easy place to make simple mistakes where you understand what is going on,2823
but you just made a little arithmetic error, and it makes your answer wrong; so be careful.2827
All right, I am going to do the rest of these by just working through them in my head and talking them out,2831
because I am pretty good at this; but be careful when you are doing it.2835
If you are not really good at doing this sort of stuff in your head, be careful; do it on scratch paper.2839
And the larger the matrices get, the harder it is to do in your head.2843
So, 6, 2, 3 on 1, 2, 0; the first row on the second column: 6 times 1 is 6; 2 times 2 is 4; 6 + 4 is 10.2845
3 times 0 is 0; so we get 10.2854
And then the final column: 6, 2, 3 on 3, 0, 1: 6 times 3 is 18; 2 times 0 is 0, so still 18; 3 times 1 is 3; so 18 + 3 is 15.2857
The next one (let's switch to a new color): second row: 1, 0, 8; multiply that by the first row;2868
so, second row, first column, is going to be 1, 0, 8 on 2, 4, 1; 1 times 2 is 2; 0 times 4 is 0;2874
so, 2 + 8 times 2 becomes +8, so 2 + +8 becomes +6.2881
The next one: 1, 0, 8 on 1, 2, 0; 1 times 1 is 1; 0 times 2 is 0; 8 times 0 is 0; so we just get 1 out of that.2890
1, 0, 8 on 3, 0, 1; 1 times 3 is 3; 0 on 0 is 0; 8 times 1 is 8; so 3 + 8 becomes 11.2901
And then finally, 7, 3, 5 on 2, 4, 1: 7 times 2 becomes +14; 3 times 4 becomes +12; 14 + 12 becomes +26;2911
5 times 1 is 5; 26  5 is 21; OK; 7, 3, 5 on 1, 2, 0: 7 times 1 is 7; 3 times 2 is 6; 7 + 6 is 1; and then + 5 times 0,2927
so we just come out to be 1 here.2942
And then the final one: 7, 3, 5, on 3, 0, 1: 7 times 3 becomes +21; 3 times 0 is 0; +21 still; plus 5 times 1 is 5; 21 + 5 is 26.2944
OK, so hopefully, that points out just how much arithmetic you are having to do in your head here.2960
I really want you to be careful, because this is the easiest way to make mistakes.2967
And it is the pretty silly way to end up losing points on a test or homework,2970
because it is not because you don't understand what is going on.2973
It is just because you are trying to do so much arithmetic in your head; it is easy to make a mistake.2975
If you end up having any difficulty with something particularly hard, just write it out on paper.2979
Or if you have a really nice graphing calculator, where you can see each of the numbers you are putting into it,2983
be careful; watch; make sure that what you have there matches up to what you have on the paper.2987
And then, make sure that you are being careful if you are using a calculator.2991
So, just be careful, however you are approaching it.2994
The actual process isn't that difficult, once you get used to it; but it is always going to be a real chance of making mistakes,2996
just because there is so much arithmetic going on.3002
All right, the final example: Prove that for any 2 x 2 matrix A, the zero matrix times A equals 0, and the identity matrix times A equals A.3004
So, any 2 x 2 matrix Ait says "any," so that means we can't just use some 2 x 2 matrix.3012
We can't actually put down numbers, because we have to be able to have this true for any 2 x 2 matrix.3018
So, if we came up with some matrix, like 3, 1, 7, 47; well, maybe it happens to be true for that matrix.3023
So, we have to figure out a way to be able to show that it is true for every matrix.3031
We need to write about this in a general form, so we do the same thing that we have everything set up in, where we use variables,3034
because if we have it as a, b, c, d, then any 2 x 2 matrix...we can just swap out a, b, c, d for actual numerical values,3039
and we will have any 2 x 2 matrixthis will be true for any 2 x 2 matrix.3049
So, we have that as an idea; so now we can just try multiplying.3052
If this is going to work for this A here, a, b, c, d, that is a standin for any 2 x 2 matrix at all.3056
So, if we can show that the zero matrix times this comes out to be 0 anyway, then it has to be true for all of them,3063
because they are just going to end up swapping out the variables, a, b, c, d, for actual numbers.3068
So, let's try this: the zero matrix times A = 0: well, if we have the zero matrix, then we are going to have 0, 0, 0, 0,3072
because it is multiplying against a 2 x 2; our A is a, b, c, d.3079
This is actually pretty easy matrix multiplication, thankfully.3084
0 and 0 times a and c; look, that is going to crush it down to 0.3087
We know that we are going to have to get a 2 x 2 matrix, because we started with 2 x 2 times 2 x 2.3091
0, 0 on b, d: well, 0 times b and 0 times dthat comes out to be 0.3095
0, 0 on a, c: 0 times a and 0 times cthat comes out to be 0.3100
0, 0 on b, d: 0 times b and 0 times dno surprise therecomes out to be 0.3103
So, we see, because it has nothing but zeroes that we are multiplying by:3108
whatever it is going to hit is going to get turned into a 0.3111
So, that is why the zero matrix, multiplied by any matrix at all, ends up coming out to be the zero matrix.3113
So, this checks out: and we can see that, if we had put it as the zero matrix,3119
multiplying from the right as opposed to the left, basically the same thing is going to happen,3123
because we are multiplying against, it is going to hit nothing but zeroes, so it is just going to get turned to 0's automatically.3126
So, the zero matrix, multiplied against any matrix, becomes the zero matrix.3132
Next, the identity matrix times A: let's show that that becomes A.3136
The identity matrix: well, A is a 2 x 2, so that means that our identity matrix will have to also be a 2 x 2.3140
So, 1's are on the main diagonal, with 0's everywhere else.3145
1, 0, 0, 1; the main diagonal has 1's, and then everything else will have 0's (in this case, not many 0's).3149
a, b, c, d: this will take a little bit more thought.3156
1, 0 on a, c: 1 times a...we are going to have to get a 2 x 2, because we started with 2 2 x 2 matrices...3160
1 times a comes out to be a; 0 times c becomes 0; so we have a.3170
1, 0 on b, d: well, 1 times b comes out to be b; 0 times d comes out to be 0, so we get just b.3175
0, 1 on a, c: 0 times a comes out to be 0; 1 times c comes out to be c.3183
0, 1 on b, d: 0 times b comes out to be 0; 1 times d comes out to be d.3189
That checks out; it ended up being the same thing.3194
So, it is a little bit harder to see why the identity matrix is working;3196
but basically, what it is doing is: when you multiply some other matrix by it,3199
since it has just a 1 in one place, it is seeing what is at the same location over here.3204
a is at the same location; b is at the same location; so they end up popping out.3209
For this one down here, 0 and 1, it is seeing what is at the same location: c and d are there, so they get to pop out, as well.3213
A similar thing ends up happening if you multiply the identity matrix from the right, instead of from the left.3219
Try it out for yourselftake a look, if you are curious about seeing it.3223
All right, that shows everything that we have.3226
We have a pretty good understanding of how matrices work at this point.3228
We are ready to go and see some of the cool things that we can start doing with them.3230
So, we will talk about some new ideas in the next section, the next lesson.3233
And then two lessons from now, we will see just how powerful these things can be3236
for solving problems that would seem really difficult; we are going to turn them so easy so quickly.3240
All right, we will see you at Educator.com latergoodbye!3245
1 answer
Last reply by: Professor SelhorstJones
Wed May 6, 2015 11:39 AM
Post by enya zh on May 5, 2015
For "Talking About Specific Entries", what if you had to talk about the 21th row and the 51th column? You have to write a2151 but would it be confused with row 215 column 1, or row 2 column 151?