1 00:00:07,977 --> 00:00:08,560 PROFESSOR: Hi. 2 00:00:08,560 --> 00:00:10,010 Welcome to recitation. 3 00:00:10,010 --> 00:00:12,480 My name is Martina, and I'll be your recitation instructor 4 00:00:12,480 --> 00:00:14,940 for some of these linear algebra videos. 5 00:00:14,940 --> 00:00:16,740 Today's problem is a straightforward 6 00:00:16,740 --> 00:00:18,580 solve the following linear system 7 00:00:18,580 --> 00:00:20,600 with four equations and four unknowns, 8 00:00:20,600 --> 00:00:22,270 using the method of elimination. 9 00:00:22,270 --> 00:00:28,220 The system is x minus y minus z plus u equals 0, 2x plus 2z 10 00:00:28,220 --> 00:00:32,290 equals 8, minus y minus 2z equals -8, 11 00:00:32,290 --> 00:00:36,560 and 3x minus 3y minus 2z plus 4u equals 7. 12 00:00:36,560 --> 00:00:38,310 And although you might know different ways 13 00:00:38,310 --> 00:00:39,984 to solve the system at this point, 14 00:00:39,984 --> 00:00:41,400 the method of elimination is going 15 00:00:41,400 --> 00:00:45,562 to show up a million times during these videos, 16 00:00:45,562 --> 00:00:47,270 so it's really important to get it right. 17 00:00:47,270 --> 00:00:50,180 So I suggest you try solving this system now, using 18 00:00:50,180 --> 00:00:52,584 the method of elimination as it was described in class. 19 00:00:52,584 --> 00:00:54,500 I'm going to leave you alone with the problem. 20 00:00:54,500 --> 00:00:56,860 You should pause the video, solve it yourself, 21 00:00:56,860 --> 00:00:59,452 and then come back and compare your solution with mine. 22 00:01:06,750 --> 00:01:07,890 And we're back. 23 00:01:07,890 --> 00:01:11,560 So the method of elimination, if you remember it from class, 24 00:01:11,560 --> 00:01:14,410 consisted of replacing this system with an equivalent 25 00:01:14,410 --> 00:01:17,390 system-- equivalent meaning they have the same solution-- 26 00:01:17,390 --> 00:01:19,360 by a series of row operations. 27 00:01:19,360 --> 00:01:22,060 Row operations are not supposed to change the solution 28 00:01:22,060 --> 00:01:23,000 to the system. 29 00:01:23,000 --> 00:01:24,860 And they're, for example, exchange 30 00:01:24,860 --> 00:01:26,320 the order of two equations. 31 00:01:26,320 --> 00:01:29,000 Multiply an equation with a nonzero number, 32 00:01:29,000 --> 00:01:32,310 and add a nonzero multiple of one equation to the other. 33 00:01:32,310 --> 00:01:33,950 So let's do that. 34 00:01:33,950 --> 00:01:36,537 As we're going to do this series of arithmetic operations, 35 00:01:36,537 --> 00:01:38,120 we don't really want to copy the names 36 00:01:38,120 --> 00:01:41,060 of the variables and the equality signs every time. 37 00:01:41,060 --> 00:01:43,680 So we're going to keep the important information which 38 00:01:43,680 --> 00:01:45,380 are these numbers. 39 00:01:45,380 --> 00:01:46,940 these coefficients here, we're going 40 00:01:46,940 --> 00:01:48,650 to keep that information in a matrix. 41 00:01:52,250 --> 00:01:54,520 So let's write a matrix. 42 00:01:54,520 --> 00:01:56,930 Each row is going to correspond to an equation, 43 00:01:56,930 --> 00:01:59,850 and each column is going to correspond to an unknown. 44 00:01:59,850 --> 00:02:09,220 So the first row is 1, -1, -1, 1. 45 00:02:13,190 --> 00:02:15,625 The second row, corresponding to the second equation, 46 00:02:15,625 --> 00:02:24,450 is 2, 0, 2, 0. 47 00:02:24,450 --> 00:02:27,080 And you want to be very careful to put 0's on the right spots 48 00:02:27,080 --> 00:02:28,560 here. 49 00:02:28,560 --> 00:02:31,550 The third equation is 0-- I haven't left myself 50 00:02:31,550 --> 00:02:38,840 enough room-- 0, -1, -2, 0. 51 00:02:38,840 --> 00:02:41,480 And the fourth row, corresponding 52 00:02:41,480 --> 00:02:49,990 to the fourth equation, is 3, -3, -2, 4. 53 00:02:49,990 --> 00:02:52,360 And as we care about the right-hand side as well, 54 00:02:52,360 --> 00:02:54,770 we're going to copy this information as well, 55 00:02:54,770 --> 00:02:57,230 and get the augmented matrix of the system. 56 00:02:57,230 --> 00:03:01,100 0, 8, -8, 7. 57 00:03:03,620 --> 00:03:05,686 OK, and now let's try reducing this matrix 58 00:03:05,686 --> 00:03:06,810 to an upper triangular one. 59 00:03:10,102 --> 00:03:11,810 We start with the first column, and we're 60 00:03:11,810 --> 00:03:14,070 going to use this number, called a pivot, 61 00:03:14,070 --> 00:03:15,860 to get rid of all the numbers under it, 62 00:03:15,860 --> 00:03:18,650 so to get 0's here and here. 63 00:03:18,650 --> 00:03:23,230 A way to do it is-- well, to get rid of this 2, 64 00:03:23,230 --> 00:03:26,400 I have to multiply the first row by -2, 65 00:03:26,400 --> 00:03:29,050 and add it to the second one. 66 00:03:29,050 --> 00:03:30,990 Writing this here is not strictly necessary, 67 00:03:30,990 --> 00:03:32,600 but I like to do a bit of bookkeeping, 68 00:03:32,600 --> 00:03:35,040 because I'm prone to make a lot of errors 69 00:03:35,040 --> 00:03:37,200 while doing this simple arithmetic operations. 70 00:03:37,200 --> 00:03:38,930 And then if I get to the end, figure 71 00:03:38,930 --> 00:03:41,110 out I made a mistake somewhere, this bookkeeping 72 00:03:41,110 --> 00:03:43,680 makes it easier to backtrack and find the place 73 00:03:43,680 --> 00:03:45,416 where I made this mistake. 74 00:03:45,416 --> 00:03:48,650 So we replace this matrix with another matrix. 75 00:03:48,650 --> 00:03:51,020 The first row stays the same. 76 00:03:51,020 --> 00:03:57,480 1, -1, -1, 1, 0. 77 00:03:57,480 --> 00:04:01,500 The second row gets replaced by the second row minus 2 times 78 00:04:01,500 --> 00:04:02,580 the first row. 79 00:04:02,580 --> 00:04:06,000 The aim of that is to get a 0 here, so that's good. 80 00:04:06,000 --> 00:04:09,720 Next, on this position here, we get -2 times -1, 81 00:04:09,720 --> 00:04:13,640 which is 2, plus 0 which is 2. 82 00:04:13,640 --> 00:04:20,339 -1 times -2, which is 2, plus 2, which is 4. 83 00:04:20,339 --> 00:04:23,700 -2 plus 0 which is -2. 84 00:04:23,700 --> 00:04:27,512 And 8 minus 2 times 0 which is 8. 85 00:04:27,512 --> 00:04:29,630 The third row already has a 0 here, 86 00:04:29,630 --> 00:04:31,360 so I can just copy it over. 87 00:04:31,360 --> 00:04:37,380 0, -1, -2, 0, -8. 88 00:04:37,380 --> 00:04:42,940 And to get a 0 here, I'm going to multiply the first row by -3 89 00:04:42,940 --> 00:04:50,560 and add it to the fourth row and get 0, -3 times -1 is 3, 90 00:04:50,560 --> 00:04:53,880 minus 3 is 0. 91 00:04:53,880 --> 00:05:04,100 -3 minus 1-- oh, sorry-- 3 minus 2 is 1, and -3 plus 4 is 1. 92 00:05:09,524 --> 00:05:10,190 And there we go. 93 00:05:10,190 --> 00:05:12,280 The first column looks like a first column 94 00:05:12,280 --> 00:05:14,200 of an upper triangular matrix. 95 00:05:14,200 --> 00:05:16,950 Now let's do the same to the second column. 96 00:05:16,950 --> 00:05:19,340 This is going to be our pivot, the number that we use 97 00:05:19,340 --> 00:05:21,220 to get rid of numbers under it. 98 00:05:21,220 --> 00:05:23,540 And we see that to get rid of this number 99 00:05:23,540 --> 00:05:28,270 here, we will need to multiply it with 1/2. 100 00:05:28,270 --> 00:05:30,220 So multiply the whole second row with 1/2, 101 00:05:30,220 --> 00:05:31,830 and add it to the third row. 102 00:05:31,830 --> 00:05:38,370 The matrix that we get will have the first row the same. 103 00:05:38,370 --> 00:05:39,910 It stays the same. 104 00:05:39,910 --> 00:05:48,360 1, -1, -1, 1, 0. 105 00:05:48,360 --> 00:05:50,360 The second row stays the same. 106 00:05:50,360 --> 00:05:56,510 0, 2, 4, -2, 8. 107 00:05:59,100 --> 00:06:01,720 The third row gets replaced by the third row 108 00:06:01,720 --> 00:06:10,180 plus 1/2 times the second row and becomes 0, 0, 2 minus 2 109 00:06:10,180 --> 00:06:22,970 which is 0, -1 plus 0 which is -1, and 4 minus 8 which is -4. 110 00:06:22,970 --> 00:06:28,230 And the fourth row already has a 0 here so I just copy it over. 111 00:06:28,230 --> 00:06:34,544 0, 0, 1, 1, 7. 112 00:06:34,544 --> 00:06:35,960 And now let's look at this matrix. 113 00:06:35,960 --> 00:06:39,310 It has the first two columns as they're supposed to be, 114 00:06:39,310 --> 00:06:41,010 0's under the diagonal. 115 00:06:41,010 --> 00:06:43,480 And now we want to get a 0 here. 116 00:06:43,480 --> 00:06:47,120 Normally what I would do is to circle this number here, 117 00:06:47,120 --> 00:06:50,330 multiply it by something so that I get a -1, 118 00:06:50,330 --> 00:06:53,440 and add it to this row to get a 0 here. 119 00:06:53,440 --> 00:06:54,870 But that's not going to work. 120 00:06:54,870 --> 00:06:58,310 You might remember from lecture that 0's can never be pivots. 121 00:06:58,310 --> 00:07:01,020 Or you can just try finding a number such that 0 122 00:07:01,020 --> 00:07:03,296 times this number equals -1, and seeing 123 00:07:03,296 --> 00:07:04,670 that such a number doesn't exist, 124 00:07:04,670 --> 00:07:06,500 because you're always going to get 0. 125 00:07:06,500 --> 00:07:09,390 So we can proceed as we did until now. 126 00:07:09,390 --> 00:07:12,920 But is there another way to get a 0 here? 127 00:07:12,920 --> 00:07:17,690 There is a very simple row operation, 128 00:07:17,690 --> 00:07:20,820 which consists just of switching the third and the fourth row. 129 00:07:20,820 --> 00:07:23,380 It certainly doesn't change the solution of the system. 130 00:07:23,380 --> 00:07:25,930 So let's do that. 131 00:07:25,930 --> 00:07:35,770 And let's get the next matrix which is 1, -1, -1, 1, 0. 132 00:07:35,770 --> 00:07:42,250 0, 2, 4, -2, 8. 133 00:07:42,250 --> 00:07:43,790 Then we put the fourth row here. 134 00:07:43,790 --> 00:07:47,920 0, 0, 1, 1, 7. 135 00:07:47,920 --> 00:07:54,050 And we put the third row here, 0, 0, 0, -1, -4. 136 00:07:59,740 --> 00:08:01,590 And there it is. 137 00:08:01,590 --> 00:08:03,830 This is an upper triangular matrix. 138 00:08:03,830 --> 00:08:06,560 So in the same way as at the beginning, we had a system 139 00:08:06,560 --> 00:08:08,600 and then wrote the matrix representing it, 140 00:08:08,600 --> 00:08:11,010 this matrix also represents a system. 141 00:08:11,010 --> 00:08:13,740 And this system has the same solutions as the initial system 142 00:08:13,740 --> 00:08:15,400 but is much easier to solve. 143 00:08:15,400 --> 00:08:18,257 Now let's write this back as a system, 144 00:08:18,257 --> 00:08:20,590 and let me do that not starting from the first equation, 145 00:08:20,590 --> 00:08:23,900 but starting from the last equation. 146 00:08:23,900 --> 00:08:30,030 So the last equation here reads -u 147 00:08:30,030 --> 00:08:36,770 equals -4, which is, as equations go, 148 00:08:36,770 --> 00:08:39,530 a pretty easy one to solve. 149 00:08:39,530 --> 00:08:41,734 The solution is u equals 4. 150 00:08:41,734 --> 00:08:43,400 Now let's go back to the third equation. 151 00:08:43,400 --> 00:08:47,360 The third equation reads y-- no, I'm 152 00:08:47,360 --> 00:08:57,670 sorry-- z-- the third column corresponds to z-- plus u 153 00:08:57,670 --> 00:08:59,410 equals 7. 154 00:08:59,410 --> 00:09:01,690 But we know what's u now. 155 00:09:01,690 --> 00:09:13,980 So, it reads z plus 4 equals 7, which just becomes z equals 3. 156 00:09:13,980 --> 00:09:22,100 The second equation is 2 times y plus 4 times z, 157 00:09:22,100 --> 00:09:33,160 but z is 3, minus 2 times u, but u is 4, equals 8. 158 00:09:33,160 --> 00:09:37,870 And from this, one can easily compute that y is equal to 2. 159 00:09:37,870 --> 00:09:52,200 And finally, the first equation reads x minus y minus z plus u 160 00:09:52,200 --> 00:09:58,770 equals 0, or x equals 1. 161 00:09:58,770 --> 00:09:59,980 And this is our solution. 162 00:09:59,980 --> 00:10:04,884 x, y, z, and u equal 1, 2, 3, and 4. 163 00:10:04,884 --> 00:10:07,050 This finishes the problem, but I would very strongly 164 00:10:07,050 --> 00:10:09,610 encourage you now to take this solution 165 00:10:09,610 --> 00:10:11,510 and plug it back into the original system 166 00:10:11,510 --> 00:10:13,300 and check if it's really a solution. 167 00:10:13,300 --> 00:10:15,960 And that's all I wanted to say today.