# 1) Solve the matrix for a linear system. # # > with(linalg): Warning: new definition for norm Warning: new definition for trace -------------------------------------------------------------------------------- > S1:= linalg[matrix] (3,6,[0, 4,-1,3,7,1, 0,0,0,3,4,9, 0,0,0,0,5,0] ); [ 0 4 -1 3 7 1 ] [ ] S1 := [ 0 0 0 3 4 9 ] [ ] [ 0 0 0 0 5 0 ] -------------------------------------------------------------------------------- > eqns := {4*y-z+3*w+7*v=1, 3*w+4*v=9, 5*v=0}; eqns := {4 y - z + 3 w + 7 v = 1, 3 w + 4 v = 9, 5 v = 0} -------------------------------------------------------------------------------- > S1 := solve (eqns); S1 := {v = 0, z = 4 y + 8, w = 3, y = y} -------------------------------------------------------------------------------- # # 2) Solve the system by Gaussian Elimination. # # > eqns := { 3*x1-x2+x3-5*x4-x5=0, 6*x1-2*x2+2*x3-9*x4+x5=0, (-9)*x1+3*x2-3*x3+11*x4-x5=0 }; eqns := {3 x1 - x2 + x3 - 5 x4 - x5 = 0, 6 x1 - 2 x2 + 2 x3 - 9 x4 + x5 = 0, - 9 x1 + 3 x2 - 3 x3 + 11 x4 - x5 = 0} > printlevel := <3> > S2 := solve(eqns); S2 := {x5 = 0, x4 = 0, x2 = 3 x1 + x3, x1 = x1, x3 = x3} > printlevel := <3>\ # !!! Here is problem 24 !!! # > eqns := { x1+x2+x3+x4+x5=5, x1+x5=-4, x1-x2=3}; eqns := {x1 + x2 + x3 + x4 + x5 = 5, x1 + x5 = -4, x1 - x2 = 3} -------------------------------------------------------------------------------- > S3 := solve(eqns); S3 := {x1 = - x5 - 4, x2 = - x5 - 7, x3 = 16 + x5 - x4, x4 = x4, x5 = x5} -------------------------------------------------------------------------------- # # 3) Explain: # # a). if a = 0, then no multiple of equation (1) would be subtracted from equation (3). # This is true because when a = 0, there is no need of elimination. # # b). If b = 0, then no multiple of equation (2) would be subtracted from equation (3). # If a!=0, we need to subtract a multiple of equation (1) which is a scalor s*eqn(1) from eqn(3) to eliminate a, after the # first column elimination, b becomes b-s*3 != 0, so this is false. # Else if a=0, this is true. # # c). If a = 0 and b = 0, then no multiple of equation (1) or equation (2) would be subtracted from equation (3). # Same reason with a) and b), this is true. Because no non-zero coefficient, no elimination.