2.2 Product of Matrices — Transcript
Full transcript
- 0:00Okay, next we are going to talk about
- 0:02product of matrices and linear
- 0:04equations. [sighs] The product of of two
- 0:07matrices arises naturally from a system
- 0:10of linear equations. So let's consider
- 0:13this is system of linear equations.
- 0:16So it's a
- 0:18system of two equations with three
- 0:20unknowns. So if we look at the first
- 0:22equation, we have the unknown x1, x2 and
- 0:26x3.
- 0:28Those three unknowns are involved in the
- 0:30first equation and they have
- 0:32coefficients. The coefficient of x1 is
- 0:341, the coefficient of x2 is 3, the
- 0:36coefficient of x3 is 1 and all of this
- 0:39combination is equal to 1.
- 0:41And the same thing happens for the
- 0:44second equation. It's a combination of
- 0:46some coefficients with the variables and
- 0:49it happens that both of them are equal
- 0:51to 1.
- 0:53So this system can be represented in a
- 0:56matrix form in the following way.
- 0:59So I we take the equations and the left
- 1:02hand side of the equations, the
- 1:04coefficients will be recorded in the in
- 1:07a matrix. So the first row will
- 1:09represent the first equation.
- 1:12And the coefficients are 1, 3 and 1. So
- 1:161 stands for the coefficient of x1
- 1:18again, 3 stands for the coefficient of
- 1:20x2 and 1 stands for the coefficient of
- 1:22x3.
- 1:24The same thing, we record the
- 1:25coefficients of the second equations,
- 1:27which are 2, -1 and 1.
- 1:31And then we perform a product with x1,
- 1:34x2, x3 and this product is based on the
- 1:36dot product.
- 1:38So
- 1:39we take the first row and we dot it with
- 1:42x1, x2, x3. It's going to give me the
- 1:44left hand side of the equation.
- 1:47And the right hand side, this is equal
- 1:49to 1 1 as what we have.
- 1:53So the notation is as follows. If we're
- 1:55looking at this notation over here,
- 1:57the row 1 transpose, why we transposing
- 2:01row one? Because as we mentioned, all
- 2:03vectors are defined as column vectors.
- 2:07So if I want to take a row vector, I
- 2:09have to transpose it. So row one
- 2:12transpose stands for the coefficients of
- 2:16the first equation
- 2:18which is written in a vector, but this
- 2:21vector is transposed. So we usually
- 2:23write it as 1 3 1, but we have to
- 2:25transpose it.
- 2:27Transposing it will allow us to do the
- 2:29dot product. If you remember from the
- 2:32other module, this dot product is
- 2:34defined to be R1 transpose X, R2
- 2:37transpose X. This is A * X, which is
- 2:41equal to 1 1.
- 2:44So as we mentioned, we know that RI
- 2:46transpose X is RI * X, which is the dot
- 2:50product.
- 2:53So AX = to B or AX = to Y is a batch dot
- 2:58product of all the rows of A with X, as
- 3:02we have seen with only two
- 3:05linear equations.
- 3:08So AX can be also expressed as a linear
- 3:10combination of the columns of A with
- 3:13coefficient X1 all the way up to XN. In
- 3:17other words, we write them down X as X1
- 3:20A1 + X2 A2 all the way up to XN AN,
- 3:24where the AIs are the column vectors of
- 3:26A. We are going to see this idea all
- 3:30over over and over again. So this idea
- 3:33is going to be repeated over and over
- 3:35again.
- 3:36It's a very important idea.
- 3:38We will see it the first time here, but
- 3:40later on we are going to use it in
- 3:43modules 3 4 and 5.
- 3:46Now if we're looking at
- 3:49the example, so let's try to understand
- 3:51the idea from an example. As we
- 3:55mentioned, the system that we have was
- 3:57represented as a matrix A multiplied by
- 3:59a column vector X.
- 4:02Now if I'm going back and writing them
- 4:04down as two equations, so I'm doing the
- 4:08dot product between 1 3 1 with X1 X2 X3.
- 4:11This is going to give me the left hand
- 4:13side of my first equation
- 4:15and 2 -1 1 and X1 X2 X3 is going to give
- 4:18me the left hand side of the second
- 4:20equation. So we're looking at the first
- 4:23variable. The first variable is always
- 4:26multiplying
- 4:28the coefficients of the first column. So
- 4:321 and 2. So X1 multiplies the column,
- 4:36the first column of A.
- 4:38X2 multiplies the second column of A,
- 4:42which is 3 and -1. And X3 finally always
- 4:46multiplies the third column of A. So A
- 4:49multiplied by X can be written as X1
- 4:54multiplied by the first column plus X2
- 4:56times the second column plus X3 times
- 4:59the third column.
- 5:00So if I'm looking at the example AE1,
- 5:04just take a few minutes to look at AE1.
- 5:10What was A1 if we remember? A1 was 1 0
- 5:140. So A is 1 2 3 -1 1 1 and E1 was 1 0
- 5:230.
- 5:24So what is my X1 in this case?
- 5:27My X1 is 1.
- 5:30What is my X2?
- 5:32Is 0.
- 5:33How about the X3?
- 5:35Is also 0.
- 5:36So as we have seen in the following
- 5:39expansion,
- 5:41X1 always multiplies the first column.
- 5:46So I will have 1 multiplied by
- 5:501 2
- 5:52plus 0 times 3 -1. X2 multiplies the
- 5:56second column and finally 0 multiplied
- 6:00by 1 1. So these guys are just zeros and
- 6:04A multiplied by E1 is exactly the first
- 6:10column of A.
- 6:15Okay, so we are going into matrix matrix
- 6:18multiplication. What did we see before?
- 6:20We saw the matrix vector multiplication.
- 6:23So let's move on to expand the matrix
- 6:26vector multiplication into matrix matrix
- 6:28multiplication. In the previous module
- 6:31you saw the vector and vector
- 6:32multiplication which was the dot
- 6:34product.
- 6:35So the matrix multiplication is based on
- 6:38the dot product and we need to have some
- 6:41conditions before being able to perform
- 6:43the matrix multiplication. What is the
- 6:46what is this condition? So the condition
- 6:49would be that the number of columns of
- 6:53the left hand side matrix must be equal
- 6:56to the number of rows of the right hand
- 6:58side matrix. So for instance, if I have
- 7:01A multiplied by B, in this case we have
- 7:05A is a 2 x 3 matrix and we have B to be
- 7:09a 3 x 2 matrix.
- 7:11So the number of columns of the left
- 7:13hand side matrix is equal to the number
- 7:15of rows of the right hand side matrix
- 7:18and the product will be determined based
- 7:21on a dot product.
- 7:23So my A is a 2 x 3, my B is a 3 x 2. The
- 7:27answer would be a 2 x 2 matrix. The 2 x
- 7:312 matrix will have four entries
- 7:34and how are these four entries defined?
- 7:37So from the left hand side you take the
- 7:40rows of A and you dot them with the
- 7:44columns of B. Rows of A dot with the
- 7:47columns of B.
- 7:48So if we're looking at down at this
- 7:50example, so the first row of A is dotted
- 7:53with the first column of B. This is
- 7:56going to give me the first entry 1 1 of
- 7:59the product.
- 8:01Then if I'm looking at the entry 1 2 of
- 8:04the product, so I'm going to consider
- 8:06the first of A, the second column of B.
- 8:10And in this case, the first row of A is
- 8:12just U. The second column of B is T.
- 8:17Then I'm going to do a product with
- 8:20U dot with T or represented as U
- 8:23transpose multiplied by T.
- 8:26The same way for the entry
- 8:29two one, second row first column. I'll
- 8:33take the second row of A, first column
- 8:37of B which is the S and I do a dot
- 8:39product between them. But I can also
- 8:42represent it as V transpose S and
- 8:45finally the last row with the last
- 8:47column.
- 8:48So let's look at this small example.
- 8:51Compute two one minus one minus one zero
- 8:55one dotted multiplied by the matrix B.
- 8:59So what is the size? I'm just going to
- 9:02go ahead here. The size here is a two by
- 9:06three. So this is a two by three. How
- 9:08about the size here? It's a three by
- 9:11two. Then the three is common. I can
- 9:14just delete it and I'm going to get a
- 9:17two by two matrix. So I have a two by
- 9:20two matrix. If I'm looking at the first
- 9:22entry, I need to consider the first row
- 9:25of the left hand side and I'm doing a
- 9:27dot product of the column on the right
- 9:31hand side. So it's going to be a two
- 9:33times zero. It should be zero. Minus one
- 9:39plus zero. So I'm going to get a
- 9:41negative one.
- 9:43I'm moving on to this entry. I'm going
- 9:45to take the first row of the left hand
- 9:48side and then the second column of the
- 9:52right hand side matrix. So two minus one
- 9:55zero. I need to do the dot product with
- 9:58minus two zero negative one and let's
- 10:01see what the answer would be. Two times
- 10:03negative two is negative four plus zero
- 10:06plus zero that's a negative four.
- 10:09This one
- 10:10the second
- 10:12row dotted with the first column, 0 -1 +
- 10:161 is just zero. And finally, the last
- 10:19row dotted with the last column, I'm
- 10:22going to obtain -2 + 0 -1 is a -3.
- 10:31So some properties, as we mentioned, if
- 10:34A has size m x n,
- 10:37B has size n x l,
- 10:39so the the answer would have size m x l.
- 10:43So the n has to be common. The number of
- 10:46columns of A must be equal to the number
- 10:48of rows of B in order to perform a dot
- 10:52product.
- 10:53The product of matrices is not
- 10:55commutative.
- 10:56So A multiplies by B is never equal to B
- 10:58multiplied by A.
- 11:00And also,
- 11:01A multiplied by the identity matrix will
- 11:04give you A.
- 11:05So whether you I multiply on the left or
- 11:07the right hand side of A, you always
- 11:10going to get A.
- 11:13Invertible matrices, those are very
- 11:16particular matrices. We start with a
- 11:19square matrix, A.
- 11:21A is invertible, or we can say that it's
- 11:24non-singular if there exists a matrix B
- 11:27such that A multiplied by B is B
- 11:30multiplied by A is the identity.
- 11:33So this is kind of an extension of the
- 11:35real numbers, right? When you have a
- 11:37real number, for example, 2 is
- 11:40invertible. It should be non-zero.
- 11:43But in the matrices, we have more
- 11:45conditions that we will see later on.
- 11:48So
- 11:49the real number 2 is invertible if and
- 11:51only if there exists another real number
- 11:54such that 2 times this other real number
- 11:57is going to give me the number 1. And
- 11:59this other number is 1/2. So 2
- 12:02multiplied by 1/2 is equal to 1. So this
- 12:05is the same exactly the same idea. For
- 12:08matrices to be invertible, you need
- 12:10another matrix of the same size such
- 12:13that AB, which is equal to BA, is equal
- 12:16to the identity.
- 12:17And we denote by A inverse to be the
- 12:22inverse of A, which is the matrix B. So
- 12:25in other words, what we have, we have A
- 12:28A inverse is just the identity.
- 12:32So if A inverse exists, it undoes what A
- 12:36does. So whatever multiplication A is
- 12:39doing to a vector X, so A inverse will
- 12:43undo whatever A did to this vector. We
- 12:47are going to see that in the system of
- 12:49linear equations.
- 12:52The inverse of a 2 by 2 matrix, the nice
- 12:55part about 2 by 2 matrices, their
- 12:57inverse are beautiful. They have a nice
- 12:59formula.
- 13:00So if A is ABCD
- 13:03and if the determinant of A is AD - BC
- 13:07is different than 0, so the determinant
- 13:09is a relationship between the entries of
- 13:12the matrix, and this relationship is
- 13:14given by AD - BC. And if this is not 0,
- 13:19then A inverse exists.
- 13:21And A inverse would be 1 over this
- 13:25relationship, which is the determinant,
- 13:27AD - BC.
- 13:29We flip the entries on the diagonal, so
- 13:32A and D will be flipped, and we put a
- 13:34negative to all other entries. Just a
- 13:37quick example, or let me write down the
- 13:39example here. So suppose A is equal to 2
- 13:441 1 1.
- 13:46So is this an invertible matrix? It is
- 13:49an invertible matrix. The first thing
- 13:50that you need to compute is AD - BC.
- 13:55So AD - BC is equal to
- 14:022 multiplied by 1 - 1 multiplied by 1,
- 14:06which is equal to 2 - 1 is equal to 1.
- 14:10It's different than 0. Perfect.
- 14:12So AD - BC is just a number that is
- 14:16different than zero.
- 14:18Now, A inverse can be computed. So, what
- 14:21is A inverse? It's one over
- 14:24AD - BC, which is one.
- 14:27I need to flip the entries of the
- 14:29diagonal, so one and two, and put a
- 14:32minus sign to the other entries.
- 14:35And what does A inverse give us? That A
- 14:38* A inverse is the identity, which is
- 14:42also equal to A inverse A.
- 14:47All right. So, we are done with this
- 14:49module, and it's time for you guys to do
- 14:52some practice regarding matrix
- 14:55operations, matrix multiplications, and
- 14:58inverse.
About this transcript
This page contains the full transcript of 2.2 Product of Matrices by KAUST Academy, generated from the public captions YouTube serves with the video. The transcript has 2,190 words across 317 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.