# Problem 13: # polyroot( c(4, -2, -4, 2) ) polyroot( c(4, 0, -5, 0, 1) ) polyroot( c(-1, 0, 3, 0, 3, 0, 1) ) polyroot( c(2, -3, 3, -3, 1) ) polyroot( c(4, 2, 1) ) polyroot( c(16, 0, 0, 0, 8, 0, 0, 0, 1) ) # Problem 10: polyroot( c(1, 0, 2, 0, 1) ) polyroot( c(1, 3, -5, 1) ) polyroot( c(2, 6, 5, 1) ) # Problem 25: polyroot( c(4, 14, 21, 18) ) # Problem 26: polyroot( c(-36, 30, 6, -7, 1) ) # Problem 27: polyroot( c(5, 37, 75, 31, 12) ) # Problem 28: polyroot( c(14, 22, 17, 6, 1) ) # Problem 30: A = matrix( c(1, 0, 1, 0, 1, 1, -1, 1, 0, 1, 0, -1, -1, 1, 1, 1), nrow=4, ncol=4, byrow=TRUE ) b = c(0, 0, -1, 0) solve(A, b) # Problem 31: A = matrix( c(1, 1, exp(2), exp(2), 0, 1, 2 * exp(2), 3 * exp(2), 0, 0, 4, 8 * exp(2), 0, 0, 8 * exp(2), 20 * exp(2)), nrow=4, ncol=4, byrow=TRUE ) b = c(-1, 2, 0, 0) solve(A, b) # Problem 32: polyroot( c(-1, 1, -1, 1) ) A = matrix( c(1, 1, 0, 1, 0, 1, 1, -1, 0), nrow=3, ncol=3, byrow=TRUE ) b = c(2, -1, -2) print(solve(A, b)) # Problem 33: polyroot( c(4, 4, -9, -1, 2) ) A = matrix( c(1, 1, 1, 1, -1/2, 1, -2, 2, 1/4, 1, 4, 4, -1/8, 1, -8, 8), nrow=4, ncol=4, byrow=TRUE ) b = c(-2, 0, -2, 0) print(solve(A, b)) # Problem 34: polyroot( c(5, 1, 0, 4) ) A = matrix( c(1, 1, 0, -1, 1/2, 1, 1, -3/4, 1), nrow=3, ncol=3, byrow=TRUE ) b = c(2, 1, -1) print(solve(A, b)) # Problem 35: polyroot( c(1, 5, 6) ) A = matrix( c(1, 1, 1, 0, -1/3, -1/2, 0, 1/9, 1/4), nrow=3, ncol=3, byrow=TRUE ) b = c(-2, 2, 0) print(solve(A, b)) # Problem 36: A = matrix( c(1, 0, 1, 0, -1, 1, -2, sqrt(3), 0, -2, 1, -4 * sqrt(3), 2, 2, 10, 9 * sqrt(3)), nrow=4, ncol=4, byrow=TRUE ) b = c(1, -2, 0, 3) print(solve(A, b)) # Problem 39: A = matrix( c(1, 0, 1, 0, 0, 1, 0, sqrt(6), -1, 0, -6, 0, 0, -1, 0, -6*sqrt(6)), nrow=4, ncol=4, byrow=TRUE ) b = c(1, 0, -1, 0) # part (c) b = c(-2, 0, 12, 0) # part (d) print(solve(A, b))