Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168733
Image: ubuntu2004
M=MatrixSpace(QQ,3)
I=M([1,0,0,0,1,0,0,0,1]); I
[1 0 0] [0 1 0] [0 0 1]
MC=MatrixSpace(QQ,3,1) b=MC([0,1,0]);b
[0] [1] [0]
# Working on problem 14a in Rorres section 1.6
A=M([1,3,5,-1,2,0,2,5,4]) A
[ 1 3 5] [-1 2 0] [ 2 5 4]
C=A\b; C
[-13/25] [ 6/25] [ -1/25]
C1=A.solve_right(b) C1
[-13/25] [ 6/25] [ -1/25]
C2=A.augment(b) C2
[ 1 3 5 0] [-1 2 0 1] [ 2 5 4 0]
C2.echelon_form()
[ 1 0 0 -13/25] [ 0 1 0 6/25] [ 0 0 1 -1/25]
A_inv=A.inverse() A_inv
[ -8/25 -13/25 2/5] [ -4/25 6/25 1/5] [ 9/25 -1/25 -1/5]
C3=A_inv*b C3
[-13/25] [ 6/25] [ -1/25]
C4=A.augment(I) C4
[ 1 3 5 1 0 0] [-1 2 0 0 1 0] [ 2 5 4 0 0 1]
C4.echelon_form()
[ 1 0 0 -8/25 -13/25 2/5] [ 0 1 0 -4/25 6/25 1/5] [ 0 0 1 9/25 -1/25 -1/5]
#Notice that the result above is I | A_inv #Notice that we can get the solution to Ax = b as C, or C1, or the rightmost column of C2.echelon_form() or C3