For more information, please see full course syllabus of Math Analysis
For more information, please see full course syllabus of Math Analysis
Determinants & Inverses of Matrices
- The inverse of a matrix A is some matrix A^{−1} such that when we multiply them together we get the identity matrix, I. In other words, they "cancel" each other.
- Not all matrices can be inverted. A matrix that can be is called invertible (or `nonsingular'). If it can not be inverted, it is singular. To be invertible, a matrix must have these properties:
- The matrix must be square,
- The determinant of the matrix must be nonzero.
- The determinant is a real number associated with a square matrix. The determinant of a matrix A is denoted by either det(A) or |A|. [Although |A| may look similar to absolute value, it is the determinant of A and can produce any real number (including negative numbers).] If the determinant of a matrix is nonzero, the matrix is invertible, and vice-versa.
det
(A) ≠ 0 ⇔ A is invertible
det
(A) = 0 ⇔ A is not invertible - The determinant of a 2×2 matrix
is given byA = ⎡
⎢
⎢
⎣a b c d ⎤
⎥
⎥
⎦
A good mnemonic to remember this is to think in terms of diagonals: the down diagonal multiplied together then subtracted by the up diagonal (also multiplied).
det
(A) = |A| = ad − bc. - To take the determinant of a larger matrix, we need the two following concepts.
- Minors: For a square matrix A, the minor M_{ij} of the entry a_{ij} is the determinant of the matrix obtained by deleting the i^{th} row and j^{th} column.
- Cofactors: The cofactor is very closely based on the minor. It just multiplies the minor by 1 or −1 based on the location of the entry the minor comes from. The cofactor C_{ij} of the entry a_{ij} is given by
We can also see this as an alternating sign pattern. It's very similar to a chessboard where one color is positive and the other is negative. See the video for a visual reference.C_{ij} = (−1)^{i+j} M_{ij}.
Note that this is true for any value of k (as long as 1 ≤ k ≤ n). That is, we can choose to do this process with any row or column and get the same result.
det
(A) = |A| = a_{k1} C_{k1} + a_{k2}C_{k2} + …+ a_{kn} C_{kn} = a_{1k} C_{1k} + a_{2k}C_{2k} + …+ a_{nk} C_{nk} - For a 2×2 matrix
the inverse of A (if det(A) ≠ 0) isA = ⎡
⎢
⎢
⎣a b c d ⎤
⎥
⎥
⎦
, A^{−1} = 1 ad−bc
⎡
⎢
⎢
⎣d −b −c a ⎤
⎥
⎥
⎦
= 1
det
(A)
⎡
⎢
⎢
⎣d −b −c a ⎤
⎥
⎥
⎦
. - For the most part, at the level of this course or any similar math class, you will probably not need to compute the inverse of a matrix any larger than 2 ×2. If for some reason you need to calculate the inverse of a matrix that is larger than 2×2 and you must do it by hand, see the bottom of these notes.
- Given A and A^{−1}, we have A^{−1} A B = B: they cancel each other out and have no net effect. This is because
When multiplied together, they create the identity matrix I, which (as noted in the previous lesson) has no effect in multiplication.A^{−1} A = I = A A^{−1}. - It is important to note that if we multiply an equation by a matrix on both sides, we must choose a direction to multiply from and do the same for both sides of the equation. We must multiply on the left or on the right for both sides. [This is because PQ ≠ QP for most matrices.]
- To find the inverse of larger matrices by hand, we will need some techniques we haven't learned just yet. In the first part of the next lesson, we discuss augmented matrices, row operations, and Gauss-Jordan elimination. If you're not familiar with these things, go check them out first. Here are the steps to find an inverse for any size matrix:
1. For an n ×n matrix A, begin by creating an augmented matrix with the identity matrix I_{n}:⎡
⎣
A I_{n} ⎤
⎦
2. Apply the method of Gauss-Jordan elimination (use row operations) to reduce A (the left side) to I. The result of the augmented matrix will be⎡
⎣
I_{n} A^{−1} ⎤
⎦
3. Finally, check your work. It's very easy to make a mistake in all that arithmetic, so check by showing eitherA^{−1} A = I or AA^{−1} = I.
Determinants & Inverses of Matrices
Lecture Slides are screen-captured 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
- Not All Matrices Are Invertible
- Determinant
- The Determinant is a Real Number Associated With a Square Matrix
- If the Determinant of a Matrix is Nonzero, the Matrix is Invertible
- Determinant of a 2 x 2 Matrix
- Minors and Cofactors - Minors
- Minors and Cofactors - Cofactors
- Determinant of Larger Matrices
- Alternative Method for 3x3 Matrices
- Inverse of a 2 x 2 Matrix
- Inverse of Larger Matrices
- Using Inverse Matrices
- Example 1
- Example 2
- Example 3
- Example 4
- Finding the Inverse of Larger Matrices
- General Inverse Method - Step 1
- General Inverse Method - Step 2
- General Inverse Method - Step 3
- Intro 0:00
- Introduction 0:06
- Not All Matrices Are Invertible 1:30
- What Must a Matrix Have to Be Invertible?
- Determinant 2:32
- The Determinant is a Real Number Associated With a Square Matrix
- If the Determinant of a Matrix is Nonzero, the Matrix is Invertible
- Determinant of a 2 x 2 Matrix 4:34
- Think in Terms of Diagonals
- Minors and Cofactors - Minors 6:24
- Example
- Minors and Cofactors - Cofactors 8:00
- Cofactor is Closely Based on the Minor
- Alternating Sign Pattern
- Determinant of Larger Matrices 10:56
- Example
- Alternative Method for 3x3 Matrices 16:46
- Not Recommended
- Inverse of a 2 x 2 Matrix 19:02
- Inverse of Larger Matrices 20:00
- Using Inverse Matrices 21:06
- When Multiplied Together, They Create the Identity Matrix
- Example 1 23:45
- Example 2 27:21
- Example 3 32:49
- Example 4 36:27
- Finding the Inverse of Larger Matrices 41:59
- General Inverse Method - Step 1 43:25
- General Inverse Method - Step 2 43:27
- General Inverse Method - Step 2, cont.
- General Inverse Method - Step 3 45:15
Math Analysis Online
Transcription: Determinants & Inverses of Matrices
Hi--welcome back to Educator.com.0000
Today, we are going to talk about determinants and the inverses of matrices.0002
Consider if we wanted to find x in the equation 5x = 10--pretty basic algebra, right?0006
We would cancel out the 5 by dividing it on both sides.0012
Or equivalently, we could think of this as multiplying by 5 inverse, which is just 1/5.0014
If we multiply by 1/5 on both sides, we cancel out the 5, because the multiplicative inverse to 5 is 1/5; that why it is 5^{-1}.0020
What if we wanted to solve for the matrix X in the equation below?0028
We had some matrix A, times the matrix X, is equal to the matrix B.0031
We have this matrix equation; so we need to somehow cancel out A to get X alone.0036
It is the same basic idea; we just need to cancel out an entire matrix.0041
So, we need to multiply both sides by the inverse to A; this means we need to find the inverse to A.0044
If we can find this magical inverse, then we could multiply both sides.0050
We would have A^{-1}AX and A^{-1}B.0054
Well, the A^{-1} and the A will cancel each other out, and we would be left with X = A^{-1}B.0058
So, we would be able to solve for that matrix, that unknown matrix, X, if we wanted to,0064
in terms of this A^{-1} and B, if we know what A and B are.0068
It is very similar to 5x = 10; we multiply by the multiplicative inverse of 5, 5^{-1}, on both sides, to get what x is.0072
So, AX = B...we multiply by the multiplicative inverse of A on both sides to get that X alone.0079
Not all matrices are invertible; consider if we wanted to solve for X in the basic equation 0x = 0.0086
It would be impossible: the information about what x is has just been destroyed by that 0.0094
0 multiplied by anything is going to come out to be 0, so we don't have any idea what that x is anymore.0099
There is no way to cancel out 0, because 0^{-1} does not exist.0104
There are some special things out there that we can't invert.0109
There is no way to flip them to an inverse, because 0...you can't invert it.0112
You can't reverse the process of multiplying by 0; it is gone--the information is lost.0117
It is the same thing going for matrices: not all matrices can be inverted.0123
A matrix that can be is called invertible: if we can invert a matrix, we call it invertible, or we might call it non-singular.0127
If a matrix cannot be inverted, it is called singular.0134
To be invertible, a matrix must have two properties: the matrix must be square--it has to be a square matrix to invert;0138
and the determinant of the matrix must be non-zero.0145
So, what is a determinant? Let's start talking about determinants.0149
The determinant is a real number associated with a square matrix.0152
The determinant of a matrix A is denoted by either detA (like determinant of A--we are shortening it),0156
or vertical bars on either side of the matrix A.0163
Now, A may look similar to absolute value, but it is not; it is not absolute value--it is the determinant of A.0165
So, when it is vertical bars around a matrix, we are talking about determinant, not absolute value.0172
So, vertical bars around a matrix, unlike absolute value, can produce any real number, including negative numbers or 0 or positive numbers.0176
So, it is not limited to just giving out positive or 0, like absolute value; it is allowed to put out anything.0186
So, don't get confused by those vertical bars, thinking that that implies positiveness; it doesn't.0191
For the most part, though, I prefer this detA thing, this determinant of A; so that is the form that we will be seeing.0195
But occasionally, you will see it with the vertical bars, instead.0202
The determinant of a matrix has many important applications and properties.0204
There is a huge amount of stuff that this determinant is useful for.0207
But we are not going to get into that in this course.0211
In this course, we are only going to concern ourselves with one thing: whether or not a matrix is invertible, and the fact that a determinant tells us that.0213
If a determinant of a matrix is non-zero, then the matrix is invertible, and vice versa.0220
So, if the determinant of A is not equal to 0, then we know that A is invertible.0228
And if A is invertible, then we know that the determinant of A must not be equal to 0.0232
On the flip side, if the determinant of A is equal to 0, then we know that A is not invertible.0236
And if A is not invertible, we know that the determinant of A is equal to 0.0241
So, just remember that detA not equal to 0 means that it is invertible.0245
And that really works a lot like we are used to with the real numbers.0249
You can invert any number you want, except 0.0253
It is the same thing with matrices: you can invert any matrix you want, except for ones that have determinant 0.0256
All right, so think in terms of that: detA not 0 means invertible--you are allowed to invert; detA = 0--you are not allowed to invert.0261
So, let's see the determinant of a 2 x 2 matrix: if A = a, b, c, d, it is given by detA,0271
which is equal to this other way to write determinant of A, comes out to be ad - bc.0279
A good mnemonic to remember this is to think in terms of diagonals--0286
the down diagonal, ad, multiplied together, and then subtracted by this up diagonal here, cb or bc, so minus bc.0289
We subtract by that up diagonal.0303
Let's look at an example--let's do an example here: Multiply...0305
if we want to take the determinant of 5, 9, 3, 4, notice that we have these bars on either side.0309
If we have bars of some matrix inside, what that is saying is to take the determinant of that stuff on the inside.0315
Bars on either side is just like the bars on either side of the capital letter denoting the matrix.0326
It says to take the determinant of whatever is inside of there.0332
So, you will see that notation a lot; but when we are talking about just letters, I prefer that one.0334
OK, in either case, if we are taking the determinant of the matrix 5, 9, 3, 4--if we are taking this one right here,0339
the determinant of 5, 9, 3, 4, the first thing we do is take the down diagonal.0344
So, it is going to be 5 times 4; and then, it is going to be minus the up diagonal, 3 times 9, so 9 times 3.0351
5 times 4 - 9 times 3; we get 20 - 27, and that comes out to be -7.0361
Once again, the determinant can come out to be any number; it doesn't have to come out to a positive;0372
it just has to come out to any real number at all.0376
Minors and cofactors: first we are going to talk about minors.0380
Before we can look at determinants of larger matrices, we will need two concepts: minors and cofactors.0383
First, we are going to look at minors.0388
For a square matrix A, the minor, m_{i,j} (remember, i is the row i; j is the column j)0391
of the entry a_{i,j} is the determinant of the matrix obtained by deleting the i^{th} row and j^{th} column.0398
So, we go to this i,j location, this a_{i,j} entry, and we delete out from that, vertically and horizontally.0405
So, we will take some location, and then we will delete out horizontally, delete out vertically, and group back together and see what is left.0414
For example, if we have a below, we would have m_{2,3}; 2,3 means we are on the second row, and we are going to be on the third column.0421
We are looking at -8 as the epicenter of where this thing is.0431
That is the entry a_{i,j}; so the entry 2,3 would be -8.0436
Now, we delete (the determinant of the matrix obtained by deleting) the i^{th} row and j^{th} column.0440
We delete this second row; we delete this third column; and we see what the matrix is that is left.0446
Well, the matrix that is left is 6, 2, -7, 3; that is all that hasn't been crossed out.0453
Now, we go and we take the determinant of that; we are taking the determinant with these bars,0461
because the minor is that you delete, and then you take the determinant.0466
So then, we just take 6 times 3, minus -7 times 2; 18 + 14...we get 32, so that is our minor.0469
Cofactor is very closely based on the minor.0480
The cofactor just multiplies the minor by 1 or -1, based on the location of the entry the minor comes from.0484
So, there is this shifting, flipping-back-and-forth pattern of positive/negative that is really deeply connected to the determinants of matrices.0491
The cofactor c_{i,j}, the i^{th} row, j^{th} column cofactor, of the entry a_{i,j},0500
the entry in the i^{th} row, j^{th} column of our matrix A, is given by c_{i,j}0505
is equal to -1 to the i + j times that minor i,j.0511
So, the -1 to the i + j is just a way of saying if it is going to be positive or negative.0517
-1 to the 0 is positive; -1 to the 1 is negative; -1 to the 2 is positive; -1 to the 3 is negative; -1 to the 4 is positive.0521
-1 to the even number is positive; -1 to the odd number is negative.0529
So, we can see this as an alternating sine pattern.0533
If we are in -1, to the row 1 + column 1, then that is going to be -1 squared; -1 squared comes out to be positive 1.0535
There we are at row 1, column 1.0546
If we were to instead, say, look at row 2, column 3, then it would be -1 to the 2 + 3, which is equal to -1 to the 5.0549
So, since it is to an odd number, it is going to be negative; so we get that negative there.0561
We can see this in terms of the i + j thing; but we can also see it in terms of this alternating sign pattern.0566
I would recommend, any time you are working with cofactors, that you just draw up the alternating sign factor to whatever size you are doing.0572
For example, if you are working with a 3 x 3, just draw out a 3 x 3 alternating sign pattern.0578
It always starts with a positive in the top left: so + - +, - + -, + - +.0584
And then, from there, you will be able to work from it and use that as a reference point; we will see that in the examples.0593
Thus, based on our previous example, when we took what m_{2,3} was (m_{2,3} was equal to0598
the determinant of 6, 2, -7, 3, because c_{2,3} is still going to be based around row 2, column 3;0605
so -8...cross out...cross out...6, 2, -7, 3...the same thing here; and then we just take the determinant of that);0612
but we are here in the 2,3 position in our alternating sign pattern (or alternately, if we want to look at it0621
in terms of -1 to the i + j--either way would end up working out the same); so we have this negative here,0629
so we have a negative showing up here, so that will end up coming out to -32,0636
because we already figured out that the determinant for that minor is 6, 2, -7, 3; that is what we get out of that.0641
And so, that came out to be positive 32; so when we have this sign on top of that, that is going to come out to be -32.0648
All right, so how do we actually take the determinant?0656
Let's apply this stuff: the determinant of an m x n matrix A is given by the sum of the entries in any row or column0657
(you can choose any row or any column at all), and you multiply each one of those entries0665
by the respective cofactor that would come out of that entry.0670
So, the determinant of A, which is equal to another way to say the determinant of A,0674
is equal to...say we chose the k^{th} row; then we would have a_{k,1},0677
the first entry in the k^{th} row, times the cofactor of the k^{th} row, first entry,0681
plus a_{k,2}, the k^{th} row, second entry, times the cofactor for the k^{th} row, second entry,0687
up until the k^{th} row, n^{th} entry, and k^{th} row, n^{th} entry cofactor.0694
Similarly, we could have also done this with columns; it would be the first entry, k^{th} column of A,0701
times the cofactor for the first entry, k^{th} column; or the second entry, k^{th} column,0706
with the cofactor of second entry, k^{th} column, up until the n^{th} entry, k^{th} column,0711
n^{th} entry, k^{th} column cofactor.0715
So, that is how it works; don't worry--we will see an example that will make this make a lot more sense.0718
Note that this is true for any value of k, as long as 1 ≤ k ≤ n.0722
So, our k has to be somewhere in these m x n; we can't choose a row that is beyond the dimension,0728
or a column that is beyond the size, of our matrix; that doesn't make sense.0733
But as long as we choose a row that is inside of our matrix, and a column that is inside of our matrix, we can choose any one at all.0737
So, this process can be done with any row or any column, and you will end up getting the exact same result--kind of amazing.0742
We won't see why, but it is pretty cool.0748
This usually means that it is in our interest to choose the row or column that has the most zeroes,0750
because it is really easy: 0 times a cofactor--we don't have to worry about what the cofactor is.0755
It is just immediately going to eliminate itself.0761
So, the thing with the most zeroes, the row or column that has the most zeroes (or the smallest numbers,0763
if we don't have that many zeroes) will help make calculation easier; so that is something to stay on the lookout for.0768
All right, determinant of larger matrices: let's actually put "rubber to the road" and see how this works.0775
First, we notice that there is a 0 here; I like going horizontally, so let's work out this way.0782
Now, notice: a 3 x 3 sign pattern (put it inside of vertical lines, just so we are reminded that we are doing a determinant)0787
is going to look like this: so let's work on this horizontal line here.0802
The first entry in this row is 1; we then go out; we cross out the things on a line with that.0809
That would bring us to the entry 1, times the sign for that cofactor, so -1, times the minor, 2, 3, 3, 5.0819
Next, it is going to be a +; our next one in the row is going to be the 0.0836
We cut out...we don't even really have to care about the cutting out, because 0 times whatever0843
we end up having inside for that minor--that is going to get knocked out, so it doesn't really matter.0849
That is the beauty of choosing the 0.0853
Next, we have the -8; so -8 knocks out what is there; -8, and we are on this one, so - -8, times the minor0855
that is produced by cutting around that -8, cutting a vertical and a horizontal on that -8: 6, 2, -7, 3.0867
We work these out; we have -1 times...down diagonal, 2 times 5, minus up diagonal; 10 - 9 becomes -1.0876
Minus, plus...so that becomes + 8 times...6 times 3 becomes 18, minus...-7 times 2 is -14; that cancels out.0889
So, we have -1, negative and negative; that becomes positive 1...0904
Oh, sorry, that did not become negative back here: 2 times 5 is 10, minus 3 times 3 is 9, so we have 10 - 9 is 1; sorry about that.0911
So, that should have been a 1; here is a -1, so this comes out to be -1; it does not cancel out; I'm sorry about that.0921
Then, + 8 times...18 + 14 becomes 32, so -1 +...8 times 32 is 256; so we end up getting 255 as the determinant for this matrix.0928
Alternatively, we could have chosen a different row or a different column.0946
For example, we could have just gone along the top, like this, and we would have had 6 times...0949
and it would be positive, if we are going along the top there...so 6 times...we cross out around it; 0, -8, 3, 5.0955
And then, the next one is minus, -2, times...the minor around that 2 here would cross out to be 1, -8, -7, 5.0964
And then finally, + (because it is a plus in our signs) 3 times 1, 0, -7, 3.0976
You can work it out that way, as well, and you would end up getting 255, as well.0985
I like this row here, because we had that 0; and so, it just managed to knock itself out, right from the beginning.0989
That is that much less calculation for us to have to deal with; I think that is nice--less calculation makes it easier.0995
All right, there is an alternate method for finding the determinant of a 3 x 3 matrix that some people teach.1001
Personally, I want to recommend against using this method--I don't really think there is a good reason to use it.1008
The method we just did, that method with the cofactor expansion, while it seems a little complex at first1014
(it is a lot of things going on) will work for any size matrix at all.1019
And to be honest, this alternate method doesn't actually go any faster, I don't think.1023
So, I would say to try to stick to the cofactor method; I think it works better in general.1029
It gives you the ability to cancel out a whole bunch of zeroes, if you see a bunch of zeroes.1034
And you can use that same method for any size matrix and work down to smaller things.1038
That said, you might have to know it for class, or you might just really want to use it.1043
So, if you must know it, here it is.1046
The first thing you do: you begin by taking the first two columns of the matrix, and you repeat them on the right of the array.1049
So, we have 6, 2, 3, 1, 0, -8, -7, 3, 5; that shows up here, just like normal.1054
But then, we take the first two columns, and then we also repeat this on the right side.1062
So now, we have this extra-large array of numbers.1069
Once we have that array of numbers, we can work with it.1073
We multiply each red down diagonal--we multiply these together, and we add them up.1076
In this case, we would have 6 times 0 times 5; 2 times -8 times -7; and 3 times 1 times 3; that is what we get out of there.1082
And then, we subtract by each of the up diagonals, those blue ones, multiplied together; you subtract by those.1091
Minus (it is always going to be minus), and then -7 times 0 times 3, and then minus1098
(we are subtracting again) 3 times -8 times 6, and then minus 5 times 1 times 2.1105
You work that all out and do a bunch of calculation; you end up getting the exact same number, 255.1112
So, it is an alternate way to find the determinant; it will work if you have a 3 x 3 matrix.1116
It is not that bad; but I don't really think there is a whole lot of reason to use it.1121
It doesn't really go that much faster; you basically have to deal with the same amount of arithmetic.1125
And it is a very specific trick for something that you might have to do on a larger scale, and you can't use that trick anymore.1129
So, I would recommend using the method we were just talking about, with cofactors and minors.1135
But if you really want to use this one, here it is.1139
All right, we are ready to finally see the inverse of a 2 x 2 matrix.1142
So, if we have some 2 x 2 matrix, A = a, b, c, d; then the inverse of A, assuming that the determinant of A is not equal to 0,1145
(if the determinant of A is equal to 0, then we can't invert it at all), then A^{-1} = 1/ad - bc, times the matrix d, -b, -c, a.1152
So, notice: what we have done there is flipped the location of the diagonal here, and then we put negatives on the b and the c.1168
That is what we are getting here and here and here and here.1176
That is one way of looking at what is going on.1181
Equivalently, you could also write this as 1/detA, because the determinant of A is just ad - bc.1183
So, detA is the exact same thing; and then we are going to end up having the same matrix here and here.1190
That is another way to think about it and remember it; that might be a little bit easier.1195
All right, for the most part, at this level of this course or any similar math class,1199
you are probably not going to need to compute the inverse of a matrix that is any larger than a 2 x 2.1203
You are almost certainly not going to need to do that by hand.1208
But your teacher might want you to; you might just be curious about it.1211
So, if for some reason you need to calculate the inverse of a matrix that is larger than a 2 x 2 matrix,1214
and you have to do it by hand, we will go over a method for this after the examples.1219
We will talk about that after the examples; we will see something for doing that.1223
There is...notice, I said "by hand"; it turns out that if you have a graphing calculator (or access to the Internet),1227
you can actually just plug in matrices and have other computers invert them for you.1233
It is a very useful thing, because the arithmetic of it is very simple, but tedious, and there is a lot of arithmetic.1238
So, we will talk about that a little bit more in the next lesson.1244
Or we will talk about how there are calculators and matrices interacting together.1247
But that is something to think about, if you have to take the inverse of a matrix that is really large;1250
but you can not do it by hand--you are not required to show all of your work by hand--you might want to just use a calculator.1255
That is something to think about.1262
All right, how do you use inverse matrices?1264
If you have some A and A^{-1}, then we know that A^{-1} times A times B equals B.1266
A^{-1} and A cancel each other out, and they have no net effect.1272
This is because A^{-1} times A equals the identity matrix, which is equal to A times A^{-1}.1276
So, if you have the inverse to a matrix, you can multiply on the left side or the right side, and it will create the identity matrix.1281
It creates the identity matrix I, which as we noted in the previous lesson has no effect in multiplication.1287
A^{-1}A up here becomes I; and then I times B--well, the identity matrix times anything becomes just what we already had.1294
So, we get B; so that is why A^{-1} and A are cancelling out.1301
They turn into the identity matrix, and then that just doesn't do anything.1304
I want you to notice that we can multiply from the left side or the right side.1307
It doesn't matter; it will cancel out in either direction.1311
That is one of the nice things about inverses; they actually will commute, unlike pretty much everything else with matrices.1313
It is important to note that, if we multiply an equation by a matrix on both sides, we have to choose a direction to multiply from1319
and do the same for both parts of the equation.1326
So, if we multiply from the left, we have to multiply from the left on both sides.1329
If we multiply from the right, we have to multiply from the right on both sides.1333
This is because pq is not equal to qp, in general.1336
Multiplying on the left by p is generally very different than multiplying on the right by p.1340
So, if we are going to keep up equality, we have to do the same action; we have to multiply from the left on both sides,1344
because multiplying from different sides is actually a different action with matrices.1349
So, you have to make sure that you multiply from the same side if you want to keep the equality of the equations.1353
So, for example, if we have that A = B, then we can have CA = CB, where we multiply on the left for both sides.1358
Or we could have AC = BC, where we multiply on the right for both sides.1366
But usually, in general, CA is not going to be equal to BC, where we multiply on the left for one, and we multiply on the right for the other.1372
It is in general not going to end up being true; so you will have lost your equality.1380
So, make sure you notice that sort of thing; be careful here--it is dangerous.1384
It is really easy to make this mistake, because so often, when we think about multiplying numbers and equations,1390
like x = 10...we might multiply 3x = 10 times 3, but that is not how it can work in matrices.1395
The only reason we can get away with that in a normal equation is because they commute, so it doesn't matter which side we multiply from.1400
But with matrices, it matters which side we multiply from; so we can't have CA = BC; we have to make sure it is either CA = CB or AC = BC.1408
We have to make sure that we are multiplying both on the left or both on the right.1417
All right, we are ready for some examples.1421
What is the determinant of this 3 x 3 matrix? -2, 1, -3, 4, 2, 0, -1, 0, 1.1423
Our very first thing that we want to do is make a sign marker, just so we can see where all of the signs show up.1429
So, at this point, we need to choose some row or some column to work with.1440
We could choose the top one; that would be fine, but it doesn't have any 0's in it.1446
It has some numbers that are larger than that; so I like this one, because it has -1, 0, and 1.1449
So, one of them is going to cancel out, and the other ones have very little effect on the numbers.1454
Let's work with that: -1 will cancel out those; so we have -1 times 1, -3, 2, 0.1458
Then, the next one...it is still that, because that corresponds to that sign right there...1472
Next, we have minus, because it corresponds to that one, 0, times...and we could figure out what this is,1480
but it doesn't matter; because it is 0, it is going to knock itself out automatically.1490
0 times anything is going to come out as 0, so we don't even have to worry about computing it.1494
And then finally, the 1: that will knock out these, so we have a + here, + 1, times -2, 1, 4, 2.1498
We calculate this; we have -1 times...1 times 0 is 0; 2 times -3 is -6; but it is minus that;1512
so 1 times 0 is 0; minus 2 times -3, so it is a total of +6.1521
And then, plus...1 times...just figure out what this is...-2 times 2 is -4; minus 4 times 1, another -4; so we have a total of -8.1529
We work this out; we have -6 - 8; and we get -14.1540
There are many ways to have done this; we could have also chosen to do this based on this column here.1547
Really quickly, we would have had -3, since we are starting here.1551
We start at positive, but it starts at -3; so -3 times 4, 2, -1, 0,1557
minus...our next sign...0 times...we don't even have to care about it, because it will just knock itself out... plus 1 times -2, 1, 4, 2.1564
Or we could have gone from a different place entirely.1576
We could have also had this, and this would be equal; all of these ways will end up coming out to be the exact same thing.1579
That is one of the cool properties of the determinant.1583
-2 times 2, 0, 0, 1, minus 1 times 4, 0, -1, 1, plus -3 times 4, 2, -1, 0.1587
There are many different ways to do this: this here is the same as this here, is the same as this here.1606
They all end up being equal to -14; so the question of how we want to approach this--1614
which row, which column--we just choose whichever one seems easiest to us.1620
And even if we end up choosing the wrong one--we choose one that is slightly harder--1624
it doesn't matter, because they all come out to be the same thing.1627
We might have to do a few more extra arithmetic steps, but in the end, we will still get the same answer; so it is OK.1629
You don't have to really worry about that.1634
All right, what is this one? We have a 4 x 4, so at this point, we have to take the determinant of this.1636
The first thing we want to do is get a nice sign grid, so we can see all of our plusses and minuses.1641
+ - +...always a positive in the top left...- + - +, + - + -, - + - +; great.1646
So, at this point we want to figure out which is our best row or column to choose.1656
I see two zeroes on this column; so to me, that looks like it is going to make it easiest; I am going to go with that one.1660
I have the 2; it crosses out these; that corresponds to this +1 here, so I just have 2 times...1666
I cross out those other ones; I am left with -1, 3, 0, -4, 5, 4, 1, 1, 0.1676
OK, and then 0 here and the 0 here...we don't even have to worry about them,1684
because they are just going to multiply out to cancel out entirely.1689
So, we only get to having to worry about the 3; that leaves us here.1692
So, it is minus 3 times what gets crossed out: 3 times 2, -1, 3, 0, -4, 5, -3, 1, 1.1695
OK, at this point, let's figure out, of these new ones, which ones we want to use.1714
Let's make a new, smaller, 3 x 3 sign grid, so we can think in terms of that now.1719
OK, so this one...what seems easiest to me is this column...and I would say this row here.1726
We will work with those: we have 2 times whatever the determinant of that larger 3 x 3 is (this one right here);1732
we are working with the 0, so the 0 is going to just knock things out;1741
the only one that we really have to care about is this 4; it will be 4 times...1744
oh, wait, 4 here is there; so we have a -4; we always have to pay attention to that cofactor1750
bringing either a plus or a negative; that is why we make these sign grids here and here.1755
So, we have to pay attention to cofactors.1760
-4 times...that would cross out these things, so...-1, 3, 1, 1.1762
And then, over here, minus 3; so we chose this one, so we are going to have this row starting here: -3 times -0...1773
you don't have to worry about that one; plus...-4 times...it crosses out the other ones1782
that it is horizontal and vertical on...2, 3, -3, 1 is what is left there;1791
And then, minus 5...it crosses out, and we get 2, -1, -3, 1.1799
All right, we start working these out; since they are 2 x 2 matrices, we can just work them out now.1812
So, we have 2 times -4 times...-1 times 1 is -1, minus 1 times 3 is -4.1816
Then, minus 3 times -4 times 2 times 1 (is 2), minus -3 times 3; so 2 - -9 gets +11.1826
2 - 3(3)...we have -9...so -4 times 11, minus 5 times...2 times 1 is 2, minus 3(-1)...so 2 here, and then minus 3...1846
-3 times -1 becomes positive 3, but we are subtracting by that, so it is 2 minus 1...2 minus 3...so we get -1.1868
OK, so keep working that out: 2 times -4 times -4 is going to come out to be 2 times +16...1882
minus 3...-4 times 11 is -44; these cancel out, and we get + 5; 2 times 16 is 32, minus 3...-44 + 5 is -39.1893
These negatives cancel out; at this point we have this equal to 32 + 3(39) is going to be the same as 3(40) - 3, so + 117.1915
32 + 117 comes out to be 149; so the determinant of our matrix is equal to 149.1929
Great; so by carefully choosing which row we decide to work with, we can make this a whole lot easier.1942
By choosing that third row down, we were able to get a 0 to show here and a 0 to show here,1947
which allowed us to cancel out all of the things, so we only had to figure out two 3 x 3 determinants,1953
which is a lot easier than having to figure out four of them or more--anything like that.1957
So, by carefully choosing the row or column that you do your cofactor expansion on, you can make things a lot easier on yourself.1961
The third example: Prove that, for any 2 x 2 matrix A, where the detA is not equal to 0,1967
then A^{-1} = 1/(ad - bc) times the matrix d, -b, -c, a.1972
One thing that should be written here is that A is going to be equal to our standard form for just writing a general one, a, b, c, d.1977
So, how would we prove this? Well, we just prove it by showing that A times this supposed A^{-1}1985
does, indeed, come out to be the identity matrix, because that is what it means to be the inverse.1991
That is that something times its inverse comes out to be the identity matrix.1995
Some matrix times its inverse matrix comes out to be the identity matrix.1999
That is what it means to be an inverse for matrices.2002
So, let's just check that: let's say A^{-1} times A.2005
We don't know for sure that it actually is going to turn out to be the inverse, but let's try it.2011
We were told that the detA is not equal to 0; it is the determinant of A...2015
Well, remember: if this is our A right here, then the determinant of A is going to be equal to ad - bc.2019
This would be our only worry in creating this A^{-1}: 1/(ad - bc)--if it is dividing by 0, everything blows up.2026
But since we are told that the determinant of A (which is equal to ad - bc) is not equal to 0,2033
we know that we don't have to worry about dividing by 0, so we can move on.2037
A^{-1} times A: we have 1/(ad - bc), times the matrix d, -b, -c, a.2040
And then, times A is a, b, c, d...so first, we work through with matrix multiplication.2053
We have our 1/(ad - bc); we will scale later; right now, it will be easier to just work with just the variables, without that fraction getting in the way.2063
So, the first column: we know we will get out to a 2 x 2 matrix in the end; so first row times first column:2074
d times a...actually, let's expand this even more...minus b times c; great.2083
The next one: d times b, minus b times d.2093
The second row on the first column now: -c,a on a,c; -c on a gets us -ca; a on c gets us + ac.2102
The last one: -c,a on b,d gets us -cb + ad.2111
So, we see this; and we do a little bit of simplification, moving things around.2119
Well, db - bd...since b and d are just real numbers, they are commutative, so db - bd just cancel each other out.2124
-ca + ac: once again, they knock each other out.2134
We can rearrange things a little bit; so we have 1/(ad - bc) times the matrix.2137
Well, da - bc is the same thing as ad - bc; this is 0, and this is 0; and -cb + ad...well, we can write that as ad - bc.2142
So, 1/(ad - bc) times this...well, we will get 1, 0, 0, 1, which is exactly what we were looking for.2153
So, this is, indeed, equal to identity matrix; and if we were to do it the other way,2162
A times A^{-1}, to multiply our inverse from the right side, it would end up coming out the same; we would get the same answer.2166
And it turns out that, if you find a matrix that works on one side, you know that it has to work on the other side.2173
But that is a little bit of a deeper result that we haven't talked about explicitly.2178
But you could prove this just by hand, if you wanted to show AA^{-1}; but that is pretty good.2181
The final example: Given that B = -2, 3, 0, 4, and AB = -6, 29, 4, 22, find the matrix A.2186
How are we going to do this? We don't know what A is.2194
We know what AB is; we know what B is; well, notice that we can create a plan like this:2196
AB = AB--that is kind of obvious, but it is true.2201
So, if we came along, we could knock out that B with B^{-1}, so we could have AB = AB,2206
and then we would come along and hit it with B^{-1} on both sides.2216
And now, we could rewrite this as A =...well, we could cancel out to A on the right side,2221
but we could also see that it is just AB times B^{-1}.2227
We know AB; we know B; and so, if there is a B^{-1}, we can figure out what it is from our B.2235
So, our first step is to figure out what B^{-1} is.2243
And then, once we know what B^{-1} is, we just have AB times B^{-1}, and we will have our A.2246
So, that is our theoretical understanding; now it is time to just do the arithmetic.2252
If B = -2, 3, 0, 4, then B^{-1} equals 1 over the determinant, which is ad - bc,2256
so -2 times 4, minus 0 times 3; so that is -8; times...we flip the location of the main diagonal,2265
and then we put negatives on the other ones: -3 and -0 (we can write as just 0).2274
Simplify that just a little bit to -1/8 times 4, -3, 0, -2.2279
Great; so at this point, we know, from what we showed here, that A is equal to AB times B^{-1}.2287
Well, we know that AB is -6, 29, 4, 22; and B^{-1} is -1/8 times 4, -3, 0, -2.2299
So, I think it is easier to bring the fraction in afterwards; so let's pull the fraction to the front.2320
The fraction there is just a scalar, so it is just going to scale the matrix.2324
We can scale the matrix any time we want; let's just pull it out to the front, so we can have our matrices do their multiplication.2328
We have -6, 29, 4, 22; 4, -3, 0, -2; OK.2334
There is still that fraction up at the front: -1/8 times whatever comes out of this.2348
It will come out to be a 2 x 2; -6, 29 times 4, 0: -6 times 4 gets us -24; 29 times 0 is just 0.2354
-6, 29 on -3, -2; -6 times -3 gets us positive 18; 29 times -2 gets us -58; so that gets us a positive 40.2368
Oops, I'm sorry; it is not positive; 29 times -2 got us -58, so it is a -40; I'm sorry about that.2382
4, 22 on 4, 0: 4 times 4 gets us 16; and 22 times 0 is just 0.2388
4, 22 on -3, -2: 4 times -3 is -12; 22 times -2 is -44; -12 - 44 comes out to be -56.2396
So, at this point, we can use our -1/8; we simplify this out: we get -1/8 times -24 will become...24/8 is 3; the negatives cancel out, so we get +3.2407
-1/8 times -40 becomes positive 5; -1/8 times 16 becomes -2; -1/8 times -56 becomes positive 7.2419
We have A = 3, 5, -2, 7; and there we are.2429
We had to do a lot of arithmetic to get to this point, so let's double-check and make sure that that is the answer.2436
We know that A times B has to be this right here, because we were given AB, right from the beginning.2441
So, let's take a look: what would A times B be?2448
Well, we know what the A that we just figured out is: that is 3, 5, -2, 7;2450
and the B we started with, that we were given, is -2, 3, 0, 4.2456
So, we work this out; the 3, 5 on -2, 0 is going to get us a -6; 3, 5 on 3, 4 is going to get us 9 + 20, so 29.2463
-2, 7 on -2, 0 is going to get us -2 times -2...+4; and -2, 7 on 3, 4...-2 times 3 gets us -6; 7 times 4 gets us 28; add those together--you get 22.2477
And so, that is exactly the AB that we started with; so it checks out--our answer is good.2491
Great; all right, so that completes an understanding of determinants and inverses.2497
We have a great understanding of how that works right now.2500
We will see you at Educator.com later--goodbye!2503
However, if you want to check out the stuff for if we want to be able to do inverses for larger than 2 x 2,2505
larger than just that simple formula, let's take a look at it--let's look at that.2514
Finding the inverse of larger matrices: for the method we are about to discuss, we will need some techniques we haven't learned just yet.2519
In the first part of the next lesson, we discuss augmented matrices, row operations, and Gauss-Jordan elimination.2525
You will need to be familiar with these things before what we are about to talk about will totally make sense.2532
So, if you haven't already seen these things, go and check them out first, and then come back and watch this part.2537
It is just the first half of the next lesson--actually, probably more like the first third.2541
The method we are about to go over is applicable for finding the inverse of any m x n matrix.2546
If the matrix has no inverse, if it is singular, this method will end up failing.2550
It is normally easier to first check that there is going to be an inverse, before trying to put all of this work into it.2554
Just check to make sure that there is an inverse by getting the determinant,2559
because getting the determinant will actually take much less time that working through this method.2562
It is a good idea to check the determinant first to make sure that what you are doing will actually manage to work out.2566
All right, let's see how to do this: for an m x n matrix A, you begin by creating an augmented matrix with the identity matrix I_{n}.2571
So, if we have some A that is 1, 3, -2, -4, then we leave that part the same, and we drop in an identity matrix.2578
Since this is a 2 x 2, this ends up being a 2 x 2 identity matrix, right here.2586
We have 1, 3, 1, 0; -2, -4, 0, 1; we have it split in this middle, where the left side is A, and the right side is the identity matrix.2591
OK, the next step: you start applying the method of Gauss-Jordan elimination.2601
You use row operations to reduce A, that left side, to the identity matrix.2606
The result of the augmented matrix, once you manage to finally get this to be the identity matrix--2612
what you will have on the right side will be the inverse; you will have A^{-1} on the right side.2617
So, for example, if we have 1, 3, -2, -4, our first step is that we want to turn this into a 0.2622
We are doing Gauss-Jordan: so we take our row 2, and we add 2 times row 1; so 2 times 1 gets us +2;2629
that cancels to 0; 2 times 3 gets us +6 on -4; that goes to 2; 2 times 1 on 0 gets us 2;2636
2 times 0 on 1 is the same as it was before; so we have our new matrix here.2644
We continue with this method; we had 1, 3, 1, 0; 0, 2, 2, 1 on the previous slide.2648
So at this point, we want to turn this into a 1; so we multiply that entire row by 1/2.2653
This becomes 1; 2 times 1/2 becomes 1; 1 times 1/2 becomes 1/2.2659
At this point, we now want to get rid of this; we want to turn this into a 0 to continue with Gauss-Jordan elimination.2665
So, we subtract: we have a 1 here already, so we subtract 3 of row 2: so -3 times this:2670
1 times -3 on 3 gets us 0; and also, 0 times -3 gets us 1; we don't have any effect there.2678
Minus 3 here gets us -2; and -3 on 1/2 gets us -3/2.2686
So, at this point, we have an identity matrix here; this is just an identity matrix, because it is 1's on the main diagonal and 0's everywhere else.2692
So, what we have over here on the right side is our inverse matrix, A.2700
That is our inverse matrix A; we just bring it down and turn that into a matrix, and we have our answer.2706
Finally, you want to check your work; it is really easy to make a mistake in all of that arithmetic.2712
We were doing the simplest possible of 2 x 2; if you have to do this by hand, you are going to have to be at least doing 3 x 3 or larger.2716
So, it is really easy to end up making a mistake in all of that arithmetic.2722
So, make sure to do notations of what your row operations were, what we saw on the left there,2725
what we talk about in the next lesson when we explain this stuff.2729
And also, at the end, once you get to the very end, check your answer;2732
make sure that A^{-1} times A is equal to the identity matrix,2735
or A times A^{-1} is equal to the identity matrix.2738
So, for example, we started with A = this, and we figured out that A^{-1} should equal this.2741
So, we check our work: we multiply the two matrices together.2745
1, 3 times -2, 1: well, 1 times -2, plus 3 times 1...-2 + 3; that comes out to be 1.2750
1, 3 on -3, 2; that gets us -3, 2 + 3, 2, so that comes out to be 0; they cancel out.2758
Next, -2, -4 on -2, 1; -2 times -2 is 4, minus 4 times 2...4 - 4...that comes out to be 0.2766
And then, -2, -4 on -3, 2...3/2 times 1/2...so -2 times -3/2 gets us positive 6/2, minus 4/2; so we get 1 out of that.2775
Ultimately, it all checks out; we have figured out that this is, indeed, the inverse; it does end up working out just fine.2788
It is a really good idea to check your work at this point, because it is easy to make a mistake when you are doing that much arithmetic.2795
So, if you have to do this stuff by hand, always check your work at the end, because it is going to be a small amount of time2801
compared to the massive amount of time that you spend doing this.2805
And it would be a real shame if it ended up not being true.2807
All right, I hope that gives you a pretty good sense of how all this inverse and determinant stuff works.2810
And we will see you in the next lesson, when we finally get to see an application of just how powerful matrices are--2815
why we have been interested in them; it is because they allow us to do all sorts of really amazing things2820
that make things much easier than they would be from what we are used to so far--some pretty cool stuff.2825
All right, we will see you at Educator.com later--goodbye!2830
1 answer
Last reply by: Professor Selhorst-Jones
Thu Dec 4, 2014 5:25 PM
Post by Johnathon Kocher on December 3, 2014
Hello, I'm just dropping a comment to let you know the "Download Lecture Slides" and "Practice Questions" tabs are empty for this lecture.
1 answer
Last reply by: Professor Selhorst-Jones
Sun Mar 9, 2014 2:34 PM
Post by Christopher Hu on March 8, 2014
I tried the "alternative" method for a 4x4 matrix and it does not work. the "alternative" method only works for a 3x3, right?
1 answer
Last reply by: Professor Selhorst-Jones
Sat Aug 10, 2013 1:00 PM
Post by Ikze Cho on August 10, 2013
Does the "alternative method for 3x3 matrices" only apply for the 3x3 matrices or also for other matrices?