YouTube2Text

2.2 Product of Matrices — Transcript

by KAUST Academy · 2,190 words · 317 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Okay, next we are going to talk about
  2. 0:02product of matrices and linear
  3. 0:04equations. [sighs] The product of of two
  4. 0:07matrices arises naturally from a system
  5. 0:10of linear equations. So let's consider
  6. 0:13this is system of linear equations.
  7. 0:16So it's a
  8. 0:18system of two equations with three
  9. 0:20unknowns. So if we look at the first
  10. 0:22equation, we have the unknown x1, x2 and
  11. 0:26x3.
  12. 0:28Those three unknowns are involved in the
  13. 0:30first equation and they have
  14. 0:32coefficients. The coefficient of x1 is
  15. 0:341, the coefficient of x2 is 3, the
  16. 0:36coefficient of x3 is 1 and all of this
  17. 0:39combination is equal to 1.
  18. 0:41And the same thing happens for the
  19. 0:44second equation. It's a combination of
  20. 0:46some coefficients with the variables and
  21. 0:49it happens that both of them are equal
  22. 0:51to 1.
  23. 0:53So this system can be represented in a
  24. 0:56matrix form in the following way.
  25. 0:59So I we take the equations and the left
  26. 1:02hand side of the equations, the
  27. 1:04coefficients will be recorded in the in
  28. 1:07a matrix. So the first row will
  29. 1:09represent the first equation.
  30. 1:12And the coefficients are 1, 3 and 1. So
  31. 1:161 stands for the coefficient of x1
  32. 1:18again, 3 stands for the coefficient of
  33. 1:20x2 and 1 stands for the coefficient of
  34. 1:22x3.
  35. 1:24The same thing, we record the
  36. 1:25coefficients of the second equations,
  37. 1:27which are 2, -1 and 1.
  38. 1:31And then we perform a product with x1,
  39. 1:34x2, x3 and this product is based on the
  40. 1:36dot product.
  41. 1:38So
  42. 1:39we take the first row and we dot it with
  43. 1:42x1, x2, x3. It's going to give me the
  44. 1:44left hand side of the equation.
  45. 1:47And the right hand side, this is equal
  46. 1:49to 1 1 as what we have.
  47. 1:53So the notation is as follows. If we're
  48. 1:55looking at this notation over here,
  49. 1:57the row 1 transpose, why we transposing
  50. 2:01row one? Because as we mentioned, all
  51. 2:03vectors are defined as column vectors.
  52. 2:07So if I want to take a row vector, I
  53. 2:09have to transpose it. So row one
  54. 2:12transpose stands for the coefficients of
  55. 2:16the first equation
  56. 2:18which is written in a vector, but this
  57. 2:21vector is transposed. So we usually
  58. 2:23write it as 1 3 1, but we have to
  59. 2:25transpose it.
  60. 2:27Transposing it will allow us to do the
  61. 2:29dot product. If you remember from the
  62. 2:32other module, this dot product is
  63. 2:34defined to be R1 transpose X, R2
  64. 2:37transpose X. This is A * X, which is
  65. 2:41equal to 1 1.
  66. 2:44So as we mentioned, we know that RI
  67. 2:46transpose X is RI * X, which is the dot
  68. 2:50product.
  69. 2:53So AX = to B or AX = to Y is a batch dot
  70. 2:58product of all the rows of A with X, as
  71. 3:02we have seen with only two
  72. 3:05linear equations.
  73. 3:08So AX can be also expressed as a linear
  74. 3:10combination of the columns of A with
  75. 3:13coefficient X1 all the way up to XN. In
  76. 3:17other words, we write them down X as X1
  77. 3:20A1 + X2 A2 all the way up to XN AN,
  78. 3:24where the AIs are the column vectors of
  79. 3:26A. We are going to see this idea all
  80. 3:30over over and over again. So this idea
  81. 3:33is going to be repeated over and over
  82. 3:35again.
  83. 3:36It's a very important idea.
  84. 3:38We will see it the first time here, but
  85. 3:40later on we are going to use it in
  86. 3:43modules 3 4 and 5.
  87. 3:46Now if we're looking at
  88. 3:49the example, so let's try to understand
  89. 3:51the idea from an example. As we
  90. 3:55mentioned, the system that we have was
  91. 3:57represented as a matrix A multiplied by
  92. 3:59a column vector X.
  93. 4:02Now if I'm going back and writing them
  94. 4:04down as two equations, so I'm doing the
  95. 4:08dot product between 1 3 1 with X1 X2 X3.
  96. 4:11This is going to give me the left hand
  97. 4:13side of my first equation
  98. 4:15and 2 -1 1 and X1 X2 X3 is going to give
  99. 4:18me the left hand side of the second
  100. 4:20equation. So we're looking at the first
  101. 4:23variable. The first variable is always
  102. 4:26multiplying
  103. 4:28the coefficients of the first column. So
  104. 4:321 and 2. So X1 multiplies the column,
  105. 4:36the first column of A.
  106. 4:38X2 multiplies the second column of A,
  107. 4:42which is 3 and -1. And X3 finally always
  108. 4:46multiplies the third column of A. So A
  109. 4:49multiplied by X can be written as X1
  110. 4:54multiplied by the first column plus X2
  111. 4:56times the second column plus X3 times
  112. 4:59the third column.
  113. 5:00So if I'm looking at the example AE1,
  114. 5:04just take a few minutes to look at AE1.
  115. 5:10What was A1 if we remember? A1 was 1 0
  116. 5:140. So A is 1 2 3 -1 1 1 and E1 was 1 0
  117. 5:230.
  118. 5:24So what is my X1 in this case?
  119. 5:27My X1 is 1.
  120. 5:30What is my X2?
  121. 5:32Is 0.
  122. 5:33How about the X3?
  123. 5:35Is also 0.
  124. 5:36So as we have seen in the following
  125. 5:39expansion,
  126. 5:41X1 always multiplies the first column.
  127. 5:46So I will have 1 multiplied by
  128. 5:501 2
  129. 5:52plus 0 times 3 -1. X2 multiplies the
  130. 5:56second column and finally 0 multiplied
  131. 6:00by 1 1. So these guys are just zeros and
  132. 6:04A multiplied by E1 is exactly the first
  133. 6:10column of A.
  134. 6:15Okay, so we are going into matrix matrix
  135. 6:18multiplication. What did we see before?
  136. 6:20We saw the matrix vector multiplication.
  137. 6:23So let's move on to expand the matrix
  138. 6:26vector multiplication into matrix matrix
  139. 6:28multiplication. In the previous module
  140. 6:31you saw the vector and vector
  141. 6:32multiplication which was the dot
  142. 6:34product.
  143. 6:35So the matrix multiplication is based on
  144. 6:38the dot product and we need to have some
  145. 6:41conditions before being able to perform
  146. 6:43the matrix multiplication. What is the
  147. 6:46what is this condition? So the condition
  148. 6:49would be that the number of columns of
  149. 6:53the left hand side matrix must be equal
  150. 6:56to the number of rows of the right hand
  151. 6:58side matrix. So for instance, if I have
  152. 7:01A multiplied by B, in this case we have
  153. 7:05A is a 2 x 3 matrix and we have B to be
  154. 7:09a 3 x 2 matrix.
  155. 7:11So the number of columns of the left
  156. 7:13hand side matrix is equal to the number
  157. 7:15of rows of the right hand side matrix
  158. 7:18and the product will be determined based
  159. 7:21on a dot product.
  160. 7:23So my A is a 2 x 3, my B is a 3 x 2. The
  161. 7:27answer would be a 2 x 2 matrix. The 2 x
  162. 7:312 matrix will have four entries
  163. 7:34and how are these four entries defined?
  164. 7:37So from the left hand side you take the
  165. 7:40rows of A and you dot them with the
  166. 7:44columns of B. Rows of A dot with the
  167. 7:47columns of B.
  168. 7:48So if we're looking at down at this
  169. 7:50example, so the first row of A is dotted
  170. 7:53with the first column of B. This is
  171. 7:56going to give me the first entry 1 1 of
  172. 7:59the product.
  173. 8:01Then if I'm looking at the entry 1 2 of
  174. 8:04the product, so I'm going to consider
  175. 8:06the first of A, the second column of B.
  176. 8:10And in this case, the first row of A is
  177. 8:12just U. The second column of B is T.
  178. 8:17Then I'm going to do a product with
  179. 8:20U dot with T or represented as U
  180. 8:23transpose multiplied by T.
  181. 8:26The same way for the entry
  182. 8:29two one, second row first column. I'll
  183. 8:33take the second row of A, first column
  184. 8:37of B which is the S and I do a dot
  185. 8:39product between them. But I can also
  186. 8:42represent it as V transpose S and
  187. 8:45finally the last row with the last
  188. 8:47column.
  189. 8:48So let's look at this small example.
  190. 8:51Compute two one minus one minus one zero
  191. 8:55one dotted multiplied by the matrix B.
  192. 8:59So what is the size? I'm just going to
  193. 9:02go ahead here. The size here is a two by
  194. 9:06three. So this is a two by three. How
  195. 9:08about the size here? It's a three by
  196. 9:11two. Then the three is common. I can
  197. 9:14just delete it and I'm going to get a
  198. 9:17two by two matrix. So I have a two by
  199. 9:20two matrix. If I'm looking at the first
  200. 9:22entry, I need to consider the first row
  201. 9:25of the left hand side and I'm doing a
  202. 9:27dot product of the column on the right
  203. 9:31hand side. So it's going to be a two
  204. 9:33times zero. It should be zero. Minus one
  205. 9:39plus zero. So I'm going to get a
  206. 9:41negative one.
  207. 9:43I'm moving on to this entry. I'm going
  208. 9:45to take the first row of the left hand
  209. 9:48side and then the second column of the
  210. 9:52right hand side matrix. So two minus one
  211. 9:55zero. I need to do the dot product with
  212. 9:58minus two zero negative one and let's
  213. 10:01see what the answer would be. Two times
  214. 10:03negative two is negative four plus zero
  215. 10:06plus zero that's a negative four.
  216. 10:09This one
  217. 10:10the second
  218. 10:12row dotted with the first column, 0 -1 +
  219. 10:161 is just zero. And finally, the last
  220. 10:19row dotted with the last column, I'm
  221. 10:22going to obtain -2 + 0 -1 is a -3.
  222. 10:31So some properties, as we mentioned, if
  223. 10:34A has size m x n,
  224. 10:37B has size n x l,
  225. 10:39so the the answer would have size m x l.
  226. 10:43So the n has to be common. The number of
  227. 10:46columns of A must be equal to the number
  228. 10:48of rows of B in order to perform a dot
  229. 10:52product.
  230. 10:53The product of matrices is not
  231. 10:55commutative.
  232. 10:56So A multiplies by B is never equal to B
  233. 10:58multiplied by A.
  234. 11:00And also,
  235. 11:01A multiplied by the identity matrix will
  236. 11:04give you A.
  237. 11:05So whether you I multiply on the left or
  238. 11:07the right hand side of A, you always
  239. 11:10going to get A.
  240. 11:13Invertible matrices, those are very
  241. 11:16particular matrices. We start with a
  242. 11:19square matrix, A.
  243. 11:21A is invertible, or we can say that it's
  244. 11:24non-singular if there exists a matrix B
  245. 11:27such that A multiplied by B is B
  246. 11:30multiplied by A is the identity.
  247. 11:33So this is kind of an extension of the
  248. 11:35real numbers, right? When you have a
  249. 11:37real number, for example, 2 is
  250. 11:40invertible. It should be non-zero.
  251. 11:43But in the matrices, we have more
  252. 11:45conditions that we will see later on.
  253. 11:48So
  254. 11:49the real number 2 is invertible if and
  255. 11:51only if there exists another real number
  256. 11:54such that 2 times this other real number
  257. 11:57is going to give me the number 1. And
  258. 11:59this other number is 1/2. So 2
  259. 12:02multiplied by 1/2 is equal to 1. So this
  260. 12:05is the same exactly the same idea. For
  261. 12:08matrices to be invertible, you need
  262. 12:10another matrix of the same size such
  263. 12:13that AB, which is equal to BA, is equal
  264. 12:16to the identity.
  265. 12:17And we denote by A inverse to be the
  266. 12:22inverse of A, which is the matrix B. So
  267. 12:25in other words, what we have, we have A
  268. 12:28A inverse is just the identity.
  269. 12:32So if A inverse exists, it undoes what A
  270. 12:36does. So whatever multiplication A is
  271. 12:39doing to a vector X, so A inverse will
  272. 12:43undo whatever A did to this vector. We
  273. 12:47are going to see that in the system of
  274. 12:49linear equations.
  275. 12:52The inverse of a 2 by 2 matrix, the nice
  276. 12:55part about 2 by 2 matrices, their
  277. 12:57inverse are beautiful. They have a nice
  278. 12:59formula.
  279. 13:00So if A is ABCD
  280. 13:03and if the determinant of A is AD - BC
  281. 13:07is different than 0, so the determinant
  282. 13:09is a relationship between the entries of
  283. 13:12the matrix, and this relationship is
  284. 13:14given by AD - BC. And if this is not 0,
  285. 13:19then A inverse exists.
  286. 13:21And A inverse would be 1 over this
  287. 13:25relationship, which is the determinant,
  288. 13:27AD - BC.
  289. 13:29We flip the entries on the diagonal, so
  290. 13:32A and D will be flipped, and we put a
  291. 13:34negative to all other entries. Just a
  292. 13:37quick example, or let me write down the
  293. 13:39example here. So suppose A is equal to 2
  294. 13:441 1 1.
  295. 13:46So is this an invertible matrix? It is
  296. 13:49an invertible matrix. The first thing
  297. 13:50that you need to compute is AD - BC.
  298. 13:55So AD - BC is equal to
  299. 14:022 multiplied by 1 - 1 multiplied by 1,
  300. 14:06which is equal to 2 - 1 is equal to 1.
  301. 14:10It's different than 0. Perfect.
  302. 14:12So AD - BC is just a number that is
  303. 14:16different than zero.
  304. 14:18Now, A inverse can be computed. So, what
  305. 14:21is A inverse? It's one over
  306. 14:24AD - BC, which is one.
  307. 14:27I need to flip the entries of the
  308. 14:29diagonal, so one and two, and put a
  309. 14:32minus sign to the other entries.
  310. 14:35And what does A inverse give us? That A
  311. 14:38* A inverse is the identity, which is
  312. 14:42also equal to A inverse A.
  313. 14:47All right. So, we are done with this
  314. 14:49module, and it's time for you guys to do
  315. 14:52some practice regarding matrix
  316. 14:55operations, matrix multiplications, and
  317. 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.