You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and it has a particular name: _Row Echelon Form_. Basically, any matrix can be considered in row echelon form if
85
-
86
-
1. All non-zero rows are above rows of all zeros
87
-
2. The leading coefficient or _pivot_ (the first non-zero element in every row when reading from left to right) is right of the pivot of the row above it.
88
-
89
-
Now, Row Echelon Form is nice, but wouldn't it be even better if our system of equations looked simply like this
83
+
Remember this one, we'll come back to it. Now, this is nice, but wouldn't it be even better if our system of equations looked simply like this
90
84
91
85
92
86
$$
@@ -111,10 +105,91 @@ $$
111
105
\right]
112
106
$$
113
107
108
+
And that's where we really want to get to for obvious reasons.
109
+
110
+
Remember the earlier matrix form? It has a particular name: _Row Echelon Form_. Basically, any matrix can be considered in row echelon form if
111
+
112
+
1. All non-zero rows are above rows of all zeros
113
+
2. The leading coefficient or _pivot_ (the first non-zero element in every row when reading from left to right) is right of the pivot of the row above it.
114
+
115
+
All the following examples are in the Row Echelon Form:
116
+
117
+
$$
118
+
\left[
119
+
\begin{array}{ccc|c}
120
+
2 & 3 & 4 & 6 \\
121
+
0 & 1 & 2 & 2 \\
122
+
0 & 0 & 11 & 18
123
+
\end{array}
124
+
\right]
125
+
\;,\;
126
+
\left[
127
+
\begin{array}{ccc|c}
128
+
5 & 4 & 0 & 10 \\
129
+
0 & 0 & 5 & 7 \\
130
+
0 & 0 & 0 & 1
131
+
\end{array}
132
+
\right]
133
+
\;,\;
134
+
\left[
135
+
\begin{array}{ccccc}
136
+
1 & -3 & 4 & 1 & 6 \\
137
+
0 & 3 & 3 & 5 & 0 \\
138
+
0 & 0 & 0 & 2 & 0
139
+
\end{array}
140
+
\right]
141
+
\;,\;
142
+
\left[
143
+
\begin{array}{cc}
144
+
0 & 0 \\
145
+
0 & 0 \\
146
+
0 & 0
147
+
\end{array}
148
+
\right]
149
+
$$
150
+
151
+
Out of all of these, only the first two one make sense if you're talking about a system of linear equations, as the last two don't even have the right dimensions. Additionally, if you translate the last row of second matrix into a system, you get $$0=1$$, which is a contradiction. This is due to the fact that the matrix is singular, and there are no solutions to this particular system. Nevertheless, all of these are in Row Echelon Form.
152
+
153
+
Now, it seems obvious to point out that if we ignore the last column, Row Echelon Form is an upper triangular matrix. This might not be important now, but it will play an important role in future discussions, so keep it buzzing in the back of your brain.
154
+
155
+
As we discussed before, Row Echelon Form is not the terminus. Cue the * **Reduced** Row Echelon Form*. A matrix is in Reduced Row Echelon form if it satisfies the following conditions:
114
156
115
-
And again has a special name * **Reduced** Row Echelon Form*. Now, it seems obvious to point out that if we remove the values to the right of the equals sign \($$=$$\), Row Echelon Form is an upper triangular matrix. This might not be important now, but it will play an important role in future discussions, so keep it buzzing in the back of your brain.
157
+
1. It is in row echelon form.
158
+
2. Every pivot is 1 and is the only nonzero entry in its column.
116
159
117
-
For now, I hope the motivation is clear: we want to convert a matrix into Row Echelon and (potentially) Reduced Row Echelon Form to make large systems of equations trivial to solve, so we need some method to do that. What is that method called? \(Hint: It's the title of this section\)
160
+
All the following examples are in the Reduced Row Echelon Form:
161
+
162
+
$$
163
+
\left[
164
+
\begin{array}{ccc|c}
165
+
1 & 0 & 0 & 8 \\
166
+
0 & 1 & 0 & -3 \\
167
+
0 & 0 & 1 & 9
168
+
\end{array}
169
+
\right]
170
+
\;,\;
171
+
\left[
172
+
\begin{array}{ccc|c}
173
+
1 & 4 & 0 & 9 \\
174
+
0 & 0 & 1 & 7 \\
175
+
0 & 0 & 0 & 1
176
+
\end{array}
177
+
\right]
178
+
\;,\;
179
+
\left[
180
+
\begin{array}{cc}
181
+
0 & 0 \\
182
+
0 & 0 \\
183
+
0 & 0
184
+
\end{array}
185
+
\right]
186
+
$$
187
+
188
+
Again, only the first one (the identity matrix looking guy) is desirable in the context of solving a system of equations, but transforming a matrix in this form gives us an immediate and definitive answer at the question: can I solve my system?
189
+
190
+
Beyond solving a system, reshaping a matrix in this form makes it very easy to deduce other properties of the matrix, such as the rank.
191
+
192
+
For now, I hope the motivation is clear: we want to convert a matrix into Row Echelon and then Reduced Row Echelon Form to make large systems of equations trivial to solve, so we need some method to do that. What is that method called? \(Hint: It's the title of this section\)
118
193
119
194
That's right! _Gaussian Elimination_
120
195
@@ -150,7 +225,7 @@ $$
150
225
151
226
There are plenty of different strategies you could use to do this, and no one strategy is better than the rest. Personally, I usually try to multiply each row in the matrix by different values and add rows together until the first column is all the same value, and then I subtract the first row from all subsequent rows. I then do the same thing for the following columns.
152
227
153
-
After you get an upper triangular matrix, the next step is diagonalizing to create the Reduced Row Echelon Form. In other words, we do the following:
228
+
After you get an upper triangular matrix, the next step is creating the Reduced Row Echelon Form. In other words, we do the following:
154
229
155
230
$$
156
231
\left[
@@ -176,19 +251,22 @@ Here, the idea is similar to above. The strategy is the same as before, but star
176
251
177
252
Now, the analytical method may seem straightforward, but the algorithm does not obviously follow from the game we were playing before, so we'll go through it step-by-step.
178
253
179
-
In general, do the following process:
254
+
Row by row, do the following process:
180
255
181
-
1.For each column `col`, find the highest value
256
+
1.Find the highest value in the column below the pivot candidate
182
257
$$
183
258
\left[
184
259
\begin{array}{ccc|c}
185
-
2 & 3 & 4 & 6 \\
260
+
\mathbf{2} & 3 & 4 & 6 \\
186
261
1 & 2 & 3 & 4 \\
187
262
\mathbf{3} & -4 & 0 & 10
188
263
\end{array}
189
264
\right]
190
265
$$
191
-
2. Swap the row with the highest valued element with the `col`th row.
266
+
267
+
If that value is $$0$$, the matrix is singular and the system has no solutions. Feel free to exit here, but I'm powering through by moving on to the next column, baby!
268
+
269
+
2. Swap the row with the highest valued element with the current row.
192
270
$$
193
271
\left[
194
272
\begin{array}{ccc|c}
@@ -206,7 +284,7 @@ $$
206
284
\end{array}
207
285
\right]
208
286
$$
209
-
3. For all remaining rows, find a fraction that corresponds to the ratio of the lower value in that column to the central pivot \(the one you swapped to the top\)
287
+
3. For all remaining rows below the pivot, find a fraction that corresponds to the ratio of the lower value in that column to the pivot \(the one you swapped to the top\)
210
288
$$
211
289
\rightarrow
212
290
\left[
@@ -223,7 +301,7 @@ $$
223
301
$$
224
302
4. Set all values in the corresponding rows to be the value they were before $$-$$ the top row $$\times$$ the fraction. This is essentially performing move 3 from above, except with an optimal multiplicative factor.
As with all code, it takes time to fully absorb what is going on and why everything is happening; however, I have tried to comment the above pseudocode with the necessary steps. Let me know if anything is unclear!
341
+
As with all code, it takes time to fully absorb what is going on and why everything is happening; however, I have tried to comment the above code with the necessary steps. Let me know if anything is unclear!
265
342
266
-
Now, to be clear: this algorithm creates an upper-triangular matrix. In other words, it only creates a matrix in *Row Echelon Form*, not * **Reduced** Row Echelon Form*! So what do we do from here? Well, we could create another step to further reduce the matrix, but another method would be to use*Back-Substitution*.
343
+
Now, to be clear: this algorithm creates an upper-triangular matrix. In other words, it only creates a matrix in *Row Echelon Form*, not * **Reduced** Row Echelon Form*! So what do we do from here? Well, we continue further reducing the matrix, but with a twist: using the*Back-Substitution*.
267
344
268
-
The back-substitution method is precisely what we said above.
345
+
The back-substitution method is precisely what we said above, but for every pivot starting from the bottom right one.
269
346
If we have a matrix in Row Echelon Form, we can directly solve for $$z$$, and then plug that value in to find $$y$$ and then plug both of those values in to find $$x$$!
270
-
Even though this seems straightforward, the pseudocode might not be as simple as you thought!
347
+
Even though this seems straightforward, the code might not be as simple as you thought, especially if your matrix is singular.
0 commit comments