(* Linear Algebra: Theory and Applications *) (* Ward Cheney & David Kincaid *) (* JBPub.com (c) 2008 *) (* File: exp8211.mat *) (* Example 8.2.11 *) A = {{4.,7.,-3.},{2.,-4.,6.},{-3.,2.,5.},{1.,-2.,4.}} b = {1.,5.,7.,-3.} {Q, R} = QRDecomposition[A] xt = LinearSolve[R,Q.b] x = N[xt] r = A.x-b e = Transpose[A].r