Hi,

On Thu, Sep 05, 2019 at 06:33:34PM -0400, David Joyner wrote:
> On Thu, Sep 5, 2019 at 6:29 PM David Guichard <david.guich...@gmail.com>
> wrote:
> 
> > When is a linear system consistent?
> >
> > This isn't helpful:
> >
> > a,b,c=var('a b c')
> > A=matrix([[-4,5,9,a],[1, -2, 1, b],[-2,4,-2,c]])
> > A.echelon_form()
> > A.rref()
> >
> > [    1     0 -23/3     0]
> > [    0     1 -13/3     0]
> > [    0     0     0     1]
> >
> > [    1     0 -23/3     0]
> > [    0     1 -13/3     0]
> > [    0     0     0     1]
> >
> >
> > But this works, so I know how to get what I want:
> >
> > R.<a,b,c>=QQ[]
> > A=matrix(R,[[-4,5,9,a],[1, -2, 1, b],[-2,4,-2,c]])
> > A.echelon_form()
> >
> > [ 1 0 -23/3   -2/3*a - 5/3*b]
> > [ 0 1 -13/3   -1/3*a - 4/3*b]
> > [ 0 0     0             2*b + c]
> >
> > So [a,b,c] is in the span of the columns iff 2b+c==0.
> >
> > Somewhat oddly, rref doesn't work here:
> >
> > A.rref()
> >
> > [    1     0 -23/3     0]
> > [    0     1 -13/3     0]
> > [    0     0     0     1]
> >
> >
> This is because the CAS used assumes  2*b + c is non-zero.
> I would call it an "unfortunate feature", except that it (this "feature")
> gives teachers of linear algebra examples for tests and quizzes that
> can't be correctly solved using a CAS, and have to be solved by hand.

I would say that there is a bug in the 'default' algorithm. Note that
changing the algorithm leads to:

sage: A.echelon_form(algorithm='partial_pivoting')
[             1              0          -23/3 -2/3*a + 5/6*c]
[             0              1          -13/3 -1/3*a + 2/3*c]
[             0              0              0      b + 1/2*c]

Ciao,
Thierry


> -- 
> > You received this message because you are subscribed to the Google Groups
> > "sage-devel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to sage-devel+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/sage-devel/3db327ca-9826-4fc8-92b1-b14aa80dfe82%40googlegroups.com
> > <https://groups.google.com/d/msgid/sage-devel/3db327ca-9826-4fc8-92b1-b14aa80dfe82%40googlegroups.com?utm_medium=email&utm_source=footer>
> > .
> >
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-devel/CAEQuuAX6p-Tn8uTsYrW_F7PR_gbtxuqz0rV4AJs_PB%2B4CuqCiA%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/20190906081945.odbyxdrbhymoxmmd%40metelu.net.

Reply via email to