WEBVTT 00:00:00.170 --> 00:00:01.070 - [Instructor] In a previous video, 00:00:01.070 --> 00:00:02.240 we saw that if you have a system 00:00:02.240 --> 00:00:04.900 of three equations with three unknowns like this, 00:00:04.900 --> 00:00:08.360 you can represent it as a matrix vector equation, 00:00:08.360 --> 00:00:10.520 where this matrix right over here 00:00:10.520 --> 00:00:13.740 is a three-by-three matrix. 00:00:13.740 --> 00:00:16.180 That is essentially a coefficient matrix. 00:00:16.180 --> 00:00:18.300 It has all of the coefficients of the Xs, 00:00:18.300 --> 00:00:21.350 the Ys, and the Zs as its various columns. 00:00:21.350 --> 00:00:24.660 and then you're going to multiply that times this vector, 00:00:24.660 --> 00:00:27.070 which is really the vector of the unknown variables, 00:00:27.070 --> 00:00:29.570 and this is a three-by-one vector. 00:00:29.570 --> 00:00:30.830 And then you would result 00:00:30.830 --> 00:00:35.450 in this other three-by-one vector, which is a vector 00:00:35.450 --> 00:00:40.050 that contains these constant terms right over here. 00:00:40.050 --> 00:00:42.160 What we're gonna do in this video is recognize 00:00:42.160 --> 00:00:44.570 that you can generalize this phenomenon. 00:00:44.570 --> 00:00:46.340 It's not just true with a system 00:00:46.340 --> 00:00:48.580 of three equations with three unknowns. 00:00:48.580 --> 00:00:52.490 It actually generalizes to N equations with N unknowns. 00:00:52.490 --> 00:00:55.600 But just to appreciate that that is indeed the case, 00:00:55.600 --> 00:00:59.610 let us look at a system of two equations with two unknowns. 00:00:59.610 --> 00:01:04.020 So let's say you had 2x plus y is equal to nine, 00:01:04.020 --> 00:01:09.020 and we had 3x minus y is equal to five. 00:01:09.230 --> 00:01:10.630 I encourage you, pause this video 00:01:10.630 --> 00:01:12.610 and think about how that would be represented 00:01:12.610 --> 00:01:15.253 as a matrix vector equation. 00:01:16.520 --> 00:01:19.520 All right, now let's work on this together. 00:01:19.520 --> 00:01:23.710 So this is a system of two equations with two unknowns. 00:01:23.710 --> 00:01:27.010 So the matrix that represents the coefficients is going 00:01:27.010 --> 00:01:29.390 to be a two-by-two matrix 00:01:29.390 --> 00:01:31.680 and then that's going to be multiplied 00:01:31.680 --> 00:01:35.200 by a vector that represents the unknown variables. 00:01:35.200 --> 00:01:37.090 We have two unknown variables over here. 00:01:37.090 --> 00:01:40.120 So this is going to be a two-by-one vector, 00:01:40.120 --> 00:01:42.910 and then that's going to be equal to a vector 00:01:42.910 --> 00:01:45.520 that represents the constants on the right-hand side, 00:01:45.520 --> 00:01:46.810 and obviously we have two of those. 00:01:46.810 --> 00:01:49.430 So that's going to be a two-by-one vector as well. 00:01:49.430 --> 00:01:51.870 And then we can do exactly what we did 00:01:51.870 --> 00:01:54.410 in that previous example in a previous video. 00:01:54.410 --> 00:01:58.850 The coefficients on the X terms, two and three, 00:01:58.850 --> 00:02:02.570 and then we have the coefficients on the Y terms. 00:02:02.570 --> 00:02:04.530 This would be a positive one 00:02:04.530 --> 00:02:06.930 and then this would be a negative one. 00:02:06.930 --> 00:02:09.570 And then we multiply it times the vector 00:02:09.570 --> 00:02:12.490 of the variables, X, Y, 00:02:12.490 --> 00:02:14.700 and then last but not least, 00:02:14.700 --> 00:02:19.200 you have this nine and this five over here, nine and five. 00:02:19.200 --> 00:02:22.040 And I encourage you and multiply this out. 00:02:22.040 --> 00:02:25.390 Multiply this matrix times this vector. 00:02:25.390 --> 00:02:28.560 And when you do that and you still set up this equality, 00:02:28.560 --> 00:02:30.620 you're going to see that it essentially turns 00:02:30.620 --> 00:02:32.770 into this exact same system 00:02:32.770 --> 00:02:36.010 of two equations and two unknowns. 00:02:36.010 --> 00:02:37.650 Now, what's interesting about this is 00:02:37.650 --> 00:02:40.730 that we see a generalizable form. 00:02:40.730 --> 00:02:43.860 In general, you can represent a system 00:02:43.860 --> 00:02:47.890 of N equations and N unknowns in the form. 00:02:47.890 --> 00:02:51.740 Sum N-by-N matrix A, 00:02:51.740 --> 00:02:53.400 N by N, 00:02:53.400 --> 00:02:58.340 times sum N-by-one vector X. 00:02:58.340 --> 00:02:59.523 This isn't just the variable X. 00:02:59.523 --> 00:03:03.950 This is a vector X that has N dimensions to it. 00:03:03.950 --> 00:03:08.610 So times sum N-by-one vector X is going 00:03:08.610 --> 00:03:13.530 to be equal to sum N-by-one vector B. 00:03:14.480 --> 00:03:17.360 These are the letters that people use by convention. 00:03:17.360 --> 00:03:19.030 This is going to be N by one. 00:03:19.030 --> 00:03:21.890 And so you can see in these different scenarios. 00:03:21.890 --> 00:03:24.850 In that first one, this is a three-by-three matrix. 00:03:24.850 --> 00:03:26.870 We could call that A, 00:03:26.870 --> 00:03:29.580 and then we could call this the vector X, 00:03:29.580 --> 00:03:31.760 and then we could call this the vector B. 00:03:31.760 --> 00:03:32.850 Now in that second scenario, 00:03:32.850 --> 00:03:34.800 we could call this the matrix A, 00:03:34.800 --> 00:03:36.850 we could call this the vector X, 00:03:36.850 --> 00:03:39.320 and then we could call this the vector B, 00:03:39.320 --> 00:03:42.820 but we can generalize that to N dimensions. 00:03:42.820 --> 00:03:44.760 And as I talked about in the previous video, 00:03:44.760 --> 00:03:47.880 what's interesting about this is you could think about, 00:03:47.880 --> 00:03:49.890 for example, in this system of two equations 00:03:49.890 --> 00:03:52.300 with two unknowns, as all right, I have a line here, 00:03:52.300 --> 00:03:53.490 I have a line here, 00:03:53.490 --> 00:03:57.640 and X and Y represent the intersection of those lines. 00:03:57.640 --> 00:03:58.850 But when you represent it this way, 00:03:58.850 --> 00:04:00.580 you could also imagine it as saying, 00:04:00.580 --> 00:04:04.470 okay, I have some unknown vector in the coordinate plane 00:04:04.470 --> 00:04:07.460 and I'm transforming it using this matrix 00:04:07.460 --> 00:04:10.030 to get this vector nine five. 00:04:10.030 --> 00:04:12.410 And so I have to figure out what vector, 00:04:12.410 --> 00:04:15.510 when transformed in this way, gets us to nine five, 00:04:15.510 --> 00:04:18.160 and we also thought about it in the three-by-three case. 00:04:18.160 --> 00:04:20.950 What three-dimensional vector, when transformed in this way, 00:04:20.950 --> 00:04:23.360 gets us to this vector right over here? 00:04:23.360 --> 00:04:24.910 And so that hints, 00:04:24.910 --> 00:04:27.410 that foreshadows where we might be able to go. 00:04:27.410 --> 00:04:30.530 If we can unwind this transformation somehow, 00:04:30.530 --> 00:04:33.850 then we can figure out what these unknown vectors are. 00:04:33.850 --> 00:04:37.270 And if we can do it in two dimensions or three dimensions, 00:04:37.270 --> 00:04:40.010 why not be able to do it in N dimensions? 00:04:40.010 --> 00:04:41.980 Which you'll see is actually very useful 00:04:41.980 --> 00:04:43.650 if you ever become a data scientist, 00:04:43.650 --> 00:04:45.220 or you go into computer science, 00:04:45.220 --> 00:04:47.670 or if you go into computer graphics of some kind.