# MA 305 Spring 2K Homework 1 Solutions # > read("/afs/eos.ncsu.edu/users/k/kaltofen/www/courses/LinAlgebra/Maple/ > initlib.mpl"): > with(refpkg): > infolevel['refpkg']:=3: # Problem 1 # a. > mysolve({x-2*y-z=3, 3*x-6*y-5*z=3, 2*x-y+z=0},{x,y,z}); [1 -2 -1 3] [ ] Augmented coefficient matrix, [3 -6 -5 3] [ ] [2 -1 1 0] refpkg[ref] NoName Searching column 1 refpkg[ref] NoName Added row 1 times , -3, to row 2 refpkg[ref] NoName [1 -2 -1 3] [ ] [0 0 -2 -6] [ ] [2 -1 1 0] refpkg[ref] NoName Added row 1 times , -2, to row 3 refpkg[ref] NoName [1 -2 -1 3] [ ] [0 0 -2 -6] [ ] [0 3 3 -6] refpkg[ref] NoName Searching column 2 refpkg[ref] NoName Exchanged row 2 and 3 refpkg[ref] NoName Added row 2 times , 0, to row 3 refpkg[ref] NoName [1 -2 -1 3] [ ] [0 3 3 -6] [ ] [0 0 -2 -6] [1 -2 -1 3] [ ] REF of coeff mat = , [0 3 3 -6] [ ] [0 0 -2 -6] Solving for , z, = , 3, = , 3 Solving for , y, = , -2 - z, = , -5 Solving for , x, = , 3 + 2 y + z, = , -4 {z = 3, y = -5, x = -4} # The only solution to the system is when x = -4;, y = -5;, and z = 3;. # b. > mysolve({x+2*y-z+2*w+v=2, -x-2*y+z+4*w+3*v=6, 2*x+4*y-3*z+2*w=3, > -3*x-6*y+2*z+3*v=9},{x,y,z,w,v}); [ 1 2 2 1 -1 2] [ ] [-1 -2 4 3 1 6] Augmented coefficient matrix, [ ] [ 2 4 2 0 -3 3] [ ] [-3 -6 0 3 2 9] refpkg[ref] NoName Searching column 1 refpkg[ref] NoName Added row 1 times , 1, to row 2 refpkg[ref] NoName [ 1 2 2 1 -1 2] [ ] [ 0 0 6 4 0 8] [ ] [ 2 4 2 0 -3 3] [ ] [-3 -6 0 3 2 9] refpkg[ref] NoName Added row 1 times , -2, to row 3 refpkg[ref] NoName [ 1 2 2 1 -1 2] [ ] [ 0 0 6 4 0 8] [ ] [ 0 0 -2 -2 -1 -1] [ ] [-3 -6 0 3 2 9] refpkg[ref] NoName Added row 1 times , 3, to row 4 refpkg[ref] NoName [1 2 2 1 -1 2] [ ] [0 0 6 4 0 8] [ ] [0 0 -2 -2 -1 -1] [ ] [0 0 6 6 -1 15] refpkg[ref] NoName Searching column 2 refpkg[ref] NoName Searching column 3 refpkg[ref] NoName Added row 2 times , 1/3, to row 3 refpkg[ref] NoName [1 2 2 1 -1 2 ] [ ] [0 0 6 4 0 8 ] [ ] [0 0 0 -2/3 -1 5/3] [ ] [0 0 6 6 -1 15 ] refpkg[ref] NoName Added row 2 times , -1, to row 4 refpkg[ref] NoName [1 2 2 1 -1 2 ] [ ] [0 0 6 4 0 8 ] [ ] [0 0 0 -2/3 -1 5/3] [ ] [0 0 0 2 -1 7 ] refpkg[ref] NoName Searching column 4 refpkg[ref] NoName Added row 3 times , 3, to row 4 refpkg[ref] NoName [1 2 2 1 -1 2 ] [ ] [0 0 6 4 0 8 ] [ ] [0 0 0 -2/3 -1 5/3] [ ] [0 0 0 0 -4 12 ] [1 2 2 1 -1 2 ] [ ] [0 0 6 4 0 8 ] REF of coeff mat = , [ ] [0 0 0 -2/3 -1 5/3] [ ] [0 0 0 0 -4 12 ] Solving for , z, = , -3, = , -3 Solving for , v, = , -5/2 - 3/2 z, = , 2 Solving for , w, = , 4/3 - 2/3 v, = , 0 Free variable(s) , y Solving for , x, = , 2 - 2 y - 2 w - v + z, = , -3 - 2 y {w = 0, z = -3, v = 2, y = y, x = -3 - 2 y} # Because there is a free variable, y;, there are an infinite number of # solutions. They are all of the form # x = -3-2*y;, z = -3;, w = 0;, and v = 2;. # c. > mysolve({x+y=3, 2*x-y=0, x-2*y=-1},{x,y}); [2 -1 0] [ ] Augmented coefficient matrix, [1 -2 -1] [ ] [1 1 3] refpkg[ref] NoName Searching column 1 refpkg[ref] NoName Added row 1 times , -1/2, to row 2 refpkg[ref] NoName [2 -1 0] [ ] [0 -3/2 -1] [ ] [1 1 3] refpkg[ref] NoName Added row 1 times , -1/2, to row 3 refpkg[ref] NoName [2 -1 0] [ ] [0 -3/2 -1] [ ] [0 3/2 3] refpkg[ref] NoName Searching column 2 refpkg[ref] NoName Added row 2 times , 1, to row 3 refpkg[ref] NoName [2 -1 0] [ ] [0 -3/2 -1] [ ] [0 0 2] [2 -1 0] [ ] REF of coeff mat = , [0 -3/2 -1] [ ] [0 0 2] Found inconsistency in row , 3 {} # Because there is an inconsistency in the third row of the row echelon # form of the augmented coefficient matrix, there is no solution for the # system. # Problem 2 > mysolve({x+y+z=3,x+3*y+z=2,x+(a^2-1)*y+z=a},{x,y,z}); [1 1 1 3] [ ] Augmented coefficient matrix, [1 3 1 2] [ ] [ 2 ] [1 a - 1 1 a] refpkg[ref] NoName Searching column 1 refpkg[ref] NoName Added row 1 times , -1, to row 2 refpkg[ref] NoName [1 1 1 3 ] [ ] [0 2 0 -1] [ ] [ 2 ] [1 a - 1 1 a ] refpkg[ref] NoName Added row 1 times , -1, to row 3 refpkg[ref] NoName [1 1 1 3 ] [ ] [0 2 0 -1 ] [ ] [ 2 ] [0 -2 + a 0 -3 + a] refpkg[ref] NoName Searching column 2 refpkg[ref] NoName 2 Added row 2 times , 1 - 1/2 a , to row 3 refpkg[ref] NoName [1 1 1 3 ] [ ] [0 2 0 -1 ] [ ] [ 2 ] [0 0 0 -4 + 1/2 a + a] [1 1 1 3 ] [ ] REF of coeff mat = , [0 2 0 -1 ] [ ] [ 2 ] [0 0 0 -4 + 1/2 a + a] Found inconsistency in row , 3 {} # Looking at third row of the row echelon form of the augmented # coefficient matrix we see there is an inconsistency in the system # unless -4+1/2*a^2+a; is zero. > solve(-4+1/2*a^2+a=0,a); -4, 2 # Thus, the system has no solutions when a; is not -4 or 2. If there is # a solution, we see there is always a free variable since there is no # pivot in the third column, so there is always an infinite number of # solutions. # # Therefore, the answers are # (a) for all real a; other than -4 and 2, # (b) for no values of a;, and # (c) for a = -4; and a = 2;. # Problem 3 > mysolve({2*x-y+3*z=a, 3*x+5*y-2*z=b, x+4*y-3*z=c},{x,y,z}); [2 -1 3 a] [ ] Augmented coefficient matrix, [3 5 -2 b] [ ] [1 4 -3 c] refpkg[ref] NoName Searching column 1 refpkg[ref] NoName Added row 1 times , -3/2, to row 2 refpkg[ref] NoName [2 -1 3 a ] [ ] [0 13/2 -13/2 - 3/2 a + b] [ ] [1 4 -3 c ] refpkg[ref] NoName Added row 1 times , -1/2, to row 3 refpkg[ref] NoName [2 -1 3 a ] [ ] [0 13/2 -13/2 - 3/2 a + b] [ ] [0 9/2 -9/2 - 1/2 a + c] refpkg[ref] NoName Searching column 2 refpkg[ref] NoName -9 Added row 2 times , --, to row 3 13 refpkg[ref] NoName [2 -1 3 a ] [ ] [0 13/2 -13/2 - 3/2 a + b ] [ ] [0 0 0 7/13 a - 9/13 b + c] [2 -1 3 a ] [ ] REF of coeff mat = , [0 13/2 -13/2 - 3/2 a + b ] [ ] [0 0 0 7/13 a - 9/13 b + c] Found inconsistency in row , 3 {} # Looking at the row echelon form of the augmented coefficient matrix we # see there is an inconsistency in the third row unless 7/13*a-9/13*b+c; # is zero. Therefore, 7/13*a-9/13*b+c = 0; is an equation relating a;, # b;, and c; so that the linear system is consistent for any values of # a;, b;, and c; that satisfy that equation. # Problem 4 > with(linalg): > A:=matrix(4,5,[1,1,3,2,5,2,1,4,3,1,1,2,5,1,2,1,3,1,4,2]); Warning, new definition for norm Warning, new definition for trace [1 1 3 2 5] [ ] [2 1 4 3 1] A := [ ] [1 2 5 1 2] [ ] [1 3 1 4 2] > C:=rref(A); [1 0 0 0 -27/2] [ ] [0 1 0 0 -4 ] C := [ ] [0 0 1 0 7/2 ] [ ] [0 0 0 1 6 ] # Therefore, the matrix # C = matrix([[1, 0, 0, 0, -27/2], [0, 1, 0, 0, -4], [0, 0, 1, 0, 7/2], # [0, 0, 0, 1, 6]]); # is a matrix in reduced row echelon form that is row equivalent to A;.