1105b MrG Matrix Algebra!

2630 days ago by MATH4R2013

#1) Find the Inverse Matrix a=matrix([(4,8),(2,3)]) show(a) show(a^(-1)) show(a*a^(-1)) 
       


#2) The Inverse Matrix D.N.E. b=matrix([(4,6),(2,3)]) show(b) show(b^(-1)) 
       

Traceback (click to the left of this block for traceback)
...
ZeroDivisionError: input matrix must be nonsingular
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_6.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("IzIpCmI9bWF0cml4KFsoNCw2KSwoMiwzKV0pCnNob3coYikKc2hvdyhiXigtMSkp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpz0jhV0/___code___.py", line 5, in <module>
    exec compile(u'show(b**(-_sage_const_1 ))
  File "", line 1, in <module>
    
  File "matrix0.pyx", line 4757, in sage.matrix.matrix0.Matrix.__pow__ (sage/matrix/matrix0.c:26390)
  File "element.pyx", line 1776, in sage.structure.element.RingElement.__pow__ (sage/structure/element.c:14574)
  File "element.pyx", line 3371, in sage.structure.element.generic_power_c (sage/structure/element.c:26046)
  File "matrix0.pyx", line 4657, in sage.matrix.matrix0.Matrix.__invert__ (sage/matrix/matrix0.c:25744)
  File "matrix_rational_dense.pyx", line 650, in sage.matrix.matrix_rational_dense.Matrix_rational_dense.__invert__ (sage/matrix/matrix_rational_dense.c:9323)
  File "matrix_rational_dense.pyx", line 733, in sage.matrix.matrix_rational_dense.Matrix_rational_dense.__invert__main (sage/matrix/matrix_rational_dense.c:9723)
ZeroDivisionError: input matrix must be nonsingular
#3) find the POI (x,y): 2*x+y==8, x+y==5 a=matrix([(2,1),(1,1)]) b=matrix(2,1,[(8),(5)]) show(a) show(b) show(a^(-1)) show(a^(-1)*b) 
       



var('y') solve([2*x+y==8, x+y==5],x,y) 
       
plot([8-2*x, 5-x],0,5) 
       
#4) find the POI (x,y): -4*x+y==0, 6*x-2*y==14 a=matrix([(-4,1),(6,-2)]) b=matrix(2,1,[(0),(14)]) show(a) show(b) show(a^(-1)) show(a^(-1)*b) 
       



#5) find the POI (x,y,z): 3*x+3*y+z==8, x+2*y+z==5, 2*x-y+z==4 a=matrix([(3,3,1),(1,2,1),(2,-1,1)]) b=matrix(3,1,[(8),(5),(4)]) show(a) show(b) show(a^(-1)) show(a^(-1)*b)