Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Jupyter notebook quiz5.ipynb

Project: quiz5
Views: 77
Kernel: SageMath 7.4
C=matrix (QQ,4,[-2,-5,-10,3,10,1,3,6,-2,-7,1,2,4,0,0,0,1,2,-3,10]) print"a" print C
a [ -2 -5 -10 3 10] [ 1 3 6 -2 -7] [ 1 2 4 0 0] [ 0 1 2 -3 10]
print"b" C.swap_rows(0,1) C.add_multiple_of_row(1,0,2) C.add_multiple_of_row(2,0,-1) print C
b [ 0 1 2 -1 -4] [ 1 5 10 -4 -15] [ 0 -2 -4 3 11] [ 0 1 2 -3 10]
print"c" print C.rref() print "x1= 2" print "x2 = -1 - 2x3" print "x3 = x3" print "x4 = 3"
c [1 0 0 0 0] [0 1 2 0 0] [0 0 0 1 0] [0 0 0 0 1] x1= 2 x2 = -1 - 2x3 x3 = x3 x4 = 3
print "d" C=matrix (QQ,4,[-2,-5,-10,3,10,1,3,6,-2,-7,1,2,4,0,0,0,1,2,-3,10]) A=C.submatrix(0,0,4,4) print A
d [ -2 -5 -10 3] [ 1 3 6 -2] [ 1 2 4 0] [ 0 1 2 -3]
print "e" print 3*A*A.transpose()
e [ 414 -249 -156 -102] [-249 150 93 63] [-156 93 63 30] [-102 63 30 42]
print "f" print 1/2*(A-A.transpose())+1/2*(A+A.transpose())
f [ -2 -5 -10 3] [ 1 3 6 -2] [ 1 2 4 0] [ 0 1 2 -3]
print "problem 2a" P = polygon([(0,0),(0,1),(1,1),(1,0)]) plot(P)