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

Intro to identity matrix

Just as any number remains the same when multiplied by 1, any matrix remains the same when multiplied by the identity matrix. Learn more from Sal. Created by Sal Khan.

Want to join the conversation?

  • leaf orange style avatar for user Laurence Korn
    IxA=A. What about AxI?

    What are matrices used for?
    (33 votes)
    Default Khan Academy avatar avatar for user
    • starky ultimate style avatar for user Joy Liu
      Also A. And matrices are used for a lot of things. Like computer programming and stuff like that. You can also use it to represent equations. For example:
      3x+4y=2
      6x+2y=9
      Then you can represent it in matrix:
      [ 3 4 [ x [2
      6 2 ] * y ] = 9]
      And then solving it by time each side by its inverse.
      Then you will get something like:
      [x [a
      y] = b]
      Yay! So you will know x=a and y=b

      Another way you can use matrices is for formula for triangle's area. Which is pretty neat because you just put in the points of your triangle. Like (1,2), (3,0) , (4,5). Into the formula and you will get area. :VVV

      And computer programming is what you might be needing it the most since all the things listed above can be done in some other ways too. In computer programming, matrices is un avoidable.

      OK, I think I wrote too much unorganized facts. >.< But hey, it's really helpful. So learn it well, cause you will need it.
      (16 votes)
  • spunky sam blue style avatar for user Jonathan Holzmann
    Can you divide a matrix by a matrix? If so, and if it follows standard division, than Matrix I has to be equal to 1. Is this correct? at ?
    (27 votes)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user marioulrich
    I took AI and got A again. It seems that with an identity matrix, reversing the order in the operation produces the same matrix. Thus, AI = IA where I is the Identity matrix of A. I just want to make sure I did not make an error somewhere. I am trying to avoid an identity crisis :-) Thanks!
    (17 votes)
    Default Khan Academy avatar avatar for user
  • leafers tree style avatar for user Frida Escapil
    At , he mentions the dot product.. But what exactly is the dot product?
    (11 votes)
    Default Khan Academy avatar avatar for user
    • piceratops ultimate style avatar for user Daniel
      For ordered tuples of equal length(http://en.wikipedia.org/wiki/Tuple) the dot product is defined to be the product of the corresponding terms and then the sum of those products.
      Ex. For (2,1) and (3,5), their dot product is: (2)(3) + (1)(5) = 6 + 5 = 11.
      Ex. For (1,2,3) and (3,4,5), their dot product is: (1)(3) + (2)(4) + (3)(5) = 3 + 8 + 15 = 26

      The dot product is more useful when it comes to vectors (see Sal's videos), but it can apply to anything such as these tuples (or the groups Sal makes in this videos).

      Sal says "dot product" over and over because it is quicker than saying the definition I gave above.
      (8 votes)
  • aqualine ultimate style avatar for user Joshua Hong
    Do only square matrices ( same number of rows as columns) have identity matrices? He only used examples with a 3 by 3, 4 by 4, and, a 2 by 2
    (8 votes)
    Default Khan Academy avatar avatar for user
  • spunky sam blue style avatar for user adil.gulbahar
    Hi, I am studying for a Masters in Economics and in Econometrics we use some math where the lecturer mentioned 'idempotent matrices'. I know it's different to identity matrices but from what I have read about idempotent matrices, e.g. product of a matrix multiplied by itself is the matrix itself. In essence, PP or P^2 = P. However, I do not get the relation when he has used the construction of an error term in the classical linear regression model to get:

    Ehat = Y - Yhat = Y - XBetahat = Y - X (X'X) ^-1 (X')Y = Y - PY

    then Y - PY = (I-P) Y

    with I: identity matrix
    P' = X (X'X)^ -1 X' = P
    The apostrophe being 'prime' or transpose

    Questions:
    Why (X'X)' is X'X again?
    What P represents? (PY is called a projection matrix)
    What is a residual maker/annihilator matrix?

    I understand this is highly specialised, as in applied to a different concept however I am totally lost. I know I have to look at the ranks of a matrix before trying to understand this, I will do so. But if you could provide any insight that would be extremely helpful.

    Thank you :)
    (7 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Rodolfo Ochoa
    I fully understood the concept. However, what would be the use of an identity matrix? What's useful about a matrix that returns the same matrix it multiplies?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • male robot hal style avatar for user Yamanqui García Rosales
      The same use that the number 1 has in multiplication, if you stop to think about, you constantly use the fact that 1·a = a to solve all kind of math problems, but because it's such a basic concept you don't stop to wonder at it.

      In Linear Algebra the identity matrix serves the same function, and as such it's incredibly useful, from helping you solve systems of equations to finding the inverse of matrices.
      (5 votes)
  • aqualine ultimate style avatar for user joey mizrahi
    if multiplying by the identity matrix is the equivalent to multiplying a number by one then what is its use. when where and how do we use the identity matrix?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • leaf blue style avatar for user jwinder47
      The use of the identity matrix will become clear to you if you continue your study. It functions like any other identity element, like 1 for multiplication and 0 for addition. In that sense, multiplying a matrix by the real scalar 1 is not the same thing as multiplying by the identity matrix .
      (5 votes)
  • old spice man green style avatar for user Laura Gomez-Nichols
    do identity matrices only exist for square matrices?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • piceratops ultimate style avatar for user Josiah Pond
    What do these identity matrices do specificaly in real life?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • duskpin ultimate style avatar for user TotallyNotAFurryÒwÓ
      Identity matrices are useful in a variety of applications in mathematics, engineering, and computer science. Here are a few examples:

      In linear algebra, identity matrices are used to represent linear transformations that do not change the underlying vector space. They are often used as a starting point for solving linear systems of equations, and they are essential in defining the inverse of a matrix.

      In computer graphics, identity matrices are used to represent the default position and orientation of an object or camera. They can be combined with other matrices to create complex transformations such as translations, rotations, and scaling.

      In cryptography, identity matrices are used in the construction of encryption algorithms. For example, the Advanced Encryption Standard (AES) uses an identity matrix as part of its key schedule.

      In probability theory, identity matrices are used to represent the identity operator on a Hilbert space. This is important in quantum mechanics, where the identity operator plays a central role in defining observables and states.

      Overall, identity matrices are a fundamental mathematical concept that has many practical applications in various fields.
      (6 votes)

Video transcript

Voiceover:When you first learned multiplication many, many, many years ago, you got exposed to the idea that 1 times ... I shouldn't use that symbol ... 1 times some number is equal to that number again, and that makes intuitive sense. You're just literally saying one of this thing is just going to be that thing right over there. And you could view it as 1, when you're thinking about regular multiplication or scalar multiplication, it has this identity property. It has the identity property of multiplication. 1 times some number is equal to that some number again. Since we're now exploring matrices and matrix multiplication, the question arises is there some matrix that has the same property for matrix multiplication? To make that a little bit more concrete, is there some matrix I, and let me bold it as best as I can in my handwriting, is there some matrix I that if I were to multiply it times any other ... I think I over-bolded that one, but I'll just go with it. If I were to multiply it times any other matrix, A, that the resulting product is going to be matrix A again by the standard conventions of matrix multiplication. To make that a little bit concrete, let's just imagine. Let's just take an example for A. Let's say that our matrix A, let's go 3 by 3. Let's say it is 1, 2, 3, 4, 5, 6, 7, 8, 9. What I encourage you to is pause this video and try to think about whether you can construct some matrix I, and first think about even what the dimensions of matrix I have to be in order to, when you multiply the two this way, when you multiply I times A, you get A again. I'm assuming you've given a go at it, so let's think this through. Let's throw matrix A down there. Let's say copy and paste. Let's first think about what the dimensions are going to have to be. When I multiply my matrix I, when I multiply my matrix I times A right over here, I get A again. I'm multiplying something times a 3 by 3, 3 by 3 matrix, and I'm getting another 3 by 3 matrix. There's a few things that we know. First of all, in order for this matrix multiplication to even be defined, this matrix, the identity matrix, has to have the same number of columns as A has rows. We already see that A has 3 rows, so this character, the identity matrix, is going to have to have 3 columns. It's going to have to have 3 columns. We also know that the dimensions of the product, the rows of the product are defined by the rows of the first matrix, so this has to be also a 3 by 3, and of course, the columns of the product are defined by the columns of the second matrix. This is what defines this. These middle two have to match, and then the rows of the first matrix define the rows of the product, and then the columns of the second matrix define the columns of the product. We know this has to be a 3 by 3 matrix. Now what else do we know? We know what the product needs to be. It also needs to be 1, 2, 3, 4, 5, 6, 7, 8, 9. Let's think about it. To get this first entry right over here, we're going to have to multiply this row, this row times this column, since you take the dot product of it. I'm going to have to multiply something times 1 plus something else times 4 plus something else times 7 to get 1. Let's just think about it in the most, I guess we could say, naive possible way. What happens if we just multiply 1 times this 1 to get 1 and then 0 times 4 and add to it and then 0 times 7. I think that works out. When you take this product, this entry right over here is going to be 1 times 1, 1 times 1 plus 0 times 4, 0 times 4 plus 0 times 7, plus 0 times 7. That worked out quite well, but let's just make sure that that still holds. What happens when we multiply this row times this column or times this column to get this entry right over here? It works out. It's 1 times 2 plus 0 times 5 plus 0 times 8, so it makes sense. You get 2 again. Same thing when you do it for this 3rd column. 1 times 3 plus 0 times 6 plus 0 times 9 is going to be 3. Now what do we do in the second row? Let's think about it a little bit. The second row right over here is going to determine what values we get over here. For example, to get this entry right over there, we're going to multiply this row, we're going to multiply this row times this column, times this column. We want it to have the 4, so one way to think about it, we just want this middle entry here, so let's multiply 0 times 1 plus 1 times 4 plus 0 times 7, and then we're going to get 4. That works out for this next entry right over here. 0 times 2 plus 1 times 5 plus 0 times 8. We get 5. It will work out the same for this entry over there. Now, for this last entry, for this bottom row right over here of our product, to do that, we're going to have to multiply this row times these columns, or take, I guess you could say, the dot product. To get the 7, we want to multiply this row times this column, or take the dot product of this row and that column. If we want the 7, let's multiply 0 times a 1 plus 0 times a 4 plus a 1 times the 7. Just like that, you'll see that that works. That gives us a 7 for this entry. It gives us, when you take the dot of this and that, it gives you an 8 for this entry. You take the dot product of that and that. It gives you the 9, the 9 for that entry. Just like that, we have constructed a 3 by 3 identity matrix. The 3 by 3 identity matrix is equal to 1, 0, 0, 0, 1, 0, and 0, 0, 1. As you will see, whenever you construct an identity matrix, if you're constructing a 2 by 2 identity matrix, so I can say identity matrix 2 by 2, it's going to have a very similar pattern. It's going to be 1, 0, 0, 1. If you have a 4 by 4 identity matrix, it is going to be, you could guess it, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1. You essentially just have 1s down the diagonal going from the top left to the bottom right. What's neat about identity matrices, you multiply it times any matrix, and you're going to get that matrix again. Now another thing I encourage you to do is we've just shown that I times A is equal to A, but I'll let you do this after this video, what about A times I? We've seen that matrix multiplication, the order matters, so what happens here? If you take A times I, do you still get A?