1 00:00:00,170 --> 00:00:01,070 - [Instructor] In a previous video, 2 00:00:01,070 --> 00:00:02,240 we saw that if you have a system 3 00:00:02,240 --> 00:00:04,900 of three equations with three unknowns like this, 4 00:00:04,900 --> 00:00:08,360 you can represent it as a matrix vector equation, 5 00:00:08,360 --> 00:00:10,520 where this matrix right over here 6 00:00:10,520 --> 00:00:13,740 is a three-by-three matrix. 7 00:00:13,740 --> 00:00:16,180 That is essentially a coefficient matrix. 8 00:00:16,180 --> 00:00:18,300 It has all of the coefficients of the Xs, 9 00:00:18,300 --> 00:00:21,350 the Ys, and the Zs as its various columns. 10 00:00:21,350 --> 00:00:24,660 and then you're going to multiply that times this vector, 11 00:00:24,660 --> 00:00:27,070 which is really the vector of the unknown variables, 12 00:00:27,070 --> 00:00:29,570 and this is a three-by-one vector. 13 00:00:29,570 --> 00:00:30,830 And then you would result 14 00:00:30,830 --> 00:00:35,450 in this other three-by-one vector, which is a vector 15 00:00:35,450 --> 00:00:40,050 that contains these constant terms right over here. 16 00:00:40,050 --> 00:00:42,160 What we're gonna do in this video is recognize 17 00:00:42,160 --> 00:00:44,570 that you can generalize this phenomenon. 18 00:00:44,570 --> 00:00:46,340 It's not just true with a system 19 00:00:46,340 --> 00:00:48,580 of three equations with three unknowns. 20 00:00:48,580 --> 00:00:52,490 It actually generalizes to N equations with N unknowns. 21 00:00:52,490 --> 00:00:55,600 But just to appreciate that that is indeed the case, 22 00:00:55,600 --> 00:00:59,610 let us look at a system of two equations with two unknowns. 23 00:00:59,610 --> 00:01:04,020 So let's say you had 2x plus y is equal to nine, 24 00:01:04,020 --> 00:01:09,020 and we had 3x minus y is equal to five. 25 00:01:09,230 --> 00:01:10,630 I encourage you, pause this video 26 00:01:10,630 --> 00:01:12,610 and think about how that would be represented 27 00:01:12,610 --> 00:01:15,253 as a matrix vector equation. 28 00:01:16,520 --> 00:01:19,520 All right, now let's work on this together. 29 00:01:19,520 --> 00:01:23,710 So this is a system of two equations with two unknowns. 30 00:01:23,710 --> 00:01:27,010 So the matrix that represents the coefficients is going 31 00:01:27,010 --> 00:01:29,390 to be a two-by-two matrix 32 00:01:29,390 --> 00:01:31,680 and then that's going to be multiplied 33 00:01:31,680 --> 00:01:35,200 by a vector that represents the unknown variables. 34 00:01:35,200 --> 00:01:37,090 We have two unknown variables over here. 35 00:01:37,090 --> 00:01:40,120 So this is going to be a two-by-one vector, 36 00:01:40,120 --> 00:01:42,910 and then that's going to be equal to a vector 37 00:01:42,910 --> 00:01:45,520 that represents the constants on the right-hand side, 38 00:01:45,520 --> 00:01:46,810 and obviously we have two of those. 39 00:01:46,810 --> 00:01:49,430 So that's going to be a two-by-one vector as well. 40 00:01:49,430 --> 00:01:51,870 And then we can do exactly what we did 41 00:01:51,870 --> 00:01:54,410 in that previous example in a previous video. 42 00:01:54,410 --> 00:01:58,850 The coefficients on the X terms, two and three, 43 00:01:58,850 --> 00:02:02,570 and then we have the coefficients on the Y terms. 44 00:02:02,570 --> 00:02:04,530 This would be a positive one 45 00:02:04,530 --> 00:02:06,930 and then this would be a negative one. 46 00:02:06,930 --> 00:02:09,570 And then we multiply it times the vector 47 00:02:09,570 --> 00:02:12,490 of the variables, X, Y, 48 00:02:12,490 --> 00:02:14,700 and then last but not least, 49 00:02:14,700 --> 00:02:19,200 you have this nine and this five over here, nine and five. 50 00:02:19,200 --> 00:02:22,040 And I encourage you and multiply this out. 51 00:02:22,040 --> 00:02:25,390 Multiply this matrix times this vector. 52 00:02:25,390 --> 00:02:28,560 And when you do that and you still set up this equality, 53 00:02:28,560 --> 00:02:30,620 you're going to see that it essentially turns 54 00:02:30,620 --> 00:02:32,770 into this exact same system 55 00:02:32,770 --> 00:02:36,010 of two equations and two unknowns. 56 00:02:36,010 --> 00:02:37,650 Now, what's interesting about this is 57 00:02:37,650 --> 00:02:40,730 that we see a generalizable form. 58 00:02:40,730 --> 00:02:43,860 In general, you can represent a system 59 00:02:43,860 --> 00:02:47,890 of N equations and N unknowns in the form. 60 00:02:47,890 --> 00:02:51,740 Sum N-by-N matrix A, 61 00:02:51,740 --> 00:02:53,400 N by N, 62 00:02:53,400 --> 00:02:58,340 times sum N-by-one vector X. 63 00:02:58,340 --> 00:02:59,523 This isn't just the variable X. 64 00:02:59,523 --> 00:03:03,950 This is a vector X that has N dimensions to it. 65 00:03:03,950 --> 00:03:08,610 So times sum N-by-one vector X is going 66 00:03:08,610 --> 00:03:13,530 to be equal to sum N-by-one vector B. 67 00:03:14,480 --> 00:03:17,360 These are the letters that people use by convention. 68 00:03:17,360 --> 00:03:19,030 This is going to be N by one. 69 00:03:19,030 --> 00:03:21,890 And so you can see in these different scenarios. 70 00:03:21,890 --> 00:03:24,850 In that first one, this is a three-by-three matrix. 71 00:03:24,850 --> 00:03:26,870 We could call that A, 72 00:03:26,870 --> 00:03:29,580 and then we could call this the vector X, 73 00:03:29,580 --> 00:03:31,760 and then we could call this the vector B. 74 00:03:31,760 --> 00:03:32,850 Now in that second scenario, 75 00:03:32,850 --> 00:03:34,800 we could call this the matrix A, 76 00:03:34,800 --> 00:03:36,850 we could call this the vector X, 77 00:03:36,850 --> 00:03:39,320 and then we could call this the vector B, 78 00:03:39,320 --> 00:03:42,820 but we can generalize that to N dimensions. 79 00:03:42,820 --> 00:03:44,760 And as I talked about in the previous video, 80 00:03:44,760 --> 00:03:47,880 what's interesting about this is you could think about, 81 00:03:47,880 --> 00:03:49,890 for example, in this system of two equations 82 00:03:49,890 --> 00:03:52,300 with two unknowns, as all right, I have a line here, 83 00:03:52,300 --> 00:03:53,490 I have a line here, 84 00:03:53,490 --> 00:03:57,640 and X and Y represent the intersection of those lines. 85 00:03:57,640 --> 00:03:58,850 But when you represent it this way, 86 00:03:58,850 --> 00:04:00,580 you could also imagine it as saying, 87 00:04:00,580 --> 00:04:04,470 okay, I have some unknown vector in the coordinate plane 88 00:04:04,470 --> 00:04:07,460 and I'm transforming it using this matrix 89 00:04:07,460 --> 00:04:10,030 to get this vector nine five. 90 00:04:10,030 --> 00:04:12,410 And so I have to figure out what vector, 91 00:04:12,410 --> 00:04:15,510 when transformed in this way, gets us to nine five, 92 00:04:15,510 --> 00:04:18,160 and we also thought about it in the three-by-three case. 93 00:04:18,160 --> 00:04:20,950 What three-dimensional vector, when transformed in this way, 94 00:04:20,950 --> 00:04:23,360 gets us to this vector right over here? 95 00:04:23,360 --> 00:04:24,910 And so that hints, 96 00:04:24,910 --> 00:04:27,410 that foreshadows where we might be able to go. 97 00:04:27,410 --> 00:04:30,530 If we can unwind this transformation somehow, 98 00:04:30,530 --> 00:04:33,850 then we can figure out what these unknown vectors are. 99 00:04:33,850 --> 00:04:37,270 And if we can do it in two dimensions or three dimensions, 100 00:04:37,270 --> 00:04:40,010 why not be able to do it in N dimensions? 101 00:04:40,010 --> 00:04:41,980 Which you'll see is actually very useful 102 00:04:41,980 --> 00:04:43,650 if you ever become a data scientist, 103 00:04:43,650 --> 00:04:45,220 or you go into computer science, 104 00:04:45,220 --> 00:04:47,670 or if you go into computer graphics of some kind.