CoCalc -- Collaborative Calculation in the Cloud
Sharedsage_worksheets / ADS_matrix.ipynbOpen in CoCalc

Worksheets related to Applied Discrete Structures

Row Reduction

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]
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()

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()


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()

A=[[2,1,0,4],[-1,2,1,0],[0,-1,2,1]]
A
matrix(A)
%html
Edit text...
var (' D, P')
A = Matrix (QQ, [[4, 1, 0], [1, 5, 1], [0, 1, 4]]);A
(D,P)=A.right_eigenmatrix();(D,P)
P.inverse()*A*P
A2=Matrix(QQ,[[8,1,0],[1,5,1],[0,1,7]])
P=A2.right_eigenmatrix()[1]
P.numerical_approx(digits=3)
print '------------------'
D=(P.inverse()*A2*P);D.numerical_approx(digits=3)
A=Matrix(QQ,[[1, 0, 0],[0,2,1],[1,-1,4]])
A.right_eigenmatrix()
A=Matrix(QQ,[[2,1],[2,3]])
A.exp()
Matrix?