Talk:Reduced row echelon form: Difference between revisions

m
no edit summary
m (moved critique of... something? from main page)
mNo edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1:
=="Break"SWAP vs. "returnRows" bug==
 
The algorithm has a Bug.<br>
 
It does NOT do the SWAP. No conditions are checked<br>
 
 
It does NOT work for this example matrix<br>
 
 
Solve the following system of equations.<br>
 
3x+y− 4z=−1<br>
 
x +10z= 5<br>
 
4x+y+ 6z= 1<br>
 
Solution. The corresponding augmented matrix is<br>
 
3 1 −4 −1<br>
 
1 0 10 5<br>
 
4 1 6 1<br>
 
Create the first leading one by interchanging rows 1 and 2<br>
 
1 0 10 5<br>
 
3 1 −4 −1<br>
 
4 1 6 1<br>
 
Now subtract 3 times row 1 from row 2, and subtract 4 times row 1 from row 3. The result is<br>
 
1 0 10 5<br>
 
0 1 −34 −16<br>
 
0 1 −34 −19<br>
 
Now subtract row 2 from row 3 to obtain<br>
 
1 0 10 5<br>
 
0 1 −34 −16<br>
 
0 0 0 −3<br>
 
This means that the following reduced system of equations<br>
 
x +10z= 5<br>
 
y−34z=−16<br>
 
0= −3<br>
 
 
is equivalent to the original system. In other words, the two have the same solutions. But this last<br>
 
system clearly has no solution (the last equation requires that x, y and z satisfy 0x+0y+0z = −3,<br>
 
and no such numbers exist). Hence the original system has no solution.<br> [[User:Umariani|Umariani]]
 
:The algorithm does not have a bug. Failure to check conditions is not part of the algorithm, it is part of the implementation. That is just a degenerate case.
 
:A few points:
:# The task does not require checking for degenerate cases.
:# Even if it did, you gave no indication of which implementation fails on degenerate cases.
:# What should the implementation do in the case of a "failure"? Error message? Warning? Or just precede as far as possible? (Which is what the [[Reduced_row_echelon_form#Raku|Raku]] implementation does.)
 
: ''By the way, please sign your discussion page edits.'' --[[User:Thundergnat|Thundergnat]] ([[User talk:Thundergnat|talk]]) 12:38, 20 July 2023 (UTC)
 
:: The algorithm is useful for solving a system of linear equations, but a reduced row echelon form can be made even if there is no such solution! The reduced form of the system
<pre>
3 1 -4 -1
1 0 10 5
4 1 6 1
 
is
 
1 0 10 0
0 1 -34 0
0 0 0 1
</pre>
--[[User:Wherrera|Wherrera]] ([[User talk:Wherrera|talk]]) 20:14, 20 July 2023 (UTC)
 
=="Break" vs. "return" bug==
The original author of the Python example mistakenly translated the keyword <code>stop</code> that appears in the [http://en.wikipedia.org/wiki/Row_echelon_form#Pseudocode Wikipedia pseudocode] as <code>break</code> rather than the correct <code>return</code>. This created a control-flow bug that didn't manifest itself when the program was run on the example matrix given in the task description, but did cause an exception if the program was run on, e.g.,
<pre>
4,105

edits