#----------------------------------------------# # # # Numerisches Ueberpruefen der Resultate aus # # Aufgabe 1 und 2: # # # #----------------------------------------------# # R-Code: # Aufgabe 1: # Wir legen die Matrix A an: a1 = c(1,1,-1) # 'c()' fuer 'concatenate', a2 = c(1,-1,1) # Zeilenvektoren a3 = c(-1,1,1) A = rbind(a1,a2,a3) # 'rbind' fuer 'row-bind' A # das passt det(A) # -4, kommt hin # inverse Matrix: Ainv = solve(A) # solve(A,b) = Ainv*b loest Ax=b Ainv # das passt # Aufgabe 2: # 2a) a1 = c(1,2,3,4) a2 = c(2,1,2,3) a3 = c(3,2,1,2) a4 = c(4,3,2,1) A = rbind(a1,a2,a3,a4) A det(A) # -20, das passt # 2b) b1 = c(1,1,1,1) b2 = c(1,2,4,8) b3 = c(1,3,9,27) b4 = c(1,4,16,64) B = rbind(b1,b2,b3,b4) B det(B) # 12, stimmt auch # 2c) c1 = c(1,2,0,0) c2 = c(3,4,0,0) c3 = c(0,0,5,6) c4 = c(0,0,7,8) C = rbind(c1,c2,c3,c4) C det(C) # 4, ist auch ok