Ch-4.3-ex-1-Final-허재석

1910 days ago by matrix

A=matrix(5, 5, [1, 1, 1, 1, 1, 2, 1, 1, -1, -11, -1, 1, 2, 1, 3, 3, 2, 2, -2, -4, 6, 4, -3, 1, -7]) b=matrix(5, 1, [-4, 0, 5, -1, 7]) A1=matrix(5, 5, [-4, 1, 1, 1, 1, 0, 1, 1, -1, -11, 5, 1, 2, 1, 3, -1, 2, 2, -2, -4, 7, 4, -3, 1, -7]) A2=matrix(5, 5, [1, -4, 1, 1, 1, 2, 0, 1, -1, -11, -1, 5, 2, 1, 3, 3, -1, 2, -2, -4, 6, 7, -3, 1, -7]) A3=matrix(5, 5, [1, 1, -4, 1, 1, 2, 1, 0, -1, -11, -1, 1, 5, 1, 3, 3, 2, -1, -2, -4, 6, 4, 7, 1, -7]) A4=matrix(5, 5, [1, 1, 1, -4, 1, 2, 1, 1, 0, -11, -1, 1, 2, 5, 3, 3, 2, 2, -1, -4, 6, 4, -3, 7, -7]) A5=matrix(5, 5, [1, 1, 1, 1, -4, 2, 1, 1, -1, 0, -1, 1, 2, 1, 5, 3, 2, 2, -2, -1, 6, 4, -3, 1, 7]) x=matrix(5, 1, [det(A1)/det(A), det(A2)/det(A), det(A3)/det(A), det(A4)/det(A), det(A5)/det(A)]) print A print print b print print "x1=", det(A1)/det(A) print "x2=", det(A2)/det(A) print "x3=", det(A3)/det(A) print "x4=", det(A4)/det(A) print "x5=", det(A5)/det(A) print print x print print (1/det(A))*A.adjoint()*b print print x==(1/det(A))*A.adjoint()*b #확인과정 
       
[  1   1   1   1   1]
[  2   1   1  -1 -11]
[ -1   1   2   1   3]
[  3   2   2  -2  -4]
[  6   4  -3   1  -7]

[-4]
[ 0]
[ 5]
[-1]
[ 7]

x1= -487/74
x2= 2017/222
x3= -737/222
x4= -409/148
x5= -187/444

[ -487/74]
[2017/222]
[-737/222]
[-409/148]
[-187/444]

[ -487/74]
[2017/222]
[-737/222]
[-409/148]
[-187/444]

True
[  1   1   1   1   1]
[  2   1   1  -1 -11]
[ -1   1   2   1   3]
[  3   2   2  -2  -4]
[  6   4  -3   1  -7]

[-4]
[ 0]
[ 5]
[-1]
[ 7]

x1= -487/74
x2= 2017/222
x3= -737/222
x4= -409/148
x5= -187/444

[ -487/74]
[2017/222]
[-737/222]
[-409/148]
[-187/444]

[ -487/74]
[2017/222]
[-737/222]
[-409/148]
[-187/444]

True