Matt Rissler wrote:
> Basically, I'm having student look for the x that makes the matrix
> singular, or the columns linearly dependent, or ... However Sage
> behaves like so:
>
> sage: A=matrix([[0,1,1],[2,2,-2],[-1,x,3]])
> sage: A
> [ 0 1 1]
> [ 2 2 -2]
> [-1 x 3]
> sage: A.echelon_form()
> [1 0 0]
> [0 1 0]
> [0 0 1]
>
>
> Is there anyway to make it so Sage doesn't assume that it can rescale
> by dividing by whatever function of x we get in the bottom row (in
> this case 1-x), because that might be 0?
>
> Doing the row reduction 'by hand', ie making Sage do it, works, but it
> would be nice if echelon form did it.
I'm not making excuses, but mathematica does the same:
In[5]:= A={{0,1,1},{2,2,-2},{-1,x,3}}
Out[5]= {{0, 1, 1}, {2, 2, -2}, {-1, x, 3}}
In[6]:= RowReduce[A]
Out[6]= {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}
I've found this frustrating with mathematica before.
Here's one way to do it. This avoids the call to maxima, which means we
use the generic algorithm in Sage that does not assume that you can
divide by x.
sage: x=polygen(QQ)
sage: A=matrix([[0,1,1],[2,2,-2],[-1,x,3]])
sage: A.echelon_form()
[ 2 2 -2]
[ 0 -1 -1]
[ 0 0 -x + 1]
Jason
--
Jason Grout
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---