2020-10-07 MATH 3110 Matrix algebra

409 days ago by calkin

A = matrix(2,2,[1,3,4,2]) B=matrix(2,2,[5,9,10,3]) C=matrix(2,2,[1,2,5,4]) 
       
show((A*B)*C) 
       
show(A*(B*C)) 
       
show(A) 
       
A.inverse() 
       
[ -1/5  3/10]
[  2/5 -1/10]
[ -1/5  3/10]
[  2/5 -1/10]
A*A.inverse() 
       
[1 0]
[0 1]
[1 0]
[0 1]
A=matrix(3,3,[1,2,3,4,3,2,1,5,6]) 
       
B=A.inverse() 
       
A*B 
       
[1 0 0]
[0 1 0]
[0 0 1]
[1 0 0]
[0 1 0]
[0 0 1]
B*A 
       
[1 0 0]
[0 1 0]
[0 0 1]
[1 0 0]
[0 1 0]
[0 0 1]
A=matrix(3,3,[1,2,3,2,3,4,3,4,5]) 
       
A.inverse() 
       
Traceback (click to the left of this block for traceback)
...
ZeroDivisionError: Matrix is singular
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_16.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("QS5pbnZlcnNlKCk="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmphsNi9n/___code___.py", line 2, in <module>
    exec compile(u'A.inverse()
  File "", line 1, in <module>
    
  File "sage/matrix/matrix2.pyx", line 8503, in sage.matrix.matrix2.Matrix.inverse (/usr/local/sage-6.10/src/build/cythonized/sage/matrix/matrix2.c:63556)
  File "sage/matrix/matrix_integer_dense.pyx", line 3853, in sage.matrix.matrix_integer_dense.Matrix_integer_dense.__invert__ (/usr/local/sage-6.10/src/build/cythonized/sage/matrix/matrix_integer_dense.c:33244)
  File "sage/matrix/matrix_integer_dense.pyx", line 3814, in sage.matrix.matrix_integer_dense.Matrix_integer_dense._invert_flint (/usr/local/sage-6.10/src/build/cythonized/sage/matrix/matrix_integer_dense.c:33078)
ZeroDivisionError: Matrix is singular
A=matrix(3,2,[1,2,4,8,16,32]) 
       
       
[ 1  2]
[ 4  8]
[16 32]
[ 1  2]
[ 4  8]
[16 32]
A.transpose() 
       
[ 1  4 16]
[ 2  8 32]
[ 1  4 16]
[ 2  8 32]
A*A.transpose() 
       
[   5   20   80]
[  20   80  320]
[  80  320 1280]
[   5   20   80]
[  20   80  320]
[  80  320 1280]
A.transpose()*A 
       
[ 273  546]
[ 546 1092]
[ 273  546]
[ 546 1092]
(A*A.transpose()).trace() 
       
1365
1365
(A.transpose()*A).trace() 
       
1365
1365
B = matrix(2,3,[5,2,1,7,4,3]) 
       
A=B.transpose()*B 
       
show(A) 
       
show(A.eigenmatrix_right()) 
       
show(A.eigenmatrix_left()) 
       
 
       
 
       
show(A.eigenvectors_right())