{VERSION 6 0 "IBM INTEL NT" "6.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 23 "Courier" 1 10 0 0 0 0 0 0 0 0 0 0 3 0 0 1 }{CSTYLE " Help Normal" -1 30 "Times" 1 12 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE " Blue Emphasis" -1 256 "Times" 0 0 0 0 255 1 0 1 0 0 0 0 0 0 0 1 } {CSTYLE "Green Emphasis" -1 257 "Times" 1 12 0 128 0 1 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "Maroon Emphasis" -1 258 "Times" 1 12 128 0 128 1 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "Dark Red Emphasis" -1 259 "Times" 1 12 128 0 0 1 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 262 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 263 "" 0 10 0 0 0 0 0 0 0 0 0 0 3 0 0 1 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 266 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 267 "Courier" 0 10 0 0 0 0 0 0 0 0 0 0 3 0 0 1 }{CSTYLE "" -1 268 "Courier" 0 10 0 0 0 0 0 0 0 0 0 0 3 0 0 1 }{CSTYLE "" -1 269 "Courier" 1 10 0 0 0 0 0 0 0 0 0 0 3 0 0 1 }{CSTYLE "" -1 270 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 271 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 272 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "Purple Emphasis" -1 273 "Times" 1 12 102 0 230 1 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 274 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 } {CSTYLE "Red Emphasis" -1 275 "Times" 1 12 255 0 0 1 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 276 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 277 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 278 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 279 "System" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 280 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 281 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 282 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 283 "System" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 284 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 285 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 286 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 287 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 288 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "Grey Emphasis" -1 289 "Times" 1 12 96 52 84 1 0 1 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 128 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 4 3 0 3 0 2 2 0 1 }{PSTYLE "Heading 2 " -1 4 1 {CSTYLE "" -1 -1 "Times" 1 14 128 0 0 1 2 1 2 2 2 2 1 1 1 1 } 1 1 0 0 8 2 1 0 1 0 2 2 0 1 }{PSTYLE "Error" -1 8 1 {CSTYLE "" -1 -1 " Courier" 1 10 255 0 255 1 2 2 2 2 2 1 1 1 3 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Maple Output" -1 11 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 3 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Norma l" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 257 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 258 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {PARA 3 "" 0 "" {TEXT -1 35 "Matrix inversion by Newton's meth od" }}{PARA 0 "" 0 "" {TEXT -1 37 "by Peter Stone, Nanaimo, B.C., Cana da" }}{PARA 0 "" 0 "" {TEXT -1 19 "Version: 24.3.2007" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "with(LinearAlgebra):" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1 ";" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 40 "load extra procedures for linear systems" }}{PARA 0 " " 0 "" {TEXT -1 17 "The Maple m-file " }{TEXT 289 8 "linsys.m" }{TEXT -1 32 " is required by this worksheet. " }}{PARA 0 "" 0 "" {TEXT -1 121 "It can be read into a Maple session by a command similar to the o ne that follows, where the file path gives its location." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "read \"K:\\\\Maple/procdrs/linsys.m \";" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1 ";" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1 ";" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 46 "Dividing by multiplying using Newton's method " }}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 1 ";" }}}{PARA 0 "" 0 "" {TEXT -1 67 "Newton's met hod for numerical root-finding can be used to find the " }{TEXT 273 28 "reciprocal of a real number." }}{PARA 0 "" 0 "" {TEXT -1 46 "This \+ leads to division through multiplication." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 39 "Suppose we want to find the recipr ocal " }{XPPEDIT 18 0 "1/c;" "6#*&\"\"\"F$%\"cG!\"\"" }{TEXT -1 25 " \+ of a fixed feal number " }{TEXT 278 1 "c" }{TEXT -1 1 "." }}{PARA 0 " " 0 "" {TEXT -1 18 "Define a function " }{XPPEDIT 18 0 "phi" "6#%$phiG " }{TEXT -1 17 " by the formula " }{XPPEDIT 18 0 "phi(x) = 1/x-c;" "6 #/-%$phiG6#%\"xG,&*&\"\"\"F*F'!\"\"F*%\"cGF+" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 5 "Then " }{XPPEDIT 18 0 "phi(x)" "6#-%$phiG6#%\"xG " }{TEXT -1 21 " has the single root " }{XPPEDIT 18 0 "x = 1/c;" "6#/% \"xG*&\"\"\"F&%\"cG!\"\"" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 6 "Since " }{XPPEDIT 18 0 "phi*`'`(x) = -1/(x^2);" "6#/*&%$phiG\"\"\"- %\"'G6#%\"xGF&,$*&F&F&*$F*\"\"#!\"\"F/" }{TEXT -1 46 ", the Newton for mula for calculating roots of " }{XPPEDIT 18 0 "phi(x)" "6#-%$phiG6#% \"xG" }{TEXT -1 8 ", namely" }}{PARA 257 "" 0 "" {TEXT -1 1 " " } {XPPEDIT 18 0 "x[n+1];" "6#&%\"xG6#,&%\"nG\"\"\"F(F(" }{TEXT -1 4 " = \+ " }{XPPEDIT 18 0 "x[n]+phi(x)/(phi*`'`(x));" "6#,&&%\"xG6#%\"nG\"\"\" *&-%$phiG6#F%F(*&F+F(-%\"'G6#F%F(!\"\"F(" }{TEXT -1 2 ", " }}{PARA 258 "" 0 "" {TEXT -1 8 "becomes " }}{PARA 257 "" 0 "" {TEXT -1 2 " " }{XPPEDIT 18 0 "x[n+1] = x[n]-(1/x[n]-c)/(-1/(x[n]^2));" "6#/&%\"xG6#, &%\"nG\"\"\"F)F),&&F%6#F(F)*&,&*&F)F)&F%6#F(!\"\"F)%\"cGF2F),$*&F)F)*$ &F%6#F(\"\"#F2F2F2F2" }{TEXT -1 1 "," }}{PARA 258 "" 0 "" {TEXT -1 9 " that is, " }}{PARA 257 "" 0 "" {TEXT -1 1 " " }{XPPEDIT 18 0 "x[n+1] = x[n]+x[n]-c*x[n]^2;" "6#/&%\"xG6#,&%\"nG\"\"\"F)F),(&F%6#F(F)&F%6#F(F )*&%\"cGF)*$&F%6#F(\"\"#F)!\"\"" }{TEXT -1 1 "," }}{PARA 258 "" 0 "" {TEXT -1 3 "or " }}{PARA 257 "" 0 "" {TEXT -1 2 " " }{XPPEDIT 18 0 "x [n+1] = x[n]*(2-c*x[n]);" "6#/&%\"xG6#,&%\"nG\"\"\"F)F)*&&F%6#F(F),&\" \"#F)*&%\"cGF)&F%6#F(F)!\"\"F)" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 65 "As an example, we show ho w to calculate the decimal expansion of " }{XPPEDIT 18 0 "1/3;" "6#*& \"\"\"F$\"\"$!\"\"" }{TEXT -1 37 " with the starting approximation 0.3 ." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 146 "c := 3;\nDigits := 32: \nnextapprox := x -> x*(2 - c*x);\nnextapprox(0.3);\nnextapprox(%);\n nextapprox(%);\nnextapprox(%); \nnextapprox(%);\nDigits := 10:" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"cG\"\"$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%+nextapproxGf*6#%\"xG6\"6$%)operatorG%&arrowGF(*&9$\" \"\",&\"\"#F.*&%\"cGF.F-F.!\"\"F.F(F(F(" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"#L!\"#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"%LL!\"%" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#$\")LLLL!\")" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"1LLLLLLLL!#;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"A LLLLLLLLLLLLLLLL!#K" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1 ";" }} }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 65 "The numb er of correct decimal places doubles with each iteration." }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 35 "Matrix in version by Newton's method" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1 ";" }}}{PARA 0 "" 0 "" {TEXT -1 136 "An analagous formula to the formu la for calculating the reciprocal of a real number by Newton's method \+ can be used for matrix inversion." }}{PARA 0 "" 0 "" {TEXT -1 154 "Thi s method is not usually a practical way of finding the inverse of a ma trix, but it does open up the possibilty of iterative computations wit h matrices." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 41 "Suppose that we are given a non-singular " }{TEXT 281 1 "n" } {TEXT -1 1 " " }{TEXT 279 1 "x" }{TEXT -1 1 " " }{TEXT 280 1 "n" } {TEXT -1 8 " matrix " }{TEXT 282 1 "A" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 41 "Provided we start with a suitable matrix " }{XPPEDIT 18 0 "B[0];" "6#&%\"BG6#\"\"!" }{TEXT -1 15 ", the sequence " } {XPPEDIT 18 0 "B[0],B[1],B[2],` . . . `;" "6&&%\"BG6#\"\"!&F$6#\"\"\"& F$6#\"\"#%(~.~.~.~G" }{TEXT -1 7 ", where" }}{PARA 257 "" 0 "" {TEXT -1 2 " " }{XPPEDIT 18 0 "B[k+1] = 2*B[k]-B[k]*`.`*A*`.`*B[k];" "6#/&% \"BG6#,&%\"kG\"\"\"F)F),&*&\"\"#F)&F%6#F(F)F)*,&F%6#F(F)%\".GF)%\"AGF) F2F)&F%6#F(F)!\"\"" }{TEXT -1 1 "," }}{PARA 258 "" 0 "" {TEXT -1 3 "or " }}{PARA 257 "" 0 "" {TEXT -1 2 " " }{XPPEDIT 18 0 "B[k+1] = B[k]*` .`*(2*I-A*`.`*B[k]);" "6#/&%\"BG6#,&%\"kG\"\"\"F)F)*(&F%6#F(F)%\".GF), &*&\"\"#F)%\"IGF)F)*(%\"AGF)F-F)&F%6#F(F)!\"\"F)" }{TEXT -1 1 "," }} {PARA 0 "" 0 "" {TEXT -1 32 "converges to the inverse matrix " } {XPPEDIT 18 0 "A^(-1);" "6#)%\"AG,$\"\"\"!\"\"" }{TEXT -1 1 "." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 107 "Accordin g to \"Numerical Recipes in C \", Cambridge University Press, page 58, convergence is guaranteed when" }}{PARA 0 "" 0 "" {TEXT -1 1 " " } {XPPEDIT 18 0 "B[0] = epsilon*A^t;" "6#/&%\"BG6#\"\"!*&%(epsilonG\"\" \")%\"AG%\"tGF*" }{TEXT -1 8 ", where " }{XPPEDIT 18 0 "A^t;" "6#)%\"A G%\"tG" }{TEXT -1 21 " is the transpose of " }{TEXT 270 1 "A" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "epsilon <= 1/(max(Sum(a[i,j],j = 1 .. n), i = 1 .. n)*`.`*max(Sum(a[i,j],i = 1 .. n),j = 1 .. n));" "6#1%(epsilo nG*&\"\"\"F&*(-%$maxG6$-%$SumG6$&%\"aG6$%\"iG%\"jG/F2;F&%\"nG/F1;F&F5F &%\".GF&-F)6$-F,6$&F/6$F1F2/F1;F&F5/F2;F&F5F&!\"\"" }{TEXT -1 1 "." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 68 "The proce dure in the next section uses this starting approximation. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 53 "A proc edure for matrix inversion by Newton's method: " }{TEXT 0 13 "NewtonIn verse" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 83 " The procedure in this section computes the inverse of a non-singular s quare matrix " }{TEXT 271 1 "A" }{TEXT -1 37 " by means of the iterati ve formula: " }{XPPEDIT 18 0 "B[k+1] = B[k]*(2*I-A*B[k]);" "6#/&%\"BG 6#,&%\"kG\"\"\"F)F)*&&F%6#F(F),&*&\"\"#F)%\"IGF)F)*&%\"AGF)&F%6#F(F)! \"\"F)" }{TEXT -1 2 ". " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 20 "NewtonInverse: usage" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 260 18 "Calling S equence:\n" }}{PARA 0 "" 0 "" {TEXT 261 2 " " }{TEXT -1 22 " Newton Inverse( A ) " }}{PARA 0 "" 0 "" {TEXT 262 1 "\n" }{TEXT -1 27 " N ewtonInverse( A, B ) " }{TEXT 266 1 "\n" }{TEXT -1 0 "" }}{PARA 256 " " 0 "" {TEXT -1 11 "Parameters:" }}{PARA 0 "" 0 "" {TEXT -1 5 " " }}{PARA 0 "" 0 "" {TEXT 23 3 " " }{TEXT 267 3 "A " }{TEXT 269 2 "- \+ " }{TEXT -1 33 " a non-singular square matrix A" }}{PARA 0 "" 0 "" {TEXT -1 6 " " }{TEXT 268 6 "B - " }{TEXT 263 52 "an initial ap proximation for the inverse (optional)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 256 "" 0 "" {TEXT -1 12 "Description:" }}{PARA 0 "" 0 "" {TEXT -1 14 "The procedure " }{TEXT 0 13 "NewtonInverse" }{TEXT -1 30 " attempts to find the inverse " }{XPPEDIT 18 0 "A^(-1);" "6#)%\"AG,$ \"\"\"!\"\"" }{TEXT -1 3 "of " }{TEXT 265 1 "A" }{TEXT -1 62 " by Newt on's method, that is, by using the iterative formula: " }}{PARA 257 " " 0 "" {TEXT -1 10 " newB = B " }{TEXT 276 1 "." }{TEXT -1 8 " (2 - A \+ " }{TEXT 277 1 "." }{TEXT -1 4 " B)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 264 8 "Options:" }{TEXT -1 1 "\n" }}{PARA 0 " " 0 "" {TEXT -1 135 "maxiterations=n\nThis option can be used to overr ide the default value of Digits*5 for the maximum number of iterations to be performed." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 146 "info=true/false\nThe option info=true allows the progres s of the procedure to be monitored by printing the result of each newt on step as it occurs." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 273 16 "How to activate:" } {TEXT 256 1 "\n" }{TEXT -1 154 "To make the procedure active open the \+ subsection, place the cursor anywhere after the prompt [ > and press \+ [Enter].\nYou can then close up the subsection." }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 29 "NewtonInverse: implementation" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 3936 "NewtonInve rse := proc(AA::Matrix)\n local A,rowmax,colmax,i,j,k,temp,B,diff,pr evdiff,prntflg,\n eps,m,n,p,sum,tiny,small,T,maxit,Options,sav eDigits,\n startopts;\n\n m := LinearAlgebra['RowDimension'] (AA);\n n := LinearAlgebra['ColumnDimension'](AA);\n\n if m<>n the n\n error \"the 1st argument must be a square matrix\"\n end if ;\n\n startopts := 2;\n if nargs>1 then\n if type(args[2],Mat rix) then\n m := LinearAlgebra['RowDimension'](args[2]);\n \+ p := LinearAlgebra['ColumnDimension'](args[2]);\n if m<>p or m<>n then\n error \"the 2nd argument must be a square m atrix with the same dimensions as those of the 1st argument matrix\"\n end if;\n startopts := 3;\n end if;\n end if; \n\n maxit := Digits*5;\n prntflg := false;\n if nargs>=startopt s then\n Options:=[args[startopts..nargs]];\n if not type(Op tions,list(equation)) then\n error \"each optional argument af ter the %-1 argument must be an equation\",startopts-1;\n end if; \n if hasoption(Options,'maxiterations','maxit','Options') then\n if not type(maxit,posint) then\n error \"\\\"maxit erations\\\" must be a positive integer\"\n end if; \n en d if;\n if hasoption(Options,'info','prntflg','Options') then\n \+ if prntflg<>true then prntflg := false end if; \n end if; \n if nops(Options)>0 then\n error \"%1 is not a valid op tion for %2\",op(1,Options),procname;\n end if;\n end if;\n \+ \n saveDigits := Digits;\n Digits := max(trunc(evalhf(Digits)),tru nc(Digits*4/3));\n \n # Convert all entries to floats\n A := map(e valf,AA);\n if not type(A,'Matrix(complex(numeric))') then\n er ror \"the 1st argument matrix entries must all evaluate to complex flo ats\"\n end if;\n\n if startopts=2 then\n # Compute maximum o f sum of magnitudes of the row entries.\n rowmax := 0;\n for i from 1 to n do\n sum := 0;\n for j from 1 to n do\n sum := sum + abs(A[i,j]);\n end do;\n if s um>rowmax then rowmax := sum end if;\n end do;\n \n # Comp ute maximum of sum of magnitudes of the column entries.\n colmax \+ := 0;\n for j from 1 to n do\n sum := 0;\n for i \+ from 1 to n do\n sum := sum + abs(A[i,j]);\n end do ;\n if sum>colmax then colmax := sum end if;\n end do;\n \+ tiny := Float(1,-saveDigits*20);\n small := 1/max(rowmax*col max,tiny);\n\n # Starting approximation for A^(-1).\n B := L inearAlgebra[Transpose](small*A);\n else\n B := map(evalf,args[ 2]);\n if not type(B,'Matrix(complex(numeric))') then\n e rror \"the 2nd argument matrix entries must all evaluate to complex fl oats\"\n end if;\n end if;\n\n eps := Float(1,-saveDigits-1); \n prevdiff := Float(1,saveDigits*20);\n \n T := Matrix(n);\n\n \+ for k from 1 to maxit do\n T := A . B;\n for i from 1 to n do\n if evalf(abs(T[i,i]-1) > eps) then break end if;\n \+ end do;\n\n # Exit if all diagonal entries are sufficiently close to 1.\n if i=n+1 then\n Digits := saveDigits;\n \+ return evalf(B);\n end if;\n\n # If the sum of the magnitude s of the diagonal entries\n\011\011\011\011 # is a good bit larger th an n at this stage, and the\n\011\011\011\011 # difference between th is sum and n is not decreasing,\n\011\011\011\011 # assume that diver gence is occurring.\n if k > 3 then\n sum := 0;\n \+ for i from 1 to n do\n sum := sum + abs(T[i,i]);\n \+ end do;\n diff := abs(sum - n);\n if sum>n*10.0 and d iff>prevdiff then\n error \"divergence occurring\"\n \+ end if;\n prevdiff := diff;\n end if;\n \n B := \+ B.(2-T);\n if prntflg then\n print(`approximation `,k,` \+ -> `,B)\n end if;\n end do;\n Digits := saveDigits;\n pri nt(`last iteration gives`,map(evalf,B));\n error \"reached maximum, \+ %1,iterations without convergence\",maxit;\nend proc:" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1 ";" }}}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 39 "Examples \+ are given in the next section." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1 ";" }}}}{SECT 1 {PARA 4 "" 0 " " {TEXT 0 13 "NewtonInverse" }{TEXT -1 10 ": examples" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1 ";" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 10 "Example 1 " }}{PARA 0 "" 0 "" {TEXT -1 34 "We find the inverse of the matrix " }{XPPEDIT 18 0 "A = matrix([[3,-1],[1,2]])" "6#/%\"AG-%'matr ixG6#7$7$\"\"$,$\"\"\"!\"\"7$F,\"\"#" }{TEXT -1 20 " by Newton's metho d." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 84 "UseHardwareFloats := false;\nA := Matrix([[3,-1],[1,2 ]]):\nNewtonInverse(A,info=true);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#> %2UseHardwareFloatsG%&falseG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6&%/appr oximation~G\"\"\"%(~~->~~~G-%'RTABLEG6%\"*!=W*[\"-%'MATRIXG6#7$7$$\"/+ ++D1RD!#9$\"/+++++v$*!#:7$$!/+++++v$*F4$\"/+++vV[@F1%'MatrixG" }} {PARA 11 "" 1 "" {XPPMATH 20 "6&%/approximation~G\"\"#%(~~->~~~G-%'RTA BLEG6%\"*?l\\`\"-%'MATRIXG6#7$7$$\"/\"yv^!yVG!#9$\"/%4Ysnc@\"F17$$!/%4 Ysnc@\"F1$\"/)oa5eXB$F1%'MatrixG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6&%/ approximation~G\"\"$%(~~->~~~G-%'RTABLEG6%\"*/x\"3:-%'MATRIXG6#7$7$$\" />i5felG!#9$\"/v6W2$)z8F17$$!/v6W2$)z8F1$\"/b'*4ycLSF1%'MatrixG" }} {PARA 11 "" 1 "" {XPPMATH 20 "6&%/approximation~G\"\"%%(~~->~~~G-%'RTA BLEG6%\"*/()Qb\"-%'MATRIXG6#7$7$$\"/E]1*yw&G!#9$\"/5AskyD9F17$$!/4Asky D9F1$\"/@gaMDrUF1%'MatrixG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6&%/approx imation~G\"\"&%(~~->~~~G-%'RTABLEG6%\"*ox'f:-%'MATRIXG6#7$7$$\"/$42iWr &G!#9$\"/p5rAcG9F17$$!/o5rAcG9F1$\"/\\#[tmcG%F1%'MatrixG" }}{PARA 11 " " 1 "" {XPPMATH 20 "6&%/approximation~G\"\"'%(~~->~~~G-%'RTABLEG6%\"*w B6c\"-%'MATRIXG6#7$7$$\"/>;dG9dG!#9$\"/CZG9dG9F17$$!/CZG9dG9F1$\"/,?&G 9dG%F1%'MatrixG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6&%/approximation~G\" \"(%(~~->~~~G-%'RTABLEG6%\"*'pDi:-%'MATRIXG6#7$7$$\"/H9dG9dG!#9$\"/9dG 9dG9F17$$!/9dG9dG9F1$\"/Tr&G9dG%F1%'MatrixG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'RTABLEG6%\"*o?Fc\"-%'MATRIXG6#7$7$$\"+dG9dG!#5$\"+H9 dG9F.7$$!+H9dG9F.$\"+'G9dG%F.%'MatrixG" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "A^(-1);\nevalf(%);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#-%'RTABLEG6$\"(W1?&-%'MATRIXG6#7$7$#\" \"#\"\"(#\"\"\"F.7$#!\"\"F.#\"\"$F." }}{PARA 11 "" 1 "" {XPPMATH 20 "6 #-%'RTABLEG6$\")#p9(>-%'MATRIXG6#7$7$$\"+dG9dG!#5$\"+H9dG9F.7$$!+H9dG9 F.$\"+'G9dG%F." }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 1 ";" }}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 10 "Exa mple 2 " }}{PARA 0 "" 0 "" {TEXT -1 34 "We find the inverse of the mat rix " }{XPPEDIT 18 0 "A = matrix([[3,-1],[1,2]])" "6#/%\"AG-%'matrixG6 #7$7$\"\"$,$\"\"\"!\"\"7$F,\"\"#" }{TEXT -1 26 " by Newton's method us ing " }{XPPEDIT 18 0 "B=matrix([[0.3,.1],[-.1,.4]])" "6#/%\"BG-%'matri xG6#7$7$-%&FloatG6$\"\"$!\"\"-F+6$\"\"\"F.7$,$-F+6$F1F.F.-F+6$\"\"%F. " }{TEXT -1 29 " as a starting approximation." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 94 "A := Matrix( [[3,-1],[1,2]]):\nB := Matrix([[0.3,.15],[-.15,.4]]):\nNewtonInverse(A ,B,info=true);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6&%/approximation~G\" \"\"%(~~->~~~G-%'RTABLEG6$\")%)p7@-%'MATRIXG6#7$7$$\"$&G!\"$$\"%D9!\"% 7$$!%D9F4$\"%vUF4" }}{PARA 11 "" 1 "" {XPPMATH 20 "6&%/approximation~G \"\"#%(~~->~~~G-%'RTABLEG6$\")S8O@-%'MATRIXG6#7$7$$\"(Dr&G!\"($\")DcG9 !\")7$$!)DcG9F4$\")vo&G%F4" }}{PARA 11 "" 1 "" {XPPMATH 20 "6&%/approx imation~G\"\"$%(~~->~~~G-%'RTABLEG6$\")C)H<#-%'MATRIXG6#7$7$$\"/7.dG9d G!#9$\"/c^G9dG9F17$$!/c^G9dG9F1$\"/pa&G9dG%F1" }}{PARA 11 "" 1 "" {XPPMATH 20 "6&%/approximation~G\"\"%%(~~->~~~G-%'RTABLEG6$\");)3,#-%' MATRIXG6#7$7$$\"/H9dG9dG!#9$\"/:dG9dG9F17$$!/:dG9dG9F1$\"/Xr&G9dG%F1" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'RTABLEG6$\")C?M@-%'MATRIXG6#7$7$$ \"+dG9dG!#5$\"+H9dG9F.7$$!+H9dG9F.$\"+'G9dG%F." }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 6 "Using " }{XPPEDIT 18 0 "B \+ = matrix([[10, 1], [0, 4]]);" "6#/%\"BG-%'matrixG6#7$7$\"#5\"\"\"7$\" \"!\"\"%" }{TEXT -1 49 " as a starting approximation leads to divergen ce." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 87 "A := Matrix([[3,-1],[1,2]]):\nB := Matrix([[10,1],[0, 4]]):\nNewtonInverse(A,B,info=true);" }}{PARA 11 "" 1 "" {XPPMATH 20 " 6&%/approximation~G\"\"\"%(~~->~~~G-%'RTABLEG6$\");$)[?-%'MATRIXG6#7$7 $$!$!H\"\"!$\"\"$F17$$!#SF1$!#GF1" }}{PARA 11 "" 1 "" {XPPMATH 20 "6&% /approximation~G\"\"#%(~~->~~~G-%'RTABLEG6$\")G6>@-%'MATRIXG6#7$7$$!'q ,C\"\"!$\"&&*3\"F17$$!&SO%F1$!#gF1" }}{PARA 11 "" 1 "" {XPPMATH 20 "6& %/approximation~G\"\"$%(~~->~~~G-%'RTABLEG6$\")7iU@-%'MATRIXG6#7$7$$!- !\\!y'**e\"\"\"!$\"+:[*pu(F17$$!,!3T$e&HF1$\"+!=Q'H9F1" }}{PARA 11 "" 1 "" {XPPMATH 20 "6&%/approximation~G\"\"%%(~~->~~~G-%'RTABLEG6$\")Wr) =#-%'MATRIXG6#7$7$$!/(H'oB0Xp\"\"*$\"/R]1rw&Q$\"\")7$$!/ " 0 "" {MPLTEXT 1 0 1 ";" }}}}{SECT 1 {PARA 4 "" 0 " " {TEXT -1 10 "Example 3 " }}{PARA 0 "" 0 "" {TEXT -1 34 "We find the \+ inverse of the matrix " }{XPPEDIT 18 0 "A = matrix([[5, 7, 6, 5], [7, \+ 10, 8, 7], [6, 8, 10, 9], [5, 7, 9, 10]]);" "6#/%\"AG-%'matrixG6#7&7& \"\"&\"\"(\"\"'F*7&F+\"#5\"\")F+7&F,F/F.\"\"*7&F*F+F1F." }{TEXT -1 20 " by Newton's method." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 84 "A := Matrix([[5,7,6,5],[7,10,8,7],[6,8,10 ,9],[5,7,9,10]]):\nNewtonInverse(A);\nA^(-1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'RTABLEG6$\")csm>-%'MATRIXG6#7&7&$\"+++++o!\")$!+++++ TF.$!+++++$\"+++++?F:" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'RT ABLEG6$\")G\\R?-%'MATRIXG6#7&7&\"#o!#T!#<\"#57&F-\"#DF/!\"'7&F.F/\"\"& !\"$7&F/F2F5\"\"#" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 1 ";" }}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 10 "E xample 4 " }}{PARA 0 "" 0 "" {TEXT -1 51 "You can try finding the inve rse of a random matrix." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 96 "with(LinearAlgebra):\nA := RandomMa trix(4,generator=-20..20);\nNewtonInverse(A);\nA^(-1);\nevalf(%);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"AG-%'RTABLEG6$\")_tm?-%'MATRIXG6#7 &7&\"#>!\"$\"#?\"#87&\"#=\"\"(F3\"\"'7&!\"'\"\"&!#?F57&\"#:\"#-%'MATRIXG6# 7&7&$\"+3>8(3\"!#5$!+s:j>?F.$!+uC!o$**!#6$\"+/(=dJ\"F.7&$!+])[\"*3\"F. $\"+:817>F.$\"+gUOVvF3$!+RY]JhF37&$!+C+'GH'F3$\"+r)z!Q9F.$\"+GrFZKF3$! +p:4()zF37&$!+\"eS'G5F3$\"+pNe!=\"F.$\"+S%)zE6F.$!+FV'oN)F3" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'RTABLEG6$\")'\\^.#-%'MATRIXG6#7&7&#\"$R& \"%e\\#!%-:\"%Pu#!$R(F1#\"%d>\"&u[\"7&#!$q#\"%zC#\"$u%F:#\"$(=F:#!$_\" F:7&#!$c\"F:#\"$8(F.#\"$h\"F.#!$)>F:7&#!#^F.#\"$y)F1#\"$Q)F1#!%V7F6" } }{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'RTABLEG6$\")g*)Q?-%'MATRIXG6#7&7&$ \"+3>8(3\"!#5$!+s:j>?F.$!+uC!o$**!#6$\"+/(=dJ\"F.7&$!+])[\"*3\"F.$\"+: 817>F.$\"+gUOVvF3$!+RY]JhF37&$!+C+'GH'F3$\"+r)z!Q9F.$\"+GrFZKF3$!+p:4( )zF37&$!+\"eS'G5F3$\"+pNe!=\"F.$\"+S%)zE6F.$!+FV'oN)F3" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1 ";" }}}} {SECT 1 {PARA 4 "" 0 "" {TEXT -1 10 "Example 5 " }}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 1 ";" }}}{PARA 0 "" 0 "" {TEXT 274 57 "Checking th e accuracy of the entries in an inverse matrix" }{TEXT -1 1 "." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 66 "The comma nds below perform the following tasks:\nFirst the inverse " }{TEXT 285 1 "B" }{TEXT -1 8 " of a 4 " }{TEXT 283 1 "x" }{TEXT -1 10 " 4 mat rix " }{TEXT 284 1 "A" }{TEXT -1 33 " with random entries is computed. " }}{PARA 0 "" 0 "" {TEXT -1 17 "Then the inverse " }{TEXT 286 1 "B" } {TEXT -1 54 " is perurbed by a small random amount to get a matrix " } {XPPEDIT 18 0 "B[p]" "6#&%\"BG6#%\"pG" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 5 "With " }{XPPEDIT 18 0 "B[p]" "6#&%\"BG6#%\"pG" }{TEXT -1 125 " as the starting approximation, it usually takes only a few it erations of the Newton formula to return to the inverse matrix." }} {PARA 0 "" 0 "" {TEXT -1 66 "This gives a check on the accuracy of the original inverse matrix." }}{PARA 0 "" 0 "" {TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT 273 4 "Note" }{TEXT 30 76 ": The following commands make use of procedures defined in other worksheets." }}{PARA 0 "" 0 "" {TEXT 30 70 "You need to ensure that they are active before executing \+ the commands." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 195 "with(LinearAlgebra):\nA := RandomMatrix(4,gener ator=randnormal(20));\nB := A^(-1);\nC := RandomMatrix(4,generator=ran duniform(-0.01..0.01)):\nBp := B+C;\nB2 := NewtonInverse(A,Bp,info=fal se);\nB - B2;\n" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"AG-%'RTABLEG6$ \")[b3@-%'MATRIXG6#7&7&$\"+yTag6!\")$\"+(H\"o,&*!\"*$\"+yqR!R)!#5$!+NW F/#*F37&$\"+Yabc:F0$\"+^I3f5F0$!+-U33RF3$\"+N_QnQF37&$\"+@13?=F0$\"+F8 *31%F0$\"+LZ>=76#F0$!+c$eLn#F0$!+M8qw=F0$!+S5GSj F3" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"BG-%'RTABLEG6$\")+4i?-%'MATR IXG6#7&7&$\"+-%[!49!#5$!+!Ru$pF!#6$!+hL6\"[%F3$!+3l(f*GF37&$!+Z`]\"\\ \"F0$\"+c')e\"G)F3$\"+r@S$e&F3$\"++^U?FF37&$\"+!=z#=!)F3$!+)H#)z+\"F0$ !+3oqiGF3$!+GG*=\\&F37&$!+KPBkxF3$\"+DO\\QTF3$!*p.FZ\"F3$!+hfwV8F3" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%#BpG-%'RTABLEG6$\")C*p1#-%'MATRIXG6# 7&7&$\"+w\"fnY\"!#5$!+D5GLE!#6$!+=N:5NF3$!+FA'[F#F37&$!+EdEh9F0$\"+ns! )GxF3$\"+;n#Gq%F3$\"+og.#\\$F37&$\"+d)\\dV(F3$!+#RVGN*F3$!+9C)Gf$F3$!+ k0Y(p%F37&$!+h;X8rF3$\"+@9$[&\\F3$\"*`Usd&F3$!+%>\"H$\\\"F3" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#B2G-%'RTABLEG6$\");+-@-%'MATRIXG6#7&7&$\" +,%[!49!#5$!+)Qu$pF!#6$!+dL6\"[%F3$!+5l(f*GF37&$!+Y`]\"\\\"F0$\"+`')e \"G)F3$\"+n@S$e&F3$\"+(4D/s#F37&$\"+s\"z#=!)F3$!+)H#)z+\"F0$!+0oqiGF3$ !+IG*=\\&F37&$!+HPBkxF3$\"+CO\\QTF3$!+7Pqs9!#7$!+hfwV8F3" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#-%'RTABLEG6$\")7O(4#-%'MATRIXG6#7&7&$\"\"\"!#5$! \"#!#6$!\"%F1$\"\"#F17&$!\"\"F.$\"\"$F1$\"\"%F1F97&$\"\")F1$\"\"!FA$! \"$F1F47&FB$F-F1$\"#A!#7F@" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1 ";" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1 ";" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 4 "Task" }}{PARA 0 "" 0 "" {TEXT -1 4 "The " } {TEXT 273 14 "Hilbert matrix" }{TEXT -1 32 " of order n is the n x n m atrix " }{TEXT 272 1 "H" }{TEXT -1 19 " with i,j th entry " }{XPPEDIT 18 0 "H[i,j] = 1/(i+j-1);" "6#/&%\"HG6$%\"iG%\"jG*&\"\"\"F*,(F'F*F(F*F *!\"\"F," }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 75 "For a given p ositive integer n, this matrix can be constructed as follows:\n" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 125 "n := 4:\nH := Matrix(1..n,1 ..n):\nfor i from 1 to n do\n for j from 1 to n do\n H[i,j] := \+ 1/(i+j-1);\n end do;\nend do;\nH;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 39 "More simply, you can use the procedure \+ " }{TEXT 0 13 "HilbertMatrix" }{TEXT -1 10 " from the " }{TEXT 0 13 "L inearAlgebra" }{TEXT -1 10 " package.\n" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "with(LinearAlgebra):\nHilbertMatrix(4);" }}}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 62 "Find the inverses \+ of the Hilbert matrices of order 4, 5 and 6." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 78 "(a) with the coefficients given in exact rational form using the Maple format " }{TEXT 0 6 "H^(-1)" } {TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 73 "(b) with the coefficients given in exact rational form us ing the formula " }}{PARA 257 "" 0 "" {TEXT -1 1 " " }{XPPEDIT 18 0 "K [i,j] = (-1)^(i+j)*(n+i-1)!*(n+j-1)!/((i+j-1)*((i-1)!*(j-1)!)^2*(n-i)! *(n-j)!))" "6#/&%\"KG6$%\"iG%\"jG**),$\"\"\"!\"\",&F'F,F(F,F,-%*factor ialG6#,(%\"nGF,F'F,F,F-F,-F06#,(F3F,F(F,F,F-F,**,(F'F,F(F,F,F-F,*$*&-F 06#,&F'F,F,F-F,-F06#,&F(F,F,F-F,\"\"#F,-F06#,&F3F,F'F-F,-F06#,&F3F,F(F -F,F-" }{TEXT -1 2 ". " }}{PARA 0 "" 0 "" {TEXT -1 8 "for the " } {TEXT 287 1 "i" }{TEXT -1 1 "," }{TEXT 288 1 "j" }{TEXT -1 10 " th ent ry." }}{PARA 0 "" 0 "" {TEXT -1 86 "(c) with the coefficients given in exact rational form using Gauss-Jordan elimination." }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 106 "(d) with coefficients \+ in floating point form using Gauss-Jordan elimination and floating poi nt arithmetic." }}{PARA 0 "" 0 "" {TEXT -1 53 " Round the entries \+ to the nearest integer using " }{TEXT 275 12 "map(round,%)" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 82 "(e) with coefficients in floating point form using the Newton iter ative procedure " }{TEXT 0 13 "NewtonInverse" }{TEXT -1 26 " given in \+ this worksheet. " }}{PARA 0 "" 0 "" {TEXT -1 53 " Round the entrie s to the nearest integer using " }{TEXT 275 12 "map(round,%)" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 273 4 "Note" }{TEXT -1 382 ": In order to make a genuine comparison betwee n different (floating point) numerical methods for finding the inverse of a Hilbert matrix, one should first remove the inaccuracies introdu ced by the fact that the coefficients of the original matrix cannot be represented exasctly in floating point form. See the discussion of pa rtial pivoting in the worksheet on Gaussian elimination." }}{PARA 0 " " 0 "" {TEXT -1 37 "_____________________________________" }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 " " {TEXT -1 37 "_____________________________________" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1 ";" }}}}}{MARK "4 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }{RTABLE_HANDLES 148944180 153496520 150817704 155388704 155967768 156112376 156225696 156272068 }{RTABLE M7R0 I6RTABLE_SAVE/148944180X,%'sfloatG6"6"[gl!"%!!!#%"#"#$"/+++D1RD!#9$!/+++++v$*!# :$"/+++++v$*F,$"/+++vV[@F)F& } {RTABLE M7R0 I6RTABLE_SAVE/153496520X,%'sfloatG6"6"[gl!"%!!!#%"#"#$"/"yv^!yVG!#9$!/%4Ysnc@"F )$"/%4Ysnc@"F)$"/)oa5eXB$F)F& } {RTABLE M7R0 I6RTABLE_SAVE/150817704X,%'sfloatG6"6"[gl!"%!!!#%"#"#$"/>i5felG!#9$!/v6W2$)z8F) $"/v6W2$)z8F)$"/b'*4ycLSF)F& } {RTABLE M7R0 I6RTABLE_SAVE/155388704X,%'sfloatG6"6"[gl!"%!!!#%"#"#$"/E]1*yw&G!#9$!/4AskyD9F) $"/5AskyD9F)$"/@gaMDrUF)F& } {RTABLE M7R0 I6RTABLE_SAVE/155967768X,%'sfloatG6"6"[gl!"%!!!#%"#"#$"/$42iWr&G!#9$!/o5rAcG9F) $"/p5rAcG9F)$"/\#[tmcG%F)F& } {RTABLE M7R0 I6RTABLE_SAVE/156112376X,%'sfloatG6"6"[gl!"%!!!#%"#"#$"/>;dG9dG!#9$!/CZG9dG9F)$ "/CZG9dG9F)$"/,?&G9dG%F)F& } {RTABLE M7R0 I6RTABLE_SAVE/156225696X,%'sfloatG6"6"[gl!"%!!!#%"#"#$"/H9dG9dG!#9$!/9dG9dG9F)$ "/9dG9dG9F)$"/Tr&G9dG%F)F& } {RTABLE M7R0 I6RTABLE_SAVE/156272068X,%'sfloatG6"6"[gl!"%!!!#%"#"#$"+dG9dG!#5$!+H9dG9F)$"+H9 dG9F)$"+'G9dG%F)F& }