Sharedsage_worksheets / ADS_matrix.ipynbOpen in CoCalc
Author: Ken Levasseur
Description: Worksheets related to Applied Discrete Structures

# Row Reduction

In [1]:
C = Matrix(QQ,[[1,1,1,1],[5,1,2,2]]);C
print '--------------------'
C.echelon_form()

--------------------
[ 1 0 1/4 1/4] [ 0 1 3/4 3/4]
In [ ]:
H=Matrix(Integers(2),[[1,1,0,0,1,1],[1,0,1,0,1,0],[1,0,1,1,0,1],[0,1,1,1,0,0]]);H
print '--------------------'
H.echelon_form()

In [ ]:


In [ ]:
H=Matrix(Integers(2),[[1,1,0,1,0,0,1],[1,0,1,0,1,0,0],[0,1,1,0,0,1,0]]);H
print '*****************'
H.echelon_form()

In [ ]:


In [ ]:


In [ ]:
H2=Matrix(Integers(2),[[1,1,0,1,1,1],[1,0,1,1,0,0],[0,1,1,0,1,0]]);H2
print '*****************'
H2.echelon_form()

In [ ]:


In [ ]:
A=[[2,1,0,4],[-1,2,1,0],[0,-1,2,1]]
A

In [ ]:
matrix(A)

In [ ]:
%html
Edit text...

In [ ]:
var (' D, P')
A = Matrix (QQ, [[4, 1, 0], [1, 5, 1], [0, 1, 4]]);A

In [ ]:
(D,P)=A.right_eigenmatrix();(D,P)

In [ ]:
P.inverse()*A*P

In [ ]:
A2=Matrix(QQ,[[8,1,0],[1,5,1],[0,1,7]])

In [ ]:
P=A2.right_eigenmatrix()[1]
P.numerical_approx(digits=3)
print '------------------'
D=(P.inverse()*A2*P);D.numerical_approx(digits=3)

In [ ]:
A=Matrix(QQ,[[1, 0, 0],[0,2,1],[1,-1,4]])
A.right_eigenmatrix()

In [ ]:
A=Matrix(QQ,[[2,1],[2,3]])
A.exp()

In [ ]:
Matrix?

In [ ]: