Section 1.1 A := [[2, -1, 5], [3, 4, 1]]; A := [[2, -1, 5], [3, 4, 1]] B := [[1, 0, -2], [2, 3, 4]]; B := [[1, 0, -2], [2, 3, 4]] #1 4*A; [[8, -4, 20], [12, 16, 4]] #3 4*A-2*B; [[6, -4, 24], [8, 10, -4]] #5 Transpose(2*Matrix(B)); [ 2 4] [ ] [ 0 6] [ ] [ -4 8] #9 Transpose(Matrix(A)); [ 2 3] [ ] [ -1 4] [ ] [ 5 1] A := [[3, -1, 2, 4], [1, 5, -6, -2]]; A := [[3, -1, 2, 4], [1, 5, -6, -2]] B := [[-4, 0], [2, 5], [-1, -3], [0, 2]]; B := [[-4, 0], [2, 5], [-1, -3], [0, 2]] #17 A-B; Error, adding lists of different length #This is not possible because dimensions do not match #23 B-Transpose(Matrix(A)); [ -3 -1] [ ] [ 1 -5] [[-4, 0], [2, 5], [-1, -3], [0, 2]] + [ ] [ -2 6] [ ] [ -4 2] A := Matrix([[3, -2], [0, 1.6], [2*pi, 5]]); A := Matrix(3, 2, {(1, 1) = Typesetting:-mn("3"), (1, 2) = Typesetting:-mn("&uminus0;2"), (2, 1) = Typesetting:-mn("0"),\ (2, 2) = Typesetting:-mn("1.6"), (3, 1) = Typesetting:-mrow(T\ ypesetting:-mn("2"), Typesetting:-mo("⁢"), Typesetting:-mi("pi")), (3, 2) = Typesetting:-mn("5")}) #25 A(1, 2); -2 Section 1.2 #1 Matrix([[3, -2, 1], [4, 0, 2]]) . `<,>`(1, -2, 5); [12] [ ] [14] #3 Matrix([[2, -1, 3], [1, 0, -1], [0, 2, 4]]) . `<,>`(2, 1, 2); [9 ] [ ] [0 ] [ ] [10] #9 Matrix([[s, 0, 0], [0, t, 0], [0, 0, u]]) . `<,>`(a, b, c); Vector(3, {(1) = Typesetting:-mrow(Typesetting:-mi("s"), Typesetting:-mo("⁢"), Typesetting:-mi("a")), (2) = Typesetting:-mrow(Typesetting:-mi("t"), Typesetting:-mo\ ("⁢"), Typesetting:-mi("b")), (3) = Typesetting:-mrow(Typesetting:-mi("u"), Typesetting:-mo("&Inv\ isibleTimes;"), Typesetting:-mi("c"))}) #15 Matrix(Transpose(Matrix([[3, 0], [-2, 4]]))+Transpose(Matrix([[1, 2], [3, -3]]))) . `<,>`(4, 5); [21] [ ] [13] #17 Matrix([[cos((1/4)*pi), -sin((1/4)*pi)], [sin((1/4)*pi), cos((1/4)*pi)]]) . `<,>`(0, 1); Vector(2, {(1) = Typesetting:-mrow(Typesetting:-mo("&uminus0;"),\ Typesetting:-mrow(Typesetting:-mi("sin", fontstyle = "normal"), Typesetting:-mo("⁡"), Typesetting:-m\ fenced(Typesetting:-mfrac(Typesetting:-mi("pi"), Typesetting:-\ mn("4"))))), (2) = Typesetting:-mrow(Typesetting:-mi("cos", fontstyle = "normal"), Typesetting:-mo("⁡"), Typesetting:-mfenced(Typesetting:-mfrac(Typesetting:-mi("pi")\ , Typesetting:-mn("4"))))}) #19 Matrix([[cos((1/3)*pi), -sin((1/3)*pi)], [sin((1/3)*pi), cos((1/3)*pi)]]) . `<,>`(3, 1); Vector(2, {(1) = Typesetting:-mrow(Typesetting:-mrow(Typesetting\ :-mn("3"), Typesetting:-mo("⁢"), Typesetting:-m\ row(Typesetting:-mi("cos", fontstyle = "normal"), Typesetting:\ -mo("⁡"), Typesetting:-mfenced(Typesetting:-mfra\ c(Typesetting:-mi("pi"), Typesetting:-mn("3"))))), Typesetting:-mo("−"), Typesetting:-mrow(Typesetting:-mi\ ("sin", fontstyle = "normal"), Typesetting:-mo("&ApplyFunction\ ;"), Typesetting:-mfenced(Typesetting:-mfrac(Typesetting:-mi("\ pi"), Typesetting:-mn("3"))))), (2) = Typesetting:-mrow(Typese\ tting:-mrow(Typesetting:-mn("3"), Typesetting:-mo("&InvisibleT\ imes;"), Typesetting:-mrow(Typesetting:-mi("sin", fontstyle = "normal"), Typesetting:-mo("⁡"), Typesetting:-m\ fenced(Typesetting:-mfrac(Typesetting:-mi("pi"), Typesetting:-\ mn("3"))))), Typesetting:-mo("+"), Typesetting:-mrow(Type\ setting:-mi("cos", fontstyle = "normal"), Typesetting:-mo("&Ap\ plyFunction;"), Typesetting:-mfenced(Typesetting:-mfrac(Typese\ tting:-mi("pi"), Typesetting:-mn("3")))))}) #29 solve({0+x2 = 1, x1+0 = 1}, {x1, x2}); {x1 = 1, x2 = 1} #31 #Can't do because no scalar will satisfy 4s=1 and 4s=-1 #35 solve({x1+2*x2 = -1, 3*x1-x2 = 11}, {x1, x2}); {x1 = 3, x2 = -2} #37 #set x3=0 because there are 3 variables and 2 equations solve({x1+2*x2 = 3, 2*x1+3*x2 = 8}, {x1, x2}); {x1 = 7, x2 = -2} #39 #Given x1 and x2, must substitute these values into the first equation subs(x1 = 5, x2 = 5, 2*x1-x2); 5 #The original equation is 2x1-x2=3, and 5 does not equal 3. It is not possible to write u as a linear combination of S. Section 1.3 #1 with(LinearAlgebra); sys := [-x2+2*x3 = 0, x1+3*x2 = -1]; var := [x1, x2, x3]; A, b := GenerateMatrix(sys, var); [0 -1 2] [ 0 ] A, b := [ ], [ ] [1 3 0] [ -1 ] M := GenerateMatrix(sys, var, augmented = true); [0 -1 2 0 ] M := [ ] [1 3 0 -1 ] #3 with(LinearAlgebra); sys := [x1+2*x2 = 3, -x1+3*x2 = 2, -3*x1+4*x2 = 1]; var := [x1, x2, x3]; A, b := GenerateMatrix(sys, var); [1 2 0] [3] [ ] [ ] A, b := [-1 3 0], [2] [ ] [ ] [-3 4 0] [1] M := GenerateMatrix(sys, var, augmented = true); [ 1 2 0 3] [ ] M := [ -1 3 0 2] [ ] [ -3 4 0 1] with(Student[LinearAlgebra]); A := `<|>`(`<,>`(1, -2, 0), `<,>`(-1, 6, 2), `<,>`(0, 3, -4), `<,>`(2, -1, 4), `<,>`(-3, 1, 2)); [ 1 -1 0 2 -3 ] [ ] A := [ -2 6 3 -1 1 ] [ ] [ 0 2 4 4 2 ] #7 SwapRow(A, 1, 3); [ 0 2 -4 4 2 ] [ ] [ -2 6 3 -1 1 ] [ ] [ 1 -1 0 2 -3 ] #9 AddRow(A, 2, 1, 2); [1 -1 0 2 -3] [ ] [0 4 3 3 -5] [ ] [0 2 -4 4 2] #11 MultiplyRow(A, 3, 1/2); [ 1 -1 0 2 -3] [ ] [ -2 6 3 -1 1] [ ] [ 0 1 -2 2 1 ] #23 subs(x1 = 1, x2 = -2, x3 = -5, x4 = -1, [x1-4*x2+3*x4 = 6, x3-2*x4 = -3]); [6 = 6, -3 = -3] #25 subs(x1 = 3, x2 = 0, x3 = 2, x4 = 1, [x1-4*x2+3*x4 = 6, x3-2*x4 = -3]); [6 = 6, 0 = -3] #0 cannot equal -3 so this vector is not a solution #39 solve({x1-x2 = 2}, {x1, x2}); {x1 = 2 + x2, x2 = x2, x3 = x3} #41 solve({x1-2*x2 = 6}, {x1, x2}); {x1 = 6 + 2 x2, x2 = x2} #43 solve({x1-3*x2 = 0, 0*x1+0*x2 = 1}, {x1, x2}); #inconsistent #45 solve({x3 = 3, x1-2*x2 = 4}, {x1, x2, x3}); {x1 = 4 + 2 x2, x2 = x2, x3 = 3} #47 solve({x1-3*x4 = 0, x2-4*x4 = 0, x3+5*x4 = 0}, {x1, x2, x3, x4}); {x1 = 3 x4, x2 = 4 x4, x3 = -5 x4, x4 = x4} #49 solve({x2 = -3, x3 = -4, x4 = 5}, {x1, x2, x3, x4}); {x1 = x1, x2 = -3, x3 = -4, x4 = 5} #51 solve({x3+4*x4 = 7, x1+3*x2-2*x4 = 6}, {x1, x2, x3, x4}); {x1 = 6 - 3 x2 + 2 x4, x2 = x2, x3 = 7 - 4 x4, x4 = x4} #53 solve({x1-3*x2+2*x3+4*x4 = 0, 0*x1 = 1}, {x1, x2, x3, x4}) #not consistent Section 1.4 #1 solve({2*x1+6*x2 = -4}, {x1, x2}); {x1 = -2 - 3 x2, x2 = x2} #3 solve({-2*x1+3*x2 = 7, x1-2*x2 = -6}, {x1, x2}); {x1 = 4, x2 = 5} #5 solve({-4*x1+4*x2-8*x3 = -3, 2*x1-2*x2+4*x3 = 1}, {x1, x2, x3}); #not consistent #7 solve({x1-2*x2-x3 = -3, 2*x1-4*x2+2*x3 = 2}, {x1, x2, x3}); {x1 = -1 + 2 x2, x2 = x2, x3 = 2} #11 solve({-2*x1-6*x2-x3 = 5, x1+3*x2+x3+x4 = -1, x1+3*x2+2*x3+3*x4 = 2}, {x1, x2, x3, x4}); {x1 = -4 - 3 x2 + x4, x2 = x2, x3 = 3 - 2 x4, x4 = x4} #13 solve({-2*x1-4*x2-x3 = 0, x1+2*x2+x3 = 1, 3*x1+6*x2+3*x3 = 4, 5*x1+10*x2+3*x3 = 2}, {x1, x2, x3}) #not consistent #17 with(linalg); rref([[-1, 4, 3], [3, r, 2]]); [ -8 + 3 r] [1 0 - --------] [ r + 12 ] [ ] [ 11 ] [0 1 ------ ] [ r + 12 ] #r = -12 #19 rref([[1, -2, 0], [4, -8, r]]); [1 -2 0] [ ] [0 0 1] #r != 0 #23 rref([[-1, r, 2], [r, -9, 6]]); [ 6 ] [1 0 -----] [ r - 3] [ ] [ 2 ] [0 1 -----] [ r - 3] #r = 3 #27 rref([[1, r, 5], [3, 6, s]]); [ r s - 30 ] [1 0 --------- ] [ 3 (r - 2) ] [ ] [ s - 15 ] [0 1 - ---------] [ 3 (r - 2)] #a: r = 2, s != 15 #b: r != 2 #c: r = 2, s = 15 #35 rank([[1, -1, -1, 0], [2, -1, -2, 1], [1, -2, -2, 2], [-4, 2, 3, 1], [1, -1, -2, 3]]); 3 #nullity = 4-3 = 1 #37 rank([[-2, 2, 1, 1, -2], [1, -1, -1, -3, 3], [-1, 1, -1, -7, 5]]); 2 #nullity = 5-2 = 3 Section 1.6 #1 with(linalg); rref([[1, -1, 1, -1], [0, 1, 1, 4], [1, 1, 3, 7]]); [1 0 2 3] [ ] [0 1 1 4] [ ] [0 0 0 0] #yes because consistent #3 rref([[1, -1, 1, 0], [0, 1, 1, 5], [1, 1, 3, 2]]); [1 0 2 0] [ ] [0 1 1 0] [ ] [0 0 0 1] #no because inconsistent #17 r := 3; r := 3 rref([[1, -1, 2], [0, 3, 3], [-1, 2, -1]]); [1 0 3] [ ] [0 1 1] [ ] [0 0 0] #can solve through reverse engineering, because any other value for r will give an inconsistent matrix #19 r := -6; r := -6 rref([[-1, 1, 2], [2, -1, r], [2, 0, -8]]); [1 0 -4] [ ] [0 1 -2] [ ] [0 0 0] #r=-6 yields a consistent matrix #21 rank(rref([[1, -2], [-1, 2]])); 1 #no, rank does not equal 2 #23 rank(rref([[1, 3, -2], [-4, 2, 8]])); 2 #yes, rank equals 2 #25 rank(rref([[1, -1, 1], [0, 1, 2], [-2, 4, -2]])); 3 #yes, rank equals 3 #27 rank(rref([[-1, 0, 3, -5], [1, -1, -7, 7], [2, 2, 2, 6]])); 2 #no, rank does not equal 3 #29 rank(rref([[1, 0], [-2, 1]])); 2 #yes, rank equals 2 #31 rank(rref([[1, 0, -3], [-1, 0, 3]])); 1 #no, rank does not equal 2 #33 rank(rref([[1, -1], [0, 1], [-2, 2]])); 2 #no, rank does not equal 3 #39 rref([[1, -2, 0], [0, 0, 1], [-1, 2, 0]]); [1 -2 0] [ ] [0 0 1] [ ] [0 0 0] #can kick out second vector because matrix has a zero row solution := [[1, 0, -1], [0, 1, 0]]; solution := [[1, 0, -1], [0, 1, 0]] #43 rref([[-1, 0, 1], [0, 1, 2], [1, 2, 3]]); [1 0 -1] [ ] [0 1 2] [ ] [0 0 0] solution := [[-1, 0, 1], [0, 1, 2]]; solution := [[-1, 0, 1], [0, 1, 2]] Section 1.7 #1 rref([[1, 2], [3, 6]]); [1 2] [ ] [0 0] #dependent #5 rref([[0, 0, -3], [0, 2, 7], [-1, 1, 2]]); [1 0 0] [ ] [0 1 0] [ ] [0 0 1] #independent #13 rref([[1, -2], [-2, 4], [3, -6]]); [1 -2] [ ] [0 0] [ ] [0 0] solution := [[1, -2, 3]]; solution := [[1, -2, 3]] #15 rref([[-3, 1], [2, 6]]); [1 0] [ ] [0 1] solution := [[-3, 2], [1, 6]]; solution := [[-3, 2], [1, 6]] #21 rref([[-2, 0, -4], [0, 4, 1], [3, 0, 6]]); [1 0 2] [ ] [ 1] [0 1 -] [ 4] [ ] [0 0 0] solution := [[-2, 0, 3], [0, 4, 0]]; solution := [[-2, 0, 3], [0, 4, 0]] #23 rref([[1, -1, 1], [-1, 0, 2], [-2, 1, 1]]); [1 0 -2] [ ] [0 1 -3] [ ] [0 0 0] #no #25 rref([[1, 1, 1], [2, -3, 2], [0, 1, -2], [-1, -2, 3]]); [1 0 0] [ ] [0 1 0] [ ] [0 0 1] [ ] [0 0 0] #yes #29 rref([[1, -1, -1, 0], [-1, 0, 4, 1], [-1, 1, 1, -2], [2, -1, 3, 1]]); [1 0 0 0] [ ] [0 1 0 0] [ ] [0 0 1 0] [ ] [0 0 0 1] #no #33 rref([[0, 1, 4], [1, 0, 5], [1, -1, 1]]); [1 0 5] [ ] [0 1 4] [ ] [0 0 0] solve({x1 = 5*x3, x2 = 4*x3}, {x1, x2, x3}); {x1 = 5 x3, x2 = 4 x3, x3 = x3} #39 rref([[1, -3, 4], [-1, 3, r]]); [1 -3 0] [ ] [0 0 1] #41 rref([[-2, 1, -1], [0, 1, 1], [1, -3, -2]]); [1 0 1] [ ] [0 1 1] [ ] [0 0 0] #51 rref([[1, -4, 2]]); [1 -4 2] solve({x1-4*x2+2*x3 = 0}, {x1, x2, x3}); {x1 = 4 x2 - 2 x3, x2 = x2, x3 = x3} #53 rref([[1, 3, 0, 2], [0, 0, 1, -6]]); [1 3 0 2] [ ] [0 0 1 -6] solve({x3-6*x4 = 0, x1+3*x2+2*x4 = 0}, {x1, x2, x3, x4}); {x1 = -3 x2 - 2 x4, x2 = x2, x3 = 6 x4, x4 = x4} #57 rref([[-1, 0, 2, -5, 1, -1], [1, 0, -1, 3, -1, 2], [1, 0, 1, -1, 1, 4]]); [1 0 0 1 0 3] [ ] [0 0 1 -2 0 1] [ ] [0 0 0 0 1 0] solve({x5 = 0, x1+x4+3*x6 = 0, x3-2*x4+x6 = 0}, {x1, x2, x3, x4, x5, x6}); {x1 = -x4 - 3 x6, x2 = x2, x3 = 2 x4 - x6, x4 = x4, x5 = 0, x6 = x6} Section 2.1 A := [[1, -2], [3, 4]]; A := [[1, -2], [3, 4]] B := [[7, 4], [1, 2]]; B := [[7, 4], [1, 2]] C := [[3, 8, 1], [2, 0, 4]]; C := [[3, 8, 1], [2, 0, 4]] x := [[2], [3]]; x := [[2], [3]] y := [[1], [3], [-5]]; y := [[1], [3], [-5]] z := [[7, -1]]; z := [[7, -1]] #5 with(linalg); multiply(C, y); [ 22] [ ] [-18] #7 multiply(x, z); [14 -2] [ ] [21 -3] #9 multiply(A, C, x); Error, (in linalg:-multiply) non matching dimensions for vector/matrix product #11 multiply(A, B); [ 5 0] [ ] [25 20] #13 multiply(B, C); [29 56 23] [ ] [ 7 8 9] #15 multiply(C, Transpose(Matrix(B))); Error, (in linalg:-multiply) non matching dimensions for vector/matrix product #17 evalm(A^3); [-35 -30] [ ] [ 45 10] #19 evalm(C^2); Error, (in linalg:-multiply) non matching dimensions for vector/matrix product #23 M := multiply(A, B); [ 5 0] M := [ ] [25 20] with(LinearAlgebra); Transpose(Matrix(M)); [5 25] [ ] [0 20] multiply(Transpose(Matrix(B)), Transpose(Matrix(A))); [5 25] [ ] [0 20] A := [[1, 2, 3], [2, -1, 4], [-3, -2, 0]]; A := [[1, 2, 3], [2, -1, 4], [-3, -2, 0]] B := [[-1, 0], [4, 1], [3, -2]]; B := [[-1, 0], [4, 1], [3, -2]] C := [[2, 1, -1], [4, 3, -2]]; C := [[2, 1, -1], [4, 3, -2]] #25 evalm(multiply(A, B))[3, 2]; -2 #27 evalm(multiply(C, A))[2, 3]; 24 #29 Column(multiply(A, B), 2); [-4] [ ] [-9] [ ] [-2] #31 Column(multiply(C, A), 1); [7 ] [ ] [16] Section 2.3 #1 A := [[1, 2], [1, -1]]; A := [[1, 2], [1, -1]] B := [[1, 1/2], [1, -1]]; [[ 1] ] B := [[1, -], [1, -1]] [[ 2] ] multiply(A, B); [ -3] [3 --] [ 2 ] [ ] [ 3] [0 -] [ 2] multiply(B, A); [3 3] [- -] [2 2] [ ] [0 3] #no #3 A := [[1, 2, 1], [1, 1, 2], [2, 3, 4]]; A := [[1, 2, 1], [1, 1, 2], [2, 3, 4]] B := [[2, 5, -3], [0, -2, 1], [-1, -1, 1]]; B := [[2, 5, -3], [0, -2, 1], [-1, -1, 1]] multiply(A, B); [1 0 0] [ ] [0 1 0] [ ] [0 0 1] multiply(B, A); [1 0 0] [ ] [0 1 0] [ ] [0 0 1] #yes #9 Transpose(Matrix(Ainv)); [1 2 1 ] [ ] [2 0 1 ] [ ] [3 1 &uminus0;1] #11 multiply(Binv, Ainv); [3 7 2] [ ] [4 4 -4] [ ] [0 7 6] #13 M := Transpose(Matrix(Binv)); [ 2 0 3 ] [ ] M := [&uminus0;1 0 &uminus0;2] [ ] [ 3 4 1 ] multiply(M, Ainv); [ 5 7 3] [ ] [-3 -4 -1] [ ] [12 7 12] #17 with(Student[LinearAlgebra]); AddRow(IdentityMatrix(3), 2, 1, 2); [1 0 0] [ ] [2 1 0] [ ] [0 0 1] #19 MultiplyRow(IdentityMatrix(4), 2, 1/4); [1 0 0 0] [ ] [ 1 ] [0 - 0 0] [ 4 ] [ ] [0 0 1 0] [ ] [0 0 0 1] #23 MultiplyRow(IdentityMatrix(2), 1, -1); [ -1 0] [ ] [ 0 1] #25 SwapRow(IdentityMatrix(2), 1, 2); [0 1] [ ] [1 0] #29 AddRow(IdentityMatrix(3), 3, 2, -5); [1 0 0] [ ] [0 1 0] [ ] [0 &uminus0;5 1] #31 SwapRow(IdentityMatrix(3), 2, 3); [1 0 0] [ ] [0 0 1] [ ] [0 1 0] Section 2.4 with(linalg): #1 inverse(matrix([[1, 3], [1, 2]])); [-2 3] [ ] [ 1 -1] #3 inverse(matrix([[1, -3], [-2, 6]])); Error, (in linalg:-inverse) singular matrix #not invertible #7 inverse(matrix([[1, -2, 1], [1, 0, 1], [1, -1, 1]])); Error, (in linalg:-inverse) singular matrix #9 inverse(matrix([[1, 1, 2], [2, -1, 1], [2, 3, 4]])); [-7 2 ] [-- - 1] [3 3 ] [ ] [-2 0 1] [ ] [ 8 -1 ] [ - -- -1] [ 3 3 ] #19 multiply(inverse(matrix([[1, 2], [2, 3]])), [[1, -1, 2], [1, 0, 1]]); [-1 3 -4] [ ] [ 1 -2 3] #27 rref([[1, -1, 2, 1, 0], [-2, 1, -1, 0, 1]]); [1 0 -1 -1 -1] [ ] [0 1 -3 -2 -1] P := matrix([[-1, -1], [-2, -1]]); [-1 -1] P := [ ] [-2 -1] #29 rref([[-1, 0, 2, 1, 1, 0, 0], [0, 1, 1, -1, 0, 1, 0], [2, 3, -1, -5, 0, 0, 1]]); [ -3 1] [1 0 -2 -1 0 -- -] [ 2 2] [ ] [0 1 1 -1 0 1 0] [ ] [ -3 1] [0 0 0 0 1 -- -] [ 2 2] with(LinearAlgebra); P := ScalarMultiply(Matrix([[0, -3/2, 1/2], [0, 1, 0], [1, -3/2, 1/2]]), 2); [0 -3 1] [ ] P := [0 2 0] [ ] [2 -3 1] Section 2.5 #1 multiply([[-1, 3, 1]], [[1], [-1], [0]]); A := [-4] multiply([[-1, 3, 1]], [[2], [1], [1]]); B := [2] M := matrix([[-4, 2]]); M := [-4 2] #3 A := multiply([[1], [0]], [[1]]); [1] A := [ ] [0] B := multiply([[-1], [1]], [[3]]); [-3] B := [ ] [ 3] C := multiply([[0], [2]], [[2]]); [0] C := [ ] [4] evalm(A+B+C); [-2] [ ] [ 7] #5 A := [[2, 0], [3, 1]]; A := [[2, 0], [3, 1]] B := [[-1, 5], [1, 2]]; B := [[-1, 5], [1, 2]] C := [[-1, 2], [2, 2]]; C := [[-1, 2], [2, 2]] E := [[3, 0], [-1, 2]]; E := [[3, 0], [-1, 2]] multiply(A, C); [-2 4] [ ] [-1 8] multiply(A, E); [6 0] [ ] [8 2] multiply(B, C); [11 8] [ ] [ 3 6] multiply(B, E); [-8 10] [ ] [ 1 4] solution := matrix([[-2, 4, 6, 0], [-1, 8, 8, 2], [11, 8, -8, 10], [3, 6, 1, 4]]); [-2 4 6 0] [ ] [-1 8 8 2] solution := [ ] [11 8 -8 10] [ ] [ 3 6 1 4] #7 A := [[2, 0]]; A := [[2, 0]] B := [[3, 1], [-1, 5], [1, 2]]; B := [[3, 1], [-1, 5], [1, 2]] C := [[-1], [2]]; C := [[-1], [2]] E := [[2, 3, 0], [2, -1, 2]]; E := [[2, 3, 0], [2, -1, 2]] multiply(A, C); [-2] multiply(A, E); [4 6 0] multiply(B, C); [-1] [ ] [11] [ ] [ 3] multiply(B, E); [8 8 2] [ ] [8 -8 10] [ ] [6 1 4] solution := matrix([[-2, 4, 6, 0], [-1, 8, 8, 2], [11, 8, -8, 10], [3, 6, 1, 4]]); [-2 4 6 0] [ ] [-1 8 8 2] solution := [ ] [11 8 -8 10] [ ] [ 3 6 1 4] #9 A := [[3, 0], [0, 3]]; A := [[3, 0], [0, 3]] B := [[2, 0], [0, 2]]; B := [[2, 0], [0, 2]] C := [[1, 2], [3, 4]]; C := [[1, 2], [3, 4]] multiply(A, C); [3 6] [ ] [9 12] multiply(B, C); [2 4] [ ] [6 8] solution := matrix([[3, 6], [9, 12], [2, 4], [6, 8]]); [3 6] [ ] [9 12] solution := [ ] [2 4] [ ] [6 8] #11 A := [[1, 1]]; A := [[1, 1]] B := [[2, 1]]; B := [[2, 1]] C := IdentityMatrix(2); [1 0] C := [ ] [0 1] E := ZeroMatrix(2); [0 0] E := [ ] [0 0] F := IdentityMatrix(2); [1 0] F := [ ] [0 1] G := [[1, -1], [-1, 1]]; G := [[1, -1], [-1, 1]] H := ZeroMatrix(2); [0 0] H := [ ] [0 0] J := IdentityMatrix(2); [1 0] J := [ ] [0 1] evalm(multiply(A, F)+multiply(B, H)); [1 1] evalm(multiply(A, G)+multiply(B, J)); [2 1] evalm(multiply(C, F)+multiply(E, H)); [1 0] [ ] [0 1] evalm(multiply(C, G)+multiply(E, J)); [ 1 -1] [ ] [-1 1] solution := matrix([[1, 1, 2, 1], [1, 0, 1, -1], [0, 1, -1, 1]]); [1 1 2 1] [ ] solution := [1 0 1 -1] [ ] [0 1 -1 1] A := [[1, 2, 3], [2, -1, 4], [-3, -2, 0]]; A := [[1, 2, 3], [2, -1, 4], [-3, -2, 0]] B := [[-1, 0], [4, 1], [3, -2]]; B := [[-1, 0], [4, 1], [3, -2]] C := [[2, 1, -1], [4, 3, -2]]; C := [[2, 1, -1], [4, 3, -2]] #13 Row(multiply(A, B), 1); [16, -4] #19 Row(evalm(A^2), 2); [-12, -3, 2] #23 evalm(multiply([[2], [4]], [[-1, 0]])+multiply([[1], [3]], [[4, 1]])+multiply([[-1], [-2]], [[3, -2]])); [-1 3] [ ] [ 2 7] Section 2.6 #1 LUDecomposition(Matrix([[2, 3, 4], [6, 8, 10], [-2, -4, -3]])); [1 0 0] [ 1 0 0] [2 3 4 ] [ ] [ ] [ ] [0 1 0], [ 3 1 0], [0 -1 -2 ] [ ] [ ] [ ] [0 0 1] [ -1 1 1] [0 0 3 ] #3 LUDecomposition(Matrix([[1, -1, 2, 1], [2, -3, 5, 4], [-3, 2, -4, 0]])); [1 0 0] [ 1 0 0] [1 -1 2 1] [ ] [ ] [ ] [0 1 0], [ 2 1 0], [0 -1 1 2] [ ] [ ] [ ] [0 0 1] [ -3 1 1] [0 0 1 1] #5 LUDecomposition(Matrix([[1, -1, 2, 1, 3], [-1, 2, 0, -2, -2], [2, -1, 7, -1, 1]])); [1 0 0] [ 1 0 0] [ ] [ ] [0 1 0], [ -1 1 0], [ ] [ ] [0 0 1] [ 2 1 1] [1 -1 2 1 3 ] [ ] [0 1 2 -1 1 ] [ ] [0 0 1 -2 -6 ] #9 solve({y1 = 1, 3*y1+y2 = 4, -y1+y2+y3 = 0}, {y1, y2, y3}); {y1 = 1, y2 = 1, y3 = 0} solve({3*x3 = 0, -x2-2*x3 = 1, 2*x1+3*x2+4*x3 = 1}, {x1, x2, x3}); {x1 = 2, x2 = -1, x3 = 0} #11 solve({y1 = 1, 2*y1+y2 = 8, -3*y1+y2+y3 = 5}, {y1, y2, y3}); {y1 = 1, y2 = 6, y3 = 2} solve({x3+x4 = 2, -x2+x3+2*x4 = 6, x1-x2+2*x3+x4 = 1}, {x1, x2, x3, x4}); {x1 = -7 + 2 x4, x2 = -4 + x4, x3 = 2 - x4, x4 = x4} #13 solve({y1 = -4, -y1+y2 = 9, 2*y1+y2+y3 = -2}, {y1, y2, y3}); {y1 = -4, y2 = 5, y3 = 1} solve({x3-2*x4-6*x5 = 1, x2+2*x3-x4+x5 = 5, x1-x2+2*x3+x4+3*x5 = -4}, {x1, x2, x3, x4, x5}); {x1 = -3 - 8 x4 - 28 x5, x2 = 3 - 3 x4 - 13 x5, x3 = 1 + 2 x4 + 6 x5, x4 = x4, x5 = x5} Section 3.1 #1 det([[6, 2], [-3, -1]]); 0 #3 det([[-2, 9], [1, 8]]); -25 #9 (-1)^(1+2)*det([[-1, 3], [7, -5]]); 16 #11 (-1)^(3+1)*det([[-2, 4], [6, 3]]); -30 #13 det([[2, -1, 3], [1, 4, -2], [-1, 0, 1]]); 19 #15 det([[1, -2, 2], [2, -1, 3], [0, 1, -1]]); -2 #21 5*det([[4, -1], [0, 3]]); 60 #used cofactor expansion because too lazy to type out entire matrix #23 -6*det([[-3, 2], [9, 4]]); 180 #27 4*det([[-2, -1, -5], [0, -2, 0], [3, 1, 6]]); -24 #29 det([[3, -2], [5, 7]]); 31 #31 det([[6, 3], [4, 2]]); 0 #37 det([[3, 6], [c, 4]]); -6 c + 12 solve({-6*c+12 = 0}, {c}); {c = 2} Section 3.2 #5 det([[1, 3, 2], [2, 2, 3], [3, 1, 1]]); 12 #7 -det([[2, 0], [-1, 1]]); -2 #11 5*det([[0, 3], [4, -1]]); -60 #13 det([[1, -2, 2], [0, 5, -1], [2, -4, 1]]); -15 #17 det([[1, 4, 2], [2, -1, 3], [-1, 3, 1]]); -20 #21 det([[1, -1, 2, 1], [2, -1, -1, 4], [-4, 5, -10, -6], [3, -2, 10, -1]]); 18 #27 det([[c, 6], [2, c+4]]); 2 c + 4 c - 12 solve({c^2+4*c-12 = 0}, {c}); {c = 2}, {c = -6} #33 det([[1, 2, -1], [2, 3, c], [0, c, -15]]); 2 -c - 2 c + 15 solve({-c^2-2*c+15 = 0}, {c}); {c = -5}, {c = 3} Section 4.1 #1-9 N/A #11 subs(x1 = 1, x2 = 1, x3 = -1, x4 = -1, x1-2*x2-x3); 0 subs(x1 = 1, x2 = 1, x3 = -1, x4 = -1, x2+3*x3-2*x4); 0 subs(x1 = 1, x2 = 1, x3 = -1, x4 = -1, -2*x1+3*x2-x3+2*x4); #belongs #13 subs(x1 = -1, x2 = 2, x3 = -2, x4 = -2, x4 = -1, x1-2*x2-x3); -3 #does not belong #19 rref([[1, -2, -1, 0, 2], [0, 1, 3, -2, -1], [-2, 3, -1, 2, 3]]); [1 0 5 -4 0] [ ] [0 1 3 -2 0] [ ] [0 0 0 0 1] #does not belong because inconsistent #21 rref([[1, -2, -1, 0, 1], [0, 1, 3, -2, -4], [-2, 3, -1, 2, 2]]); [1 0 5 -4 -7] [ ] [0 1 3 -2 -4] [ ] [0 0 0 0 0] #belongs because consistent #27 rref([[-1, 1, 2], [1, -2, 3]]); [1 0 -7] [ ] [0 1 -5] solve({x1-7*x3 = 0, x2-5*x3 = 0}, {x1, x2, x3}); {x1 = 7 x3, x2 = 5 x3, x3 = x3} genset := {matrix([[7], [5], [1]])}; /[7]\ |[ ]| genset := < [5] > |[ ]| \[1]/ #29 rref([[1, 1, -1, 4], [2, 1, -3, 5], [-2, 0, 4, -2]]); [1 0 -2 1] [ ] [0 1 1 3] [ ] [0 0 0 0] solve({x1-2*x3+x4 = 0, x2+x3+3*x4 = 0}, {x1, x2, x3, x4}); {x1 = 2 x3 - x4, x2 = -x3 - 3 x4, x3 = x3, x4 = x4} genset := {matrix([[-1], [-3], [0], [1]]), matrix([[2], [-1], [1], [0]])}; /[-1] [ 2]\ |[ ] [ ]| |[-3] [-1]| genset := < [ ], [ ] > |[ 0] [ 1]| |[ ] [ ]| \[ 1] [ 0]/ #33 rref([[1, -3, 0, 1, -2, -2], [2, -6, -1, 0, 2, 5], [-1, 3, 2, 3, -1, 2]]); [1 -3 0 1 0 2] [ ] [0 0 1 2 0 3] [ ] [0 0 0 0 1 2] solve({x5+2*x6 = 0, x3+2*x4+3*x6 = 0, x1-3*x2+x4+x6 = 0}, {x1, x2, x3, x4, x5, x6}); {x1 = 3 x2 - x4 - x6, x2 = x2, x3 = -2 x4 - 3 x6, x4 = x4, x5 = -2 x6, x6 = x6} genset := {matrix([[-2], [0], [-3], [0], [-2], [1]]), matrix([[-1], [0], [-2], [1], [0], [0]]), matrix([[3], [1], [0], [0], [0], [0]])}; /[-2] [-1] [3]\ |[ ] [ ] [ ]| |[ 0] [ 0] [1]| |[ ] [ ] [ ]| |[-3] [-2] [0]| genset := < [ ], [ ], [ ] > |[ 0] [ 1] [0]| |[ ] [ ] [ ]| |[-2] [ 0] [0]| |[ ] [ ] [ ]| \[ 1] [ 0] [0]/ Section 4.2 #1 rref([[1, -3, 4, -2], [-1, 3, -4, 2]]); [1 -3 4 -2] [ ] [0 0 0 0] nullspace([[1, -3, 4, -2], [-1, 3, -4, 2]]); {[-4, 0, 1, 0], [2, 0, 0, 1], [3, 1, 0, 0]} #3 rref([[1, 2, 4], [-1, -1, -1], [-1, 0, 2]]); [1 0 -2] [ ] [0 1 3] [ ] [0 0 0] nullspace([[1, 2, 4], [-1, -1, -1], [-1, 0, 2]]); {[2, -3, 1]} #5 rref([[1, -2, 0, 2], [-1, 2, 1, -3], [2, -4, 3, 1]]); [1 -2 0 2] [ ] [0 0 1 -1] [ ] [0 0 0 0] nullspace([[1, -2, 0, 2], [-1, 2, 1, -3], [2, -4, 3, 1]]); {[-2, 0, 1, 1], [2, 1, 0, 0]} #7 rref([[-1, 1, 2, 2], [2, 0, -5, 3], [1, -1, -1, -1], [0, 1, -2, 2]]); [1 0 0 4] [ ] [0 1 0 4] [ ] [0 0 1 1] [ ] [0 0 0 0] nullspace([[-1, 1, 2, 2], [2, 0, -5, 3], [1, -1, -1, -1], [0, 1, -2, 2]]); {[-4, -4, -1, 1]} #17-21 N/A #25 rref([[1, 2, 1], [2, 1, -4], [1, 3, 3]]); [1 0 -3] [ ] [0 1 2] [ ] [0 0 0] solution := {matrix([[1], [2], [1]]), matrix([[2], [1], [3]])}; /[1] [2]\ |[ ] [ ]| solution := < [2], [1] > |[ ] [ ]| \[1] [3]/ #27 rref([[1, 0, 2, 1, 4], [-1, -1, 3, -2, -7], [3, 1, 1, 0, -9]]); [1 0 2 0 -2] [ ] [0 1 -5 0 -3] [ ] [0 0 0 1 6] solution := {matrix([[0], [-1], [1]]), matrix([[1], [-2], [0]]), matrix([[1], [-1], [3]])}; /[ 0] [ 1] [ 1]\ |[ ] [ ] [ ]| solution := < [-1], [-2], [-1] > |[ ] [ ] [ ]| \[ 1] [ 0] [ 3]/ Section 4.3 #1 A := [[1, -3, 0, 2], [0, 0, 1, -4], [0, 0, 0, 0]]; A := [[1, -3, 0, 2], [0, 0, 1, -4], [0, 0, 0, 0]] ColAndRowSpaceDim := rank(A); ColAndRowSpaceDim := 2 NullSpaceDim := 4-rank(A); NullSpaceDim := 2 NullTransposeDim := 3-rank(A); NullTransposeDim := 1 #3 A := [[1, -1, 0, 2, 0], [0, 0, 1, 6, 0], [0, 0, 0, 0, 1]]; A := [[1, -1, 0, 2, 0], [0, 0, 1, 6, 0], [0, 0, 0, 0, 1]] ColAndRowSpaceDim := rank(A); ColAndRowSpaceDim := 3 NullSpaceDim := 5-rank(A); NullSpaceDim := 2 NullTransposeDim := 3-rank(A); NullTransposeDim := 2 #5 A := [[2, -8, -4, 6]]; A := [[2, -8, -4, 6]] ColAndRowSpaceDim := rank(A); ColAndRowSpaceDim := 1 NullSpaceDim := 4-rank(A); NullSpaceDim := 3 NullTransposeDim := 1-rank(A); NullTransposeDim := 0 #7 A := [[1, -1, 2], [2, -3, 1]]; A := [[1, -1, 2], [2, -3, 1]] ColAndRowSpaceDim := rank(A); ColAndRowSpaceDim := 2 NullSpaceDim := 3-rank(A); NullSpaceDim := 1 NullTransposeDim := 2-rank(A); NullTransposeDim := 0 #9 A := [[1, 1, 2, 1], [-1, -2, 2, -2], [2, 3, 0, 3]]; A := [[1, 1, 2, 1], [-1, -2, 2, -2], [2, 3, 0, 3]] ColAndRowSpaceDim := rank(A); ColAndRowSpaceDim := 2 NullSpaceDim := 4-rank(A); NullSpaceDim := 2 NullTransposeDim := 3-rank(A); NullTransposeDim := 1 #11 ColAndRowSpaceDim := rank(A); ColAndRowSpaceDim := 2 NullSpaceDim := 3-rank(A); NullSpaceDim := 1 NullTransposeDim := 4-rank(A); NullTransposeDim := 2 #15 N/A #17 with(LinearAlgebra); A := [[1, -1, 1], [0, 1, 2]]; A := [[1, -1, 1], [0, 1, 2]] RowSpace(A); [[1, 0, 3], [0, 1, 2]] #19 A := [[-1, 1, 1, -2], [2, -2, -2, 4], [2, -1, -1, 3]]; A := [[-1, 1, 1, -2], [2, -2, -2, 4], [2, -1, -1, 3]] RowSpace(A); [[1, 0, 0, 1], [0, 1, 1, -1]] #25,27 N/A Section 5.1 #1 multiply([[-10, -8], [24, 18]], [[1], [-2]]); [ 6] [ ] [-12] #3 multiply([[-5, -4], [8, 7]], [[1], [-2]]); [ 3] [ ] [-6] #7 multiply([[4, 6, -5], [9, 7, -11], [8, 8, -11]], [[-1], [2], [1]]); [ 3] [ ] [-6] [ ] [-3] #9 multiply([[2, -6, 6], [1, 9, -6], [-2, 16, -13]], [[-1], [1], [2]]); [ 4] [ ] [-4] [ ] [-8] #13 with(LinearAlgebra); evalm([[10, 7], [-14, -11]]-3*IdentityMatrix(2)); [ 7 7] [ ] [-14 -14] NullSpace([[1, 1], [0, 0]]); /[ -1 ]\ { [ ] } \[ 1 ]/ #17 evalm([[-2, -5, 2], [4, 7, -2], [-3, -3, 5]]-3*IdentityMatrix(3)); [-5 -5 2] [ ] [ 4 4 -2] [ ] [-3 -3 2] NullSpace([[-5, -5, 2], [4, 4, -2], [-3, -3, 2]]); /[ -1 ]\ |[ ]| < [ 1 ] > |[ ]| \[ 0 ]/ #23 evalm([[4, -3, -3], [-3, 4, 3], [3, -3, -2]]-IdentityMatrix(3)); [ 3 -3 -3] [ ] [-3 3 3] [ ] [ 3 -3 -3] NullSpace([[3, -3, -3], [-3, 3, 3], [3, -3, -3]]); /[1] [1]\ |[ ] [ ]| < [0], [1] > |[ ] [ ]| \[1] [0]/ Section 5.2 #1 with(linalg); A := [[3, -3], [2, 8]]; A := [[3, -3], [2, 8]] eigenvectors(A); [ /[-3 ]\ ] [5, 1, { [--, 1] }], [6, 1, {[-1, 1]}] [ \[2 ]/ ] #5 A := [[6, -5, -4], [5, -3, -5], [4, -5, -2]]; A := [[6, -5, -4], [5, -3, -5], [4, -5, -2]] eigenvectors(A); [2, 2, {[1, 0, 1]}], [-3, 1, {[1, 1, 1]}] #9 A := [[0, 2, 1], [1, -1, -1], [4, 4, -3]]; A := [[0, 2, 1], [1, -1, -1], [4, 4, -3]] eigenvectors(A); [-3, 1, {[-1, 1, 1]}], [1, 1, {[1, 0, 1]}], [-2, 1, {[-1, 1, 0]}] #11 A := [[-1, 4, -4, -4], [5, -2, 1, 6], [0, 0, -1, 0], [5, -5, 5, 9]]; A := [[-1, 4, -4, -4], [5, -2, 1, 6], [0, 0, -1, 0], [5, -5, 5, 9]] eigenvectors(A); [4, 1, {[0, 1, 0, 1]}], [3, 1, {[1, 1, 0, 0]}], [-1, 2, {[-1, 1, 0, 1], [0, 1, 1, 0]}] #13 A := [[1, 3], [0, -4]]; A := [[1, 3], [0, -4]] eigenvalues(A); 1, -4 eigenvectors(A); [ /[ -5]\ ] [-4, 1, { [1, --] }], [1, 1, {[1, 0]}] [ \[ 3 ]/ ] #15 A := [[-3, -4], [12, 11]]; A := [[-3, -4], [12, 11]] eigenvalues(A); 5, 3 eigenvectors(A); [ /[ -3]\ ] [3, 1, { [1, --] }], [5, 1, {[1, -2]}] [ \[ 2 ]/ ] #17 A := [[-7, 5, 4], [0, -3, 0], [-8, 9, 5]]; A := [[-7, 5, 4], [0, -3, 0], [-8, 9, 5]] eigenvalues(A); 1, -3, -3 eigenvectors(A); #19 A := [[-1, 0, 0], [2, 5, 0], [1, -2, -1]]; A := [[-1, 0, 0], [2, 5, 0], [1, -2, -1]] eigenvalues(A); -1, -1, 5 eigenvectors(A); [5, 1, {[0, -3, 1]}], [-1, 2, {[0, 0, 1]}] #21 A := [[-4, 0, 2], [2, 4, -8], [2, 0, -4]]; A := [[-4, 0, 2], [2, 4, -8], [2, 0, -4]] eigenvalues(A); 4, -6, -2 eigenvectors(A); [4, 1, {[0, 1, 0]}], [-2, 1, {[1, 1, 1]}], [-6, 1, {[-1, 1, 1]}] #23 A := [[-1, -2, -1, 4], [0, 1, 2, 0], [0, 0, -2, -1], [0, 0, 0, 2]]; A := [[-1, -2, -1, 4], [0, 1, 2, 0], [0, 0, -2, -1], [0, 0, 0, 2]] eigenvalues(A); -1, 1, -2, 2 eigenvectors(A); [1, 1, {[-1, 1, 0, 0]}], [-2, 1, {[1, 2, -3, 0]}], [2, 1, {[-7, 2, 1, -4]}], [-1, 1, {[1, 0, 0, 0]}] Section 5.3 #1 A := [[7, 6], [-1, 2]]; A := [[7, 6], [-1, 2]] eigenvalues(A); 5, 4 eigenvectors(A); [4, 1, {[-2, 1]}], [5, 1, {[-3, 1]}] P := [[-2, -3], [1, 1]]; P := [[-2, -3], [1, 1]] d := [[4, 0], [0, 5]]; d := [[4, 0], [0, 5]] #I'm using lowercase 'd' because uppercase 'D' is a protected variable #3 A := [[8, 9], [-4, -4]]; A := [[8, 9], [-4, -4]] eigenvalues(A); 2, 2 eigenvectors(A); [ /[-3 ]\ ] [2, 2, { [--, 1] }] [ \[2 ]/ ] #cannot be diagonalized because eigenspace has a dimension of 1 #5 A := [[3, 2, -2], [-8, 0, -5], [-8, -2, -3]]; A := [[3, 2, -2], [-8, 0, -5], [-8, -2, -3]] eigenvalues(A); 3, 2, -5 eigenvectors(A); [ /[ 3 ]\ ] [2, 1, { [-1, -, 1] }], [3, 1, {[-1, 1, 1]}], [-5, 1, {[0, 1, 1]}] [ \[ 2 ]/ ] P := [[-1, -1, 0], [3/2, 1, 1], [1, 1, 1]]; [ [3 ] ] P := [[-1, -1, 0], [-, 1, 1], [1, 1, 1]] [ [2 ] ] d := [[2, 0, 0], [0, 3, 0], [0, 0, -5]]; d := [[2, 0, 0], [0, 3, 0], [0, 0, -5]] #7 A := [[3, -5, 6], [1, 3, -6], [0, 3, -5]]; A := [[3, -5, 6], [1, 3, -6], [0, 3, -5]] eigenvalues(A); (1/2) (1/2) 1, I 2 , -I 2 #cannot diagonalize #11 A := [[-1, 0, 0, 0], [0, -1, 0, 0], [5, 5, 4, -5], [0, 0, 0, -1]]; A := [[-1, 0, 0, 0], [0, -1, 0, 0], [5, 5, 4, -5], [0, 0, 0, -1]] eigenvalues(A); -1, -1, -1, 4 eigenvectors(A); [-1, 3, {[-1, 0, 1, 0], [-1, 1, 0, 0], [1, 0, 0, 1]}], [4, 1, {[0, 0, 1, 0]}] P := [[-1, -1, 1, 0], [0, 1, 0, 0], [1, 0, 0, 1], [0, 0, 1, 0]]; P := [[-1, -1, 1, 0], [0, 1, 0, 0], [1, 0, 0, 1], [0, 0, 1, 0]] d := [[-1, 0, 0, 0], [0, -1, 0, 0], [0, 0, -1, 0], [0, 0, 0, 4]]; d := [[-1, 0, 0, 0], [0, -1, 0, 0], [0, 0, -1, 0], [0, 0, 0, 4]] #15 A := [[6, 6], [-2, -1]]; A := [[6, 6], [-2, -1]] eigenvalues(A); 3, 2 eigenvectors(A); [ /[-3 ]\ ] [2, 1, { [--, 1] }], [3, 1, {[-2, 1]}] [ \[2 ]/ ] P := [[-3/2, -2], [1, 1]]; [[-3 ] ] P := [[--, -2], [1, 1]] [[2 ] ] d := [[2, 0], [0, 3]]; d := [[2, 0], [0, 3]] #17 A := [[-1, 2, -1], [0, -3, 1], [0, 0, 2]]; A := [[-1, 2, -1], [0, -3, 1], [0, 0, 2]] eigenvalues(A); -1, -3, 2 eigenvectors(A); [2, 1, {[-1, 1, 5]}], [-3, 1, {[-1, 1, 0]}], [-1, 1, {[1, 0, 0]}] P := [[-1, -1, 1], [1, 1, 0], [5, 0, 0]]; P := [[-1, -1, 1], [1, 1, 0], [5, 0, 0]] d := [[2, 0, 0], [0, -3, 0], [0, 0, -1]]; d := [[2, 0, 0], [0, -3, 0], [0, 0, -1]] #19 A := [[0, 0, 0], [1, 1, 0], [0, -1, 0]]; A := [[0, 0, 0], [1, 1, 0], [0, -1, 0]] eigenvalues(A); 0, 0, 1 eigenvectors(A); [1, 1, {[0, -1, 1]}], [0, 2, {[0, 0, 1]}] #this cannot be done because it has a 1-dimensional eigenspace Section 6.1 with(LinearAlgebra); #3 u := [[1], [-1]]; u := [[1], [-1]] v := [[2], [1]]; v := [[2], [1]] VectorNorm(Matrix(u), 2); (1/2) 2 VectorNorm(Matrix(v), 2); (1/2) 5 w := u-v; w := [[-1], [-2]] VectorNorm(Matrix(w), 2); (1/2) 5 #5 u := [[1], [-1], [3]]; u := [[1], [-1], [3]] v := [[2], [1], [0]]; v := [[2], [1], [0]] VectorNorm(Matrix(u), 2); (1/2) 11 VectorNorm(Matrix(v), 2); (1/2) 5 w := u-v; w := [[-1], [-2], [3]] VectorNorm(Matrix(w), 2); (1/2) 14 #7 u := [[1], [-1], [-2], [1]]; u := [[1], [-1], [-2], [1]] v := [[2], [3], [1], [1]]; v := [[2], [3], [1], [1]] VectorNorm(Matrix(u), 2); (1/2) 7 VectorNorm(Matrix(v), 2); (1/2) 15 w := u-v; w := [[-1], [-4], [-3], [0]] VectorNorm(Matrix(w), 2); (1/2) 26 #9 u := [[3], [-2]]; u := [[3], [-2]] v := [[4], [6]]; v := [[4], [6]] DotProduct(Matrix(u), Matrix(v)); 0 #11 u := [[1], [-1]]; u := [[1], [-1]] v := [[2], [1]]; v := [[2], [1]] DotProduct(Matrix(u), Matrix(v)); 1 #13 u := [[1], [-2], [3]]; u := [[1], [-2], [3]] v := [[2], [1], [0]]; v := [[2], [1], [0]] DotProduct(Matrix(u), Matrix(v)); 0 #15 u := [[1], [-1], [-2], [1]]; u := [[1], [-1], [-2], [1]] v := [[2], [3], [1], [1]]; v := [[2], [3], [1], [1]] DotProduct(Matrix(u), Matrix(v)); -2 #17 u := [[-2], [4]]; u := [[-2], [4]] v := [[6], [3]]; v := [[6], [3]] VectorNorm(Matrix(u), 2)^2; 20 VectorNorm(Matrix(v), 2)^2; 45 w := u+v; w := [[4], [7]] VectorNorm(Matrix(w), 2)^2; 65 #25 u := [[3], [2]]; u := [[3], [2]] v := [[-6], [-4]]; v := [[-6], [-4]] VectorNorm(Matrix(u), 2); (1/2) 13 VectorNorm(Matrix(v), 2); (1/2) 2 13 w := u+v; w := [[-3], [-2]] VectorNorm(Matrix(w), 2); (1/2) 13 #29 u := [[1], [-4], [2]]; u := [[1], [-4], [2]] v := [[3], [1], [1]]; v := [[3], [1], [1]] VectorNorm(Matrix(u), 2); (1/2) 21 VectorNorm(Matrix(v), 2); (1/2) 11 w := u+v; w := [[4], [-3], [3]] VectorNorm(Matrix(w), 2); (1/2) 34 #33 u := [[-2], [3]]; u := [[-2], [3]] v := [[5], [3]]; v := [[5], [3]] VectorNorm(Matrix(u), 2); (1/2) 13 VectorNorm(Matrix(v), 2); (1/2) 34 DotProduct(Matrix(u), Matrix(v)); -1 Section 6.2 #1 u := [[-2], [3]]; u := [[-2], [3]] v := [[2], [3]]; v := [[2], [3]] DotProduct(Matrix(u), Matrix(v)); 5 #3 u := [[1], [2], [1]]; u := [[1], [2], [1]] v := [[1], [-1], [1]]; v := [[1], [-1], [1]] w := [[2], [-1], [0]]; w := [[2], [-1], [0]] DotProduct(Matrix(u), Matrix(v)); 0 DotProduct(Matrix(u), Matrix(w)); 0 DotProduct(Matrix(v), Matrix(w)); 3 #7 u := [[1], [2], [3], [-3]]; u := [[1], [2], [3], [-3]] v := [[1], [1], [-1], [0]]; v := [[1], [1], [-1], [0]] w := [[3], [-3], [0], [-1]]; w := [[3], [-3], [0], [-1]] DotProduct(Matrix(u), Matrix(v)); 0 DotProduct(Matrix(u), Matrix(w)); 0 DotProduct(Matrix(v), Matrix(w)); 0 #9 u := `<,>`(1, 1, 1); [1] [ ] u := [1] [ ] [1] v := `<,>`(5, -1, 2); [ 5 ] [ ] v := [&uminus0;1] [ ] [ 2 ] GramSchmidt([u, v], normalized = true); [[3] ] [[-] [ 2 ]] [[3] [ - ]] [[ ] [ 2 ]] [[3] [ ]] [[-], [ 2]] [[3] [uminus0-]] [[ ] [ 2]] [[3] [ ]] [[-] [ 0 ]] [[3] ] #11 u := `<,>`(1, -2, -1); [ 1 ] [ ] u := [&uminus0;2] [ ] [&uminus0;1] v := `<,>`(7, 7, 5); [7] [ ] v := [7] [ ] [5] GramSchmidt([u, v], normalized = true); [[ 6 ] [3 11]] [[ - ] [----]] [[ 6 ] [ 11 ]] [[ ] [ ]] [[ 6] [ 11 ]] [[uminus0-], [ -- ]] [[ 3] [ 11 ]] [[ ] [ ]] [[ 6] [ 11 ]] [[uminus0-] [ -- ]] [[ 6] [ 11 ]] #13 u := `<,>`(0, 1, 1, 1); [0] [ ] [1] u := [ ] [1] [ ] [1] v := `<,>`(1, 0, 1, 1); [1] [ ] [0] v := [ ] [1] [ ] [1] w := `<,>`(1, 1, 0, 1); [1] [ ] [1] w := [ ] [0] [ ] [1] GramSchmidt([u, v, w], normalized = true); [ [ 15 ] [ 3 35 ]] [[0] [ -- ] [ ---- ]] [[ ] [ 5 ] [ 35 ]] [[3] [ ] [ ]] [[-] [ 2 15] [ 3 35 ]] [[3] [uminus0----] [ ---- ]] [[ ] [ 15 ] [ 35 ]] [[3], [ ], [ ]] [[-] [ 15 ] [ 4 35]] [[3] [ -- ] [uminus0----]] [[ ] [ 15 ] [ 35 ]] [[3] [ ] [ ]] [[-] [ 15 ] [ 35 ]] [[3] [ -- ] [ -- ]] [ [ 15 ] [ 35 ]] #17 u1 := `<,>`(2, 1); [2] u1 := [ ] [1] u2 := `<,>`(-1, 2); [&uminus0;1] u2 := [ ] [ 2 ] v := `<,>`(1, 8); [1] v := [ ] [8] DotProduct(v, u1)/VectorNorm(u1, 2)^2; 2 DotProduct(v, u2)/VectorNorm(u2, 2)^2; 3 #19 u1 := `<,>`(-1, 3, -2); [&uminus0;1] [ ] u1 := [ 3 ] [ ] [&uminus0;2] u2 := `<,>`(-1, 1, 2); [&uminus0;1] [ ] u2 := [ 1 ] [ ] [ 2 ] u3 := `<,>`(1, 1, 1); [1] [ ] u3 := [1] [ ] [1] v := `<,>`(7, -1, 2); [ 7 ] [ ] v := [&uminus0;1] [ ] [ 2 ] DotProduct(v, u1)/VectorNorm(u1, 2)^2; -1 DotProduct(v, u2)/VectorNorm(u2, 2)^2; -2 -- 3 DotProduct(v, u3)/VectorNorm(u3, 2)^2; 8 - 3 #21 u1 := `<,>`(1, 0, 1); [1] [ ] u1 := [0] [ ] [1] u2 := `<,>`(1, 2, -1); [ 1 ] [ ] u2 := [ 2 ] [ ] [&uminus0;1] u3 := `<,>`(1, -1, -1); [ 1 ] [ ] u3 := [&uminus0;1] [ ] [&uminus0;1] v := `<,>`(3, 1, 2); [3] [ ] v := [1] [ ] [2] DotProduct(v, u1)/VectorNorm(u1, 2)^2; 5 - 2 DotProduct(v, u2)/VectorNorm(u2, 2)^2; 1 - 2 DotProduct(v, u3)/VectorNorm(u3, 2)^2; 0 #25 A := [[1, 5], [1, -1], [1, 2]]; A := [[1, 5], [1, -1], [1, 2]] QRDecomposition(A); [3 2 ] [- - ] [3 2 ] [ ] [3 2] [3 2 3] [- uminus0-], [ ] [3 2] [0 3 2] [ ] [3 ] [- 0 ] [3 ] #27 A := [[1, 7], [-2, 7], [-1, 5]]; A := [[1, 7], [-2, 7], [-1, 5]] QRDecomposition(A); [ 6 3 11] [ - ----] [ 6 11 ] [ ] [ 6 11 ] [6 uminus02 6] [uminus0- -- ], [ ] [ 3 11 ] [0 3 11 ] [ ] [ 6 11 ] [uminus0- -- ] [ 6 11 ] #29 A := [[0, 1, 1], [1, 0, 1], [1, 1, 0], [1, 1, 1]]; A := [[0, 1, 1], [1, 0, 1], [1, 1, 0], [1, 1, 1]] QRDecomposition(A); [ 15 3 35 ] [0 -- ---- ] [ 5 35 ] [ 2 3 2 3 ] [ ] [3 --- --- ] [3 2 15 3 35 ] [ 3 3 ] [- uminus0---- ---- ] [ ] [3 15 35 ] [ 15 2 15] [ ], [0 -- ----] [3 15 4 35] [ 3 15 ] [- -- uminus0----] [ ] [3 15 35 ] [ 35 ] [ ] [0 0 -- ] [3 15 35 ] [ 5 ] [- -- -- ] [3 15 35 ] #Section 6.4 with(LinearAlgebra); with(plots); LS := proc (L, x) local A, b, i; A := `<|>`(`<,>`(seq(1, i = 1 .. nops(L))), `<,>`(seq(L[i][1], i = 1 .. nops(L)))); b := `<,>`(seq(L[i][2], i = 1 .. nops(L))); LeastSquares(A, b)[1]+LeastSquares(A, b)[2]*x end proc; LSc := proc (L, x) local b, m, f, v; f := add((L[i][2]-b-m*L[i][1])^2, i = 1 .. nops(L)); v := solve({diff(f, b), diff(f, m)}, {b, m}); subs(v, b)+subs(v, m)*x end proc; PLS := proc (L) local gu, x, mu, minx, maxx; gu := LS(L, x); minx := min(seq(L[i][1], i = 1 .. nops(L))); maxx := max(seq(L[i][1], i = 1 .. nops(L))); mu := plot(gu, x = minx .. maxx, color = red); mu := mu, plot(L, style = point, color = black); display(mu) end proc; #1 LS([[1, 14], [3, 17], [5, 19], [7, 20]], x); 27 -- + x 2 #3 LS([[1, 5], [2, 6], [3, 8], [4, 10], [5, 11]], x); 16 8 -- + - x 5 5 #5 LS([[1, 40], [3, 36], [7, 23], [8, 21], [10, 13]], x); 44 - 3 x #7 LS([[1, 4], [4, 24], [5, 30], [8, 32], [12, 36]], x); 48 13 -- + -- x 5 5 #11 LS([[0, 3], [1, 3], [2, 5], [3, 9]], x); 2 + 2 x #13 LS([[0, 2], [1, 3], [2, 5], [3, 8]], x); 3 - + 2 x 2 #Maple challenge with(linalg); #1 A := randmatrix(5, 5); [-33 87 -34 40 77] [ ] [ 1 -10 -65 -85 54] [ ] A := [ 0 18 52 36 91] [ ] [-22 51 -27 50 60] [ ] [-91 -47 -97 -2 -31] rref(A); [1 0 0 0 0] [ ] [0 1 0 0 0] [ ] [0 0 1 0 0] [ ] [0 0 0 1 0] [ ] [0 0 0 0 1] A := randmatrix(5, 5); [ 25 31 -27 65 88] [ ] [ 10 -6 80 -84 57] [ ] A := [-49 31 73 95 68] [ ] [-29 5 -26 -51 88] [ ] [ 97 -67 58 29 37] rref(A); [1 0 0 0 0] [ ] [0 1 0 0 0] [ ] [0 0 1 0 0] [ ] [0 0 0 1 0] [ ] [0 0 0 0 1] A := randmatrix(5, 5); [ 5 -36 -57 85 80] [ ] [ 90 74 27 9 -91] [ ] A := [ 81 65 -12 78 5] [ ] [-63 -5 36 -8 30] [ ] [ -3 -56 -91 -70 42] rref(A); [1 0 0 0 0] [ ] [0 1 0 0 0] [ ] [0 0 1 0 0] [ ] [0 0 0 1 0] [ ] [0 0 0 0 1] A := randmatrix(5, 5); [ 9 -21 -27 -79 -22] [ ] [-51 16 -85 -44 -31] [ ] A := [ 45 49 -58 49 1] [ ] [-95 86 -97 -14 83] [ ] [-96 -8 -54 62 96] rref(A); [1 0 0 0 0] [ ] [0 1 0 0 0] [ ] [0 0 1 0 0] [ ] [0 0 0 1 0] [ ] [0 0 0 0 1] A := randmatrix(5, 5); [-51 89 14 -79 -58] [ ] [-95 61 -2 86 57] [ ] A := [-35 57 28 63 21] [ ] [-71 -66 -34 72 -40] [ ] [-68 -15 -32 17 87] rref(A); [1 0 0 0 0] [ ] [0 1 0 0 0] [ ] [0 0 1 0 0] [ ] [0 0 0 1 0] [ ] [0 0 0 0 1] A := randmatrix(5, 5); [-60 7 -61 45 -50] [ ] [-22 48 -82 46 -49] [ ] A := [-66 18 16 -22 38] [ ] [-48 0 -87 -13 -87] [ ] [-63 -31 90 66 88] rref(A); [1 0 0 0 0] [ ] [0 1 0 0 0] [ ] [0 0 1 0 0] [ ] [0 0 0 1 0] [ ] [0 0 0 0 1] A := randmatrix(5, 5); [74 -39 -20 31 -52] [ ] [37 -59 -54 -22 17] [ ] A := [63 21 -12 -21 -74] [ ] [55 -17 83 -65 -28] [ ] [-5 27 0 26 13] rref(A); [1 0 0 0 0] [ ] [0 1 0 0 0] [ ] [0 0 1 0 0] [ ] [0 0 0 1 0] [ ] [0 0 0 0 1] A := randmatrix(5, 5); [ 83 -19 -62 -12 48] [ ] [-84 -83 96 6 76] [ ] A := [ 95 -14 61 83 -83] [ ] [ 53 -6 52 -40 45] [ ] [-86 -88 -21 28 92] rref(A); [1 0 0 0 0] [ ] [0 1 0 0 0] [ ] [0 0 1 0 0] [ ] [0 0 0 1 0] [ ] [0 0 0 0 1] A := randmatrix(5, 5); [ -1 49 -27 88 -63] [ ] [ 61 46 -36 -76 -22] [ ] A := [-55 -34 52 1 87] [ ] [ 11 -11 88 94 6] [ ] [ 21 18 75 10 18] rref(A); [1 0 0 0 0] [ ] [0 1 0 0 0] [ ] [0 0 1 0 0] [ ] [0 0 0 1 0] [ ] [0 0 0 0 1] A := randmatrix(5, 5); [60 -90 11 -91 -53] [ ] [37 76 -44 67 -72] [ ] A := [ 2 4 -84 -60 -83] [ ] [ 0 84 77 -46 63] [ ] [27 -43 72 -64 8] rref(A); [1 0 0 0 0] [ ] [0 1 0 0 0] [ ] [0 0 1 0 0] [ ] [0 0 0 1 0] [ ] [0 0 0 0 1] A := randmatrix(5, 5); [ 44 41 -65 -20 -55] [ ] [-64 -62 -86 67 11] [ ] A := [ 78 38 -63 89 30] [ ] [-42 -97 -78 17 -43] [ ] [ 89 -3 80 -37 -89] rref(A); [1 0 0 0 0] [ ] [0 1 0 0 0] [ ] [0 0 1 0 0] [ ] [0 0 0 1 0] [ ] [0 0 0 0 1] A := randmatrix(5, 5); [ 58 32 -61 83 -9] [ ] [-52 51 -75 23 -27] [ ] A := [-38 -14 -77 24 4] [ ] [-39 44 -49 75 14] [ ] [ 61 -80 -17 -90 13] rref(A); [1 0 0 0 0] [ ] [0 1 0 0 0] [ ] [0 0 1 0 0] [ ] [0 0 0 1 0] [ ] [0 0 0 0 1] A := randmatrix(5, 5); [ 68 -84 -81 -60 68] [ ] [ 11 -29 -25 -95 -22] [ ] A := [ 57 18 51 49 34] [ ] [-64 70 97 21 -27] [ ] [ -9 1 11 72 -56] rref(A); [1 0 0 0 0] [ ] [0 1 0 0 0] [ ] [0 0 1 0 0] [ ] [0 0 0 1 0] [ ] [0 0 0 0 1] A := randmatrix(5, 5); [ 53 -63 -63 94 89] [ ] [-56 73 -1 80 69] [ ] A := [ 76 -25 -26 -7 -93] [ ] [-36 53 -78 -67 88] [ ] [ -5 -36 -1 31 7] rref(A); [1 0 0 0 0] [ ] [0 1 0 0 0] [ ] [0 0 1 0 0] [ ] [0 0 0 1 0] [ ] [0 0 0 0 1] A := randmatrix(5, 5); [-42 -73 69 24 55] [ ] [-49 86 -23 17 31] [ ] A := [ 75 36 14 -55 -1] [ ] [ 23 -83 -26 35 34] [ ] [-14 -92 -90 -32 15] rref(A); [1 0 0 0 0] [ ] [0 1 0 0 0] [ ] [0 0 1 0 0] [ ] [0 0 0 1 0] [ ] [0 0 0 0 1] A := randmatrix(5, 5); [-57 93 82 -85 -28] [ ] [-90 -27 -45 20 -49] [ ] A := [-48 51 -56 -20 -77] [ ] [ -5 7 -15 62 -31] [ ] [ 57 98 -80 -51 39] rref(A); [1 0 0 0 0] [ ] [0 1 0 0 0] [ ] [0 0 1 0 0] [ ] [0 0 0 1 0] [ ] [0 0 0 0 1] A := randmatrix(5, 5); [ 3 6 60 17 93] [ ] [-80 88 -40 -10 67] [ ] A := [-40 -82 -82 -69 3] [ ] [ 69 -37 42 -51 -80] [ ] [-72 36 71 54 84] rref(A); [1 0 0 0 0] [ ] [0 1 0 0 0] [ ] [0 0 1 0 0] [ ] [0 0 0 1 0] [ ] [0 0 0 0 1] A := randmatrix(5, 5); [-53 65 -9 50 -19] [ ] [-18 -45 -30 73 -37] [ ] A := [ 83 -15 -80 -40 18] [ ] [ 64 60 80 -33 67] [ ] [-14 82 83 94 77] rref(A); [1 0 0 0 0] [ ] [0 1 0 0 0] [ ] [0 0 1 0 0] [ ] [0 0 0 1 0] [ ] [0 0 0 0 1] A := randmatrix(5, 5); [ 97 -76 19 -32 79] [ ] [ -4 -37 -34 -12 9] [ ] A := [ 63 16 7 -43 -34] [ ] [-20 78 -98 -86 14] [ ] [-27 -27 -99 -81 -42] rref(A); [1 0 0 0 0] [ ] [0 1 0 0 0] [ ] [0 0 1 0 0] [ ] [0 0 0 1 0] [ ] [0 0 0 0 1] A := randmatrix(5, 5); [30 -21 -27 13 14] [ ] [-9 -77 -35 29 -27] [ ] A := [78 25 30 17 -65] [ ] [13 88 -96 -67 -85] [ ] [50 -55 -64 -75 90] rref(A); [1 0 0 0 0] [ ] [0 1 0 0 0] [ ] [0 0 1 0 0] [ ] [0 0 0 1 0] [ ] [0 0 0 0 1] #All 20 matrices can be reduced to identity matrix #2 A := randmatrix(2, 5); [-80 91 36 -86 97] A := [ ] [ 0 -40 48 -12 -88] rref(A); [ -363 1133 129] [1 0 ---- ---- ---] [ 200 800 100] [ ] [ -6 3 11] [0 1 -- -- --] [ 5 10 5 ] A := randmatrix(2, 5); [-57 -75 -71 21 -84] A := [ ] [-47 63 21 -66 -24] rref(A); [ 483 1209 591] [1 0 ---- ---- ---] [ 1186 2372 593] [ ] [ 2267 -1583 215] [0 1 ---- ----- ---] [ 3558 2372 593] A := randmatrix(2, 5); [-88 -17 -32 -39 -75] A := [ ] [ 82 -93 -19 3 65] rref(A); [ 2653 1839 4040] [1 0 ---- ---- ----] [ 9578 4789 4789] [ ] [ 2148 1467 215 ] [0 1 ---- ---- ----] [ 4789 4789 4789] A := randmatrix(2, 5); [-96 -6 1 1 62] A := [ ] [-25 -58 -66 56 3] rref(A); [ -227 139 -1789] [1 0 ---- ---- -----] [ 2709 2709 2709 ] [ ] [ 6361 -5351 631 ] [0 1 ---- ----- ----] [ 5418 5418 2709] A := randmatrix(2, 5); [49 76 -98 48 -23] A := [ ] [90 -19 31 71 -25] rref(A); [ 26 332 -123] [1 0 --- --- ----] [ 409 409 409 ] [ ] [ -10339 841 -845] [0 1 ------ ---- ----] [ 7771 7771 7771] A := randmatrix(2, 5); [ 58 34 56 -84 -6] A := [ ] [-54 40 94 -31 13] rref(A); [ -239 -1153 -341] [1 0 ---- ----- ----] [ 1039 2078 2078] [ ] [ 2119 -3167 215 ] [0 1 ---- ----- ----] [ 1039 2078 2078] A := randmatrix(2, 5); [ 9 17 -61 3 13] A := [ ] [-28 95 26 42 70] rref(A); [ -567 -39 45 ] [1 0 ---- --- ----] [ 121 121 1331] [ ] [ -134 42 994 ] [0 1 ---- --- ----] [ 121 121 1331] A := randmatrix(2, 5); [ 46 -97 23 -94 -71] A := [ ] [-64 -73 -4 -80 -23] rref(A); [ 2067 449 -1476] [1 0 ---- ---- -----] [ 9566 4783 4783 ] [ ] [ -644 4848 2801] [0 1 ---- ---- ----] [ 4783 4783 4783] A := randmatrix(2, 5); [-33 -53 93 -32 74] A := [ ] [-72 -10 47 -41 90] rref(A); [ -223 1853 -2015] [1 0 ---- ---- -----] [ 498 3486 1743 ] [ ] [ -245 317 -393] [0 1 ---- ---- ----] [ 166 1162 581 ] A := randmatrix(2, 5); [ 60 29 -31 52 -11] A := [ ] [-94 -58 47 96 -84] rref(A); [ -15 100 -53] [1 0 --- --- ---] [ 26 13 13 ] [ ] [ 47 -5324 3037] [0 1 --- ----- ----] [ 377 377 377 ] A := randmatrix(2, 5); [63 -27 -99 29 34] A := [ ] [48 80 59 92 -43] rref(A); [ -703 1201 1559] [1 0 ---- ---- ----] [ 704 1584 6336] [ ] [ 941 367 -1447] [0 1 --- --- -----] [ 704 528 2112 ] A := randmatrix(2, 5); [ 96 1 85 63 78] A := [ ] [-50 -74 51 -59 82] rref(A); [ 6341 4603 2927] [1 0 ---- ---- ----] [ 7054 7054 3527] [ ] [ -4573 1257 -5886] [0 1 ----- ---- -----] [ 3527 3527 3527 ] A := randmatrix(2, 5); [-13 -65 34 -98 23] A := [ ] [ 3 63 -68 -54 -21] rref(A); [ 1139 807 -7] [1 0 ---- --- --] [ 312 52 52] [ ] [ -391 -83 -17] [0 1 ---- --- ---] [ 312 52 52 ] A := randmatrix(2, 5); [-84 24 61 38 43] A := [ ] [-14 -58 6 27 62] rref(A); [ -263 -23 -1991] [1 0 ---- --- -----] [ 372 42 2604 ] [ ] [ 25 -1 -329] [0 1 --- -- ----] [ 372 3 372 ] A := randmatrix(2, 5); [-91 28 -51 -75 -25] A := [ ] [-38 -32 2 -92 98] rref(A); [ 197 622 -243] [1 0 --- --- ----] [ 497 497 497 ] [ ] [ -265 2761 -2467] [0 1 ---- ---- -----] [ 497 1988 994 ] A := randmatrix(2, 5); [ 76 -55 -63 20 -3] A := [ ] [-99 -93 -61 -6 42] rref(A); [ -2504 730 -863] [1 0 ----- ---- ----] [ 12513 4171 4171] [ ] [ 10873 -508 -965] [0 1 ----- ---- ----] [ 12513 4171 4171] A := randmatrix(2, 5); [ 4 -15 56 27 0] A := [ ] [-92 93 -46 -57 59] rref(A); [ -251 -23 -295] [1 0 ---- --- ----] [ 56 14 336 ] [ ] [ -69 -47 -59] [0 1 --- --- ---] [ 14 21 252] A := randmatrix(2, 5); [-86 44 0 -36 96] A := [ ] [ 85 -91 -70 -99 -2] rref(A); [ 1540 424 -4324] [1 0 ---- --- -----] [ 2043 227 2043 ] [ ] [ 3010 643 -3994] [0 1 ---- --- -----] [ 2043 227 2043 ] A := randmatrix(2, 5); [ 5 -52 -38 48 -41] A := [ ] [42 -46 34 84 90] rref(A); [ 1758 1080 3283] [1 0 ---- ---- ----] [ 977 977 977 ] [ ] [ 883 -798 1086] [0 1 --- ---- ----] [ 977 977 977 ] A := randmatrix(2, 5); [-45 -6 54 -97 -10] A := [ ] [ 34 93 89 -8 -8] rref(A); [ -1852 3023 326 ] [1 0 ----- ---- ----] [ 1327 1327 1327] [ ] [ 1947 -3658 -700] [0 1 ---- ----- ----] [ 1327 3981 3981] #All 20 matrices have standard vectors as first two columns #3a A := randmatrix(15, 15); time(det(A)); 0. time(permanent(A)); 0.625 A := randmatrix(15, 15); time(det(A)); 0.015 time(permanent(A)); 0.562 A := randmatrix(15, 15); time(det(A)); 0. time(permanent(A)); 0.750 A := randmatrix(15, 15); time(det(A)); 0. time(permanent(A)); 0.609 A := randmatrix(15, 15); time(det(A)); 0. time(permanent(A)); 0.765 A := randmatrix(15, 15); time(det(A)); 0. time(permanent(A)); 0.734 A := randmatrix(15, 15); time(det(A)); 0. time(permanent(A)); 0.656 A := randmatrix(15, 15); time(det(A)); 0. time(permanent(A)); 0.578 A := randmatrix(15, 15); time(det(A)); 0. time(permanent(A)); 0.703 A := randmatrix(15, 15); time(det(A)); 0.015 time(permanent(A)); 0.750 #3b A := randmatrix(17, 17); time(det(A)); 0.015 time(permanent(A)); 3.375 A := randmatrix(17, 17); time(det(A)); 0.015 time(permanent(A)); 3.265 A := randmatrix(17, 17); time(det(A)); 0.015 time(permanent(A)); 3.156 A := randmatrix(17, 17); time(det(A)); 0. time(permanent(A)); 3.750 A := randmatrix(17, 17); time(det(A)); 0. time(permanent(A)); 3.187 A := randmatrix(17, 17); time(det(A)); 0. time(permanent(A)); 3.125 A := randmatrix(17, 17); time(det(A)); 0. time(permanent(A)); 3.250 A := randmatrix(17, 17); time(det(A)); 0.015 time(permanent(A)); 3.421 A := randmatrix(17, 17); time(det(A)); 0. time(permanent(A)); 3.375 A := randmatrix(17, 17); time(det(A)); 0. time(permanent(A)); 3.437 #3c A := randmatrix(20, 20); time(det(A)); 0. time(permanent(A)); 46.000 A := randmatrix(20, 20); time(det(A)); 0. time(permanent(A)); 43.765 A := randmatrix(20, 20); time(det(A)); 0.015 time(permanent(A)); 45.906 A := randmatrix(20, 20); time(det(A)); 0.015 time(permanent(A)); 45.890 A := randmatrix(20, 20); time(det(A)); 0. time(permanent(A)); 49.343 A := randmatrix(20, 20); time(det(A)); 0.015 time(permanent(A)); 48.062 A := randmatrix(20, 20); time(det(A)); 0.015 time(permanent(A)); 45.890 A := randmatrix(20, 20); time(det(A)); 0.015 time(permanent(A)); 46.468 A := randmatrix(20, 20); time(det(A)); 0.015 time(permanent(A)); 46.234 A := randmatrix(20, 20); time(det(A)); 0.015 time(permanent(A)); 47.828