MA 305 Spring 2K Homework 2 Solutions > read("/afs/eos.ncsu.edu/users/k/kaltofen/www/courses/LinAlgebra/Maple/initlib.mpl"): > with(refpkg): > infolevel['refpkg']:=3: > with(linalg): Warning, new definition for norm Warning, new definition for trace Problem 1 > A := matrix(3,3,[1,2,3,3,1,3,2,1,4]); [1 2 3] [ ] A := [3 1 3] [ ] [2 1 4] a. > evalm(3 * A + 5 * A^2); [68 41 114] [ ] [69 53 129] [ ] [71 48 137] b. > I3 := array(identity, 1..3, 1..3); I3 := array(identity, 1 .. 3, 1 .. 3, []) > evalm(A^4 - A^3 + 2 * A^2 - A + 4 * I3); [479 308 861] [ ] [519 365 975] [ ] [536 363 998] Problem 2 > A := matrix(3,2,[1,3,1,4,2,1]); [1 3] [ ] A := [1 4] [ ] [2 1] > B := matrix(3,3,[1,1,3,2,1,2,4,2,1]); [1 1 3] [ ] B := [2 1 2] [ ] [4 2 1] a. > evalm(transpose(A&*B)); Error, (in linalg[multiply]) non matching dimensions for vector/matrix product The multiplication is not possible because A; is a 3 x 2 matrix and B; is a 3 x 3 matrix, and the dimensions are not compatible for matrix multiplication. b. > evalm(transpose(A)&*transpose(B)); [ 8 7 8] [ ] [10 12 21] c. > evalm(B&*transpose(B)); [11 9 9] [ ] [ 9 9 12] [ ] [ 9 12 21] d. > evalm(A&*transpose(A)); [10 13 5] [ ] [13 17 6] [ ] [ 5 6 5] e. > evalm(transpose(A)&*A); [6 9] [ ] [9 26] f. > evalm(transpose(B)&*transpose(A)); Error, (in linalg[multiply]) non matching dimensions for vector/matrix product The multiplication is not possible because B^T; is a 3 x 3 matrix and A^T; is a 2 x b matrix, and the dimensions are not compatible for matrix multiplication. Problem 3 > inverse(matrix(4,4,[1,0,0,0,0,3,0,0,2,0,3,0,4,5,0,1])); [ 1 0 0 0] [ ] [ 0 1/3 0 0] [ ] [-2/3 0 1/3 0] [ ] [ -4 -5/3 0 1] Problem 4 > inverse(matrix(4,4,[1,b,0,0,a,1,b,0,0,a,1,b,0,0,a,1])); [ 2 3 ] [ -1 + 2 b a b (-1 + b a) b b ] [- ---------- , ------------ , ---- , - ----] [ %1 %1 %1 %1 ] [ ] [ 2 ] [a (-1 + b a) -1 + b a b b ] [------------ , - -------- , - ---- , ----] [ %1 %1 %1 %1 ] [ ] [ 2 ] [ a a -1 + b a b (-1 + b a)] [---- , - ---- , - -------- , ------------] [ %1 %1 %1 %1 ] [ ] [ 3 2 ] [ a a a (-1 + b a) -1 + 2 b a] [- ---- , ---- , ------------ , - ----------] [ %1 %1 %1 %1 ] 2 2 %1 := 1 - 3 b a + b a >