If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Determining invertible matrices

Sal shows why a matrix is invertible if and only if its determinant is not 0. Created by Sal Khan.

Want to join the conversation?

  • starky sapling style avatar for user Serene Beth Sam
    in 8.30 are you sure its f/y and not f/d?
    (20 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Apple Li
    I see why a matrix is not invertible when its determinant is 0. However I don't understand the proof Sal used in the 2nd half of the video. For example, why does it prove that there is no matrix inverse when the 2 lines are parallel?
    (13 votes)
    Default Khan Academy avatar avatar for user
    • leafers ultimate style avatar for user Wesley
      That's not correct. A solution is when two equations intersect at a point. If the lines were parallel and had different y-intercepts, the lines would never intersect and thus would have no solution.
      If the parallel lines had the same y-intercepts, they would be on top of each other, representing an infinite number of solutions, as Sal says in the video. There wouldn't be a unique solution.
      (8 votes)
  • aqualine ultimate style avatar for user MephK
    I didn't know where to put the question, but will there be videos about 'square matrix diagonalisation'?
    (sorry if the term isn't exact, i roughly translated it from the french term in my math lessons)
    (12 votes)
    Default Khan Academy avatar avatar for user
  • starky tree style avatar for user Sarah
    at how is it that you can compare the matrices
    [a] and [b]
    [c] ___ [d]
    to the fractions a/c=b/d ??? I thought matrices were used to notate vectors, not ratios....
    (3 votes)
    Default Khan Academy avatar avatar for user
  • piceratops tree style avatar for user VVCephei
    So does it mean that if you were to use a 2x2 singular matrix as a transformation matrix, it will transform 2d space in a such a way, that both basis vectors will be pointing in the same direction? So it will kind of reduce the number of dimensions down to 1?
    (5 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user endosteelinternals
    @~

    What if e and f both equal zero? even if the determinant is zero, there could still be a solution at {x,y}=={0,0}.

    Surely there's a name for that situation, though...
    (3 votes)
    Default Khan Academy avatar avatar for user
    • old spice man green style avatar for user t.rybner
      If e and f are both zero, there will be an infinite number of possible solutions.

      |A| = 0 means that ad = bc or a/c = b/d. Select n = c/a, which gives c = n*a, then you get these equation
          a/(n*a) = b/d
      reduce and rearrange
          d = n*b

      The resulting equations become
          a*x + b*y = 0
          c*x + d*y = n*a*x + n*d*y = 0

      Divide the second by n and you get these equations
          a*x + b*y = 0
          a*x + b*y = 0

      They are the same, so for any x you can choose y = -a/b * x and both equations will hold. This actually holds for any f = n*e too (e and f both equal to zero is just a special case of this general principle). If f ≠ n*e, then there will be no solutions.

      I hope this helps a bit.
      (6 votes)
  • aqualine ultimate style avatar for user Ain Ul Hayat
    I dont understand a thing about a 2x2 matrix.
    Well, suppose there's matrix [a,b c,d] so I understand that the first column would represent vector x and the second column would represent another y vector according to [x,y].
    So this means we can write each vector as [a,b]*x+[c,d]*y. Those each of the vectors x and y can be plotted on the axes but how can we plot this whole term? x*some matrix+y*some matrix.
    I hope you get my question.
    (1 vote)
    Default Khan Academy avatar avatar for user
    • leaf green style avatar for user kubleeka
      A matrix represents a transformation of the plane. If you have the matrix
      a b
      c d
      that means that when you apply the matrix, the vector <1, 0> gets sent to <a, c> and the vector <0, 1> gets sent to <b, d>.

      Then, once you know where those two vectors get sent, you can find out where any other vector <x, y> gets sent. It goes to x•<a,c>+y•<b, d>.
      (8 votes)
  • male robot hal style avatar for user GabrielZub
    At , isn't it supposed to be f/d instead of f/y?
    (4 votes)
    Default Khan Academy avatar avatar for user
  • leaf red style avatar for user Jeffrey Wan
    From onwards, is the point of the video that if there is a 0 determinant, than there is no unique solution?
    (4 votes)
    Default Khan Academy avatar avatar for user
  • aqualine ultimate style avatar for user PeterMDuitsland
    The slope intercept for cx + dy = f should be f/d not f/y
    (2 votes)
    Default Khan Academy avatar avatar for user

Video transcript

Perhaps even more interesting than finding the inverse of a matrix is trying to determine when an inverse of a matrix doesn't exist. Or when it's undefined. And a square matrix for which there is no inverse, of which an inverse is undefined is called a singular matrix. So let's think about what a singular matrix will look like, and how that applies to the different problems that we've address using matrices. So if I had the other 2 by 2, because that's just a simpler example. But it carries over into really any size square matrix. So let's take our 2 by 2 matrix. And the elements are a, b, c and d. What's the inverse of that matrix? This hopefully is a bit of second nature to you now. It's 1 over the determinant of a, times the adjoint of a. And in this case, you just switch these two terms. So you have a d and an a. And you make these two terms negative. So you have minus c and minus b. So my question to you is, what will make this entire expression undefined? Well it doesn't matter what numbers I have. If I have numbers here that make a defined, then I can obviously swap them or make them negative, and it won't change this part of the expression. But what would create a problem is if we attempted to divide by 0 here. If the determinant of the matrix A were undefined. So A inverse is undefined, if and only if-- and in math they sometimes write it if with two f's-- if and only if the determinant of A is equal to 0. So the other way to view that is, if a determinant of any matrix is equal to 0, then that matrix is a singular matrix, and it has no inverse, or the inverse is undefined. So let's think about in conceptual terms, at least the two problems that we've looked at, what a 0 determinant means, and see if we can get a little bit of intuition for why there is no inverse. So what is a 0 determinant? In this case, what's a determinant of this 2 by 2? Well the determinant of A is equal to what? It's equal to ad minus bc. So this matrix is singular, or it has no inverse, if this expression is equal to 0. So let me write that over here. So if ad is equal to bc-- or we can just manipulate things, and we could say if a/b is equal to c/d-- I just divided both sides by b, and divided both sides by d-- so if the ratio of a:b is the same as the ratio of c:d, then this will have no inverse. Or another way we could write this expression, if a/c-- if I divide both sides by c, and divide both sides by d-- is equal to b/d. So another way that this would be singular is if-- and it's actually the same way. If this is true, then this is true. These are the same. Just a little bit of algebraic manipulation. But if the ratio of a:c is equal to the ratio of b:d, and you can think about why that's the same thing. The ratio of a:b being the same thing as the ratio of c:d. But anyway, I don't want to confuse you. But let's think about how that translates into some of the problems that we looked at. So let's say that we wanted to look at the problem-- Let's say that we had this matrix representing the linear equation problem. Well, actually, this would be either one. So I have a, b, c, d times x, y Is equal to two other numbers that we haven't used yet, e and f. So if we have this matrix equation representing the linear equation problem, then the linear equation problem would be translated a times x plus b times y is equal to e. And c times x plus d times y is equal to f. And we would want to see where these two intersect. That would be the solution, the vector solution to this equation. And so, just to get a visual understanding of what these two lines look like, let's put it into the slope y-intercept form. So this would become what? In this case, y is equal to what? y is equal to minus a/b, x plus e/b. I'm just skipping some steps. But you subtract ax from both sides. And then divide both sides by b, and you get that. And then this equation, if you put it in the same form, just solve for y. You get y is equal to minus c/d x plus f/y. So let's think about this. I should probably change colors because it looks too-- Let's think about what these two equations would look like if this holds. And we said if this holds, then we have no determinant, and this becomes a singular matrix, and it has no inverse. And since it has no inverse, you can't solve this equation by multiplying both sides by the inverse, because the inverse doesn't exist. So let's think about this. If this is true, we have no determinant, but what does that mean intuitively in terms of these equations? Well if a/b is equal to c/d, these two lines will have the same slope. They'll have the same slope. So if these two expressions are different, then what do we know about them? If two lines that have the same slope and different y-intercepts, they're parallel to each other, and they will never, ever intersect. So let me draw that, just so you get the-- this top line-- They don't have to be positive numbers, but since this has a negative, I'll draw it as a negative slope. So that's the first line. And its y-intercept will be e/b. That's this line right here. And then the second line-- let me do it in another color-- I don't know if it's going to be above or below that line, but it's going to be parallel. It'll look something like this. And that line's y-intercept-- so that's this line-- that line's y intercept is going to be f/y. So if e/b and f/y are different terms, but both lines have the same equation, they're going to be parallel and they'll never intersect. So there actually would be no solution. If someone told you-- just the traditional way that you've done it, either through substitution, or through adding or subtracting the linear equations-- you wouldn't be able to find a solution where these two intersect, if a/b is equal to c/d. So one way to view the singular matrix is that you have parallel lines. Well then you might say, hey Sal, but these two lines would intersect if e/b equaled f/y. If this and this were the same, then these would actually be the identical lines. And not only would they intersect, they would intersect in an infinite number of places. But still you would have no unique solution. You'd have no one solution to this equation. It would be true at all values of x and y. So you can kind of view it when you apply the matrices to this problem. The matrix is singular, if the two lines that are being represented are either parallel, or they are the exact same line. They're parallel and not intersecting at all. Or they are the exact same line, and they intersect at an infinite number of points. And so it kind of makes sense that the A inverse wasn't defined. So let's think about this in the context of the linear combinations of vectors. That's not what I wanted to use to erase it. So when we think of this problem in terms of linear combination of factors, we can think of it like this. That this is the same thing as the vector ac times x plus the vector bd times y, is equal to the vector ef. So let's think about it a little bit. We're saying, is there some combination of the vector ac and the vector bd that equals the vector ef. But we just said that if we have no inverse here, we know that because the determinant is 0. And if the determinant is 0, then we know in this situation that a/c must equal b/d. So a/c is equal to b/d. So what does that tell us? Well let me draw it. And maybe numbers would be more helpful here. But I think you'll get the intuition. I'll just draw the first quadrant. I'll just assume both vectors are in the first quadrant. Let me draw. The vector ac. Let's say that this is a. Let me do it in a different color. So I'm gonna draw the vector ac. So if this is a, and this is c, then the vector ac looks like that. Let me draw it. I want to make this neat. The vector ac is like that. And then we have the arrow. And what would the vector bd look like? Well the vector bd-- And I could draw it arbitrarily someplace. But we're assuming that there's no derivative-- sorry, no determinant. Have I been saying derivative the whole time? I hope not. Well, we're assuming that there's no determinant to this matrix. So if there's no determinant, we know that a/c is equal to b/d. Or another way to view it is that c/d is equal to d/b. But what that tells you is that both of these vectors kind of have the same slope. So if they both start at point 0, they're going to go in the same direction. They might have a different magnitude, but they're going to go in the same direction. So if this is point b, and this is point d, vector bd is going to be here. And if that's not obvious to you, think a little bit about why these two vectors, if this is true, are going to point in the same direction. So that vector is going to essentially overlap. It's going to have the same direction as this vector, but it's just going to have a different magnitude. It might have the same magnitude. So my question to you is, vector ef, we don't know where vector ef is. Well let's pick some arbitrary point. Let's say that this is e, and this is f. So this is vector ef up there. Let me do it in a different color. Vector ef, let's say it's there. So my question to you is, if these two vectors are in the same direction. Maybe of different magnitude. Is there any way that you can add or subtract combinations of these two vectors to get to this vector? Well no, you can scale these vectors and add them. And all you're going to do is kind of move along this line. You can get to any other vector. There's a multiple of one of these vectors. But because these are the exact same direction, you can't get to any vector that's in a different direction. So if this vector is in a different direction, there's no solution here. If this vector just happened to be in the same direction as this, then there would be a solution, where you could just scale those. Actually, there would be an infinite number of solutions in terms of x and y. But if the vector is slightly different, in terms of its direction, then there is no solution. There is no combination of this vector and this vector that can add you up to this one. And it's something for you think about a little bit. It might be obvious to you. But another way to think about it is, when you're trying to take sums of vectors, any other vector, in order to move it in that direction, you have to have a little bit of one direction and a little bit of another direction, to get to any other vector. And if both of your ingredient vectors are the same direction, there's no way to get to a different one. Anyway, I'm probably just being circular in what I'm explaining. But that hopefully gives you a little bit of an intuition of well, one, you now know what a singular matrix is. You know when you can not find its inverse. You know that when the determinant is 0, you won't find an inverse. And hopefully-- and this was the whole point of this video-- you have an intuition of why that is. Because if you're looking at the vector problem, there's no way that you can find-- that either there's no solution to finding the combination of the vectors that get you to that vector, or there are an infinite number. And the same thing is true of finding the intersection of two lines. They're either parallel, or they're the same line, if the determinant is 0. Anyway, I will see you in the next video.