(*^ ::[ Information = "This is a Mathematica Notebook file. It contains ASCII text, and can be transferred by email, ftp, or other text-file transfer utility. It should be read or edited using a copy of Mathematica or MathReader. If you received this as email, use your mail application or copy/paste to save everything from the line containing (*^ down to the line containing ^*) into a plain text file. On some systems you may have to give the file a name ending with ".ma" to allow Mathematica to recognize it as a Notebook. The line below identifies what version of Mathematica created this file, but it can be opened using any other version as well."; FrontEndVersion = "Macintosh Mathematica Notebook Front End Version 2.2"; MacintoshStandardFontEncoding; fontset = title, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e8, 24, "Times"; fontset = subtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e6, 18, "Times"; fontset = subsubtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, e6, 14, "Times"; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, a20, 18, "Times"; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, a15, 14, "Times"; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, a12, 12, "Times"; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times"; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, L-5, 12, "Courier"; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier"; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, R65535, L-5, 12, "Courier"; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier"; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, B65535, L-5, 12, "Courier"; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, 12, "Courier"; fontset = name, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, 10, "Geneva"; fontset = header, inactive, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = leftheader, inactive, L2, 12, "Times"; fontset = footer, inactive, noKeepOnOnePage, preserveAspect, center, M7, 12, "Times"; fontset = leftfooter, inactive, L2, 12, "Times"; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times"; fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; paletteColors = 128; automaticGrouping; currentKernel; ] :[font = input; initialization; preserveAspect] *) Exercise 1.2.1 (* :[font = input; initialization; preserveAspect] *) M={{2,1,4,41/4},{3,3/2,34/5,41/12},{0,2/3,5,35/4}}; (* :[font = input; initialization; preserveAspect; startGroup] *) R=RowReduce[M]; R//MatrixForm (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1, 0, 0, -10597/384}, {0, 1, 0, 8015/64}, {0, 0, 1, -1435/96}}] ;[o] 10597 -(-----) 1 0 0 384 8015 ---- 0 1 0 64 1435 -(----) 0 0 1 96 :[font = input; initialization; preserveAspect; startGroup] *) Do[x[i]=R[[i,4]],{i,1,3}]; {x[1],x[2],x[3]} (* :[font = output; output; inactive; preserveAspect; endGroup] {-10597/384, 8015/64, -1435/96} ;[o] 10597 8015 1435 {-(-----), ----, -(----)} 384 64 96 :[font = input; initialization; preserveAspect; startGroup] *) Do[Print[Simplify[Sum[M[[i,j]]x[j],{j,1,3}]]," ",M[[i,4]]],{i,1,3}] (* :[font = print; inactive; preserveAspect; endGroup] 41 41 -- -- 4 4 41 41 -- -- 12 12 35 35 -- -- 4 4 :[font = input; initialization; preserveAspect] *) Result check O.K. (* :[font = input; initialization; preserveAspect] *) Clear[x] (* :[font = input; initialization; preserveAspect] *) Exercise 1.2.2 (* :[font = input; initialization; preserveAspect; startGroup] *) M={{-142/35,-284/35,32/5,194/35,134/35}, \ {-3/2,-3,2,3/2,1/2}, \ {24/7,48/7,-4,-18/7,2/7}}; \ M//MatrixForm (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{-142/35, -284/35, 32/5, 194/35, 134/35}, {-3/2, -3, 2, 3/2, 1/2}, {24/7, 48/7, -4, -18/7, 2/7}}] ;[o] 142 284 32 194 134 -(---) -(---) -- --- --- 35 35 5 35 35 3 3 1 -(-) - - 2 -3 2 2 2 24 48 18 2 -- -- -(--) - 7 7 -4 7 7 :[font = input; initialization; preserveAspect; startGroup] *) R=RowReduce[M]; R//MatrixForm (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1, 2, 0, 1, 3}, {0, 0, 1, 3/2, 5/2}, {0, 0, 0, 0, 0}}] ;[o] 1 2 0 1 3 3 5 - - 0 0 1 2 2 0 0 0 0 0 :[font = input; initialization; preserveAspect; startGroup] *) R={R[[1]],R[[2]],{0,1,0,0,x[2]},{0,0,0,1,x[4]}}; R//MatrixForm (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1, 2, 0, 1, 3}, {0, 0, 1, 3/2, 5/2}, {0, 1, 0, 0, x[2]}, {0, 0, 0, 1, x[4]}}] ;[o] 1 2 0 1 3 3 5 - - 0 0 1 2 2 0 1 0 0 x[2] 0 0 0 1 x[4] :[font = input; initialization; preserveAspect; startGroup] *) RR=RowReduce[R] (* :[font = output; output; inactive; preserveAspect; endGroup] {{1, 0, 0, 0, 3 - 2*x[2] - x[4]}, {0, 1, 0, 0, x[2]}, {0, 0, 1, 0, 5/2 - (3*x[4])/2}, {0, 0, 0, 1, x[4]}} ;[o] {{1, 0, 0, 0, 3 - 2 x[2] - x[4]}, {0, 1, 0, 0, x[2]}, 5 3 x[4] {0, 0, 1, 0, - - ------}, {0, 0, 0, 1, x[4]}} 2 2 :[font = input; initialization; preserveAspect; startGroup] *) Do[x[i]=RR[[i,5]],{i,1,4}]; {x[1],x[2],x[3],x[4]} (* :[font = output; output; inactive; preserveAspect; endGroup] {3 - 2*x[2] - x[4], x[2], 5/2 - (3*x[4])/2, x[4]} ;[o] 5 3 x[4] {3 - 2 x[2] - x[4], x[2], - - ------, x[4]} 2 2 :[font = input; initialization; preserveAspect; startGroup] *) Do[Print[Simplify[Sum[M[[i,j]]x[j],{j,1,4}]]," ",M[[i,5]]],{i,1,3}] (* :[font = print; inactive; preserveAspect; endGroup] 134 134 --- --- 35 35 1 1 - - 2 2 2 2 - - 7 7 :[font = input; initialization; preserveAspect] *) Clear[x] (* :[font = input; initialization; preserveAspect] *) Exercise 1.2.3 (* :[font = input; initialization; preserveAspect; startGroup] *) M={{0,3,-4,5/3,23/12}, \ {2,7,4/3,3,41/4}, \ {1/2,-3,2,13/3,41/12}, \ {7/6,7/3,-14/9,7,35/4}}; M//MatrixForm (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{0, 3, -4, 5/3, 23/12}, {2, 7, 4/3, 3, 41/4}, {1/2, -3, 2, 13/3, 41/12}, {7/6, 7/3, -14/9, 7, 35/4}}] ;[o] 5 23 - -- 0 3 -4 3 12 4 41 - -- 2 7 3 3 4 1 13 41 - -- -- 2 -3 2 3 12 7 7 14 35 - - -(--) -- 6 3 9 7 4 :[font = input; initialization; preserveAspect; startGroup] *) M=M[[{2,1,3,4}]]; M[[1]]/=M[[1,1]]; M[[3]]-=M[[1]]/2; M[[4]]-=7M[[1]]/6; M//MatrixForm (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1, 7/2, 2/3, 3/2, 41/8}, {0, 3, -4, 5/3, 23/12}, {0, -19/4, 5/3, 43/12, 41/48}, {0, -7/4, -7/3, 21/4, 133/48}}] ;[o] 7 2 3 41 - - - -- 1 2 3 2 8 5 23 - -- 0 3 -4 3 12 19 5 43 41 -(--) - -- -- 0 4 3 12 48 7 7 21 133 -(-) -(-) -- --- 0 4 3 4 48 :[font = input; initialization; preserveAspect; startGroup] *) M[[2]]/=M[[2,2]]; M[[3]]+=19M[[2]]/4; M[[4]]+=7M[[2]]/4; M//MatrixForm (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1, 7/2, 2/3, 3/2, 41/8}, {0, 1, -4/3, 5/9, 23/36}, {0, 0, -14/3, 56/9, 35/9}, {0, 0, -14/3, 56/9, 35/9}}] ;[o] 7 2 3 41 - - - -- 1 2 3 2 8 4 5 23 -(-) - -- 0 1 3 9 36 14 56 35 -(--) -- -- 0 0 3 9 9 14 56 35 -(--) -- -- 0 0 3 9 9 :[font = input; initialization; preserveAspect; startGroup] *) M[[3]]/=M[[3,3]]; Do[x[4-i]=Simplify[M[[4-i,5]]-Sum[M[[4-i,j]]x[j],{j,5-i,4}]], \ {i,1,3}]; S={x[1],x[2],x[3],x[4]} (* :[font = output; output; inactive; preserveAspect; endGroup] {22/3 - (20*x[4])/3, (-17 + 44*x[4])/36, (-5 + 8*x[4])/6, x[4]} ;[o] 22 20 x[4] -17 + 44 x[4] -5 + 8 x[4] {-- - -------, -------------, -----------, x[4]} 3 3 36 6 :[font = input; initialization; preserveAspect; startGroup] *) Do[Print[Simplify[Sum[M[[i,j]]x[j],{j,1,4}]]," ",M[[i,5]]],{i,1,4}] (* :[font = print; inactive; preserveAspect; endGroup] 41 41 -- -- 8 8 23 23 -- -- 36 36 5 5 -(-) -(-) 6 6 35 35 -- -- 9 9 :[font = input; initialization; preserveAspect] *) Clear[x] (* :[font = input; initialization; preserveAspect] *) Exercise 1.2.4 (* :[font = input; initialization; preserveAspect; startGroup] *) M={{3,2,-3,4,5}, \ {2,7,11,-3,41}, \ {2,-5,3,5,12}, \ {6,3,-49,2,34}}; M//MatrixForm (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{3, 2, -3, 4, 5}, {2, 7, 11, -3, 41}, {2, -5, 3, 5, 12}, {6, 3, -49, 2, 34}}] ;[o] 3 2 -3 4 5 2 7 11 -3 41 2 -5 3 5 12 6 3 -49 2 34 :[font = input; initialization; preserveAspect; startGroup] *) M[[1]]/=M[[1,1]]; M[[2]]-=2M[[1]]; M[[3]]-=2M[[1]]; M[[4]]-=2M[[1]]*3; M//MatrixForm (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1, 2/3, -1, 4/3, 5/3}, {0, 17/3, 13, -17/3, 113/3}, {0, -19/3, 5, 7/3, 26/3}, {0, -1, -43, -6, 24}}] ;[o] 2 4 5 - - - 1 3 -1 3 3 17 17 113 -- -(--) --- 0 3 13 3 3 19 7 26 -(--) - -- 0 3 5 3 3 0 -1 -43 -6 24 :[font = input; initialization; preserveAspect; startGroup] *) M[[2]]/=M[[2,2]]; M[[3]]+=19M[[2]]/3; M[[4]]+=M[[2]]; M//MatrixForm (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1, 2/3, -1, 4/3, 5/3}, {0, 1, 39/17, -1, 113/17}, {0, 0, 332/17, -4, 863/17}, {0, 0, -692/17, -7, 521/17}}] ;[o] 2 4 5 - - - 1 3 -1 3 3 39 113 -- --- 0 1 17 -1 17 332 863 --- --- 0 0 17 -4 17 692 521 -(---) --- 0 0 17 -7 17 :[font = input; initialization; preserveAspect; startGroup] *) M[[3]]/=M[[3,3]]; M[[4]]+=692M[[3]]/17; M//MatrixForm (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1, 2/3, -1, 4/3, 5/3}, {0, 1, 39/17, -1, 113/17}, {0, 0, 1, -17/83, 863/332}, {0, 0, 0, -1273/83, 11326/83}}] ;[o] 2 4 5 - - - 1 3 -1 3 3 39 113 -- --- 0 1 17 -1 17 17 863 -(--) --- 0 0 1 83 332 1273 11326 -(----) ----- 0 0 0 83 83 :[font = input; initialization; preserveAspect; startGroup] *) M[[4]]/=M[[4,4]]; Do[x[4-i]=Simplify[M[[4-i,5]]-Sum[M[[4-i,j]]x[j],{j,5-i,4}]], \ {i,0,3}]; S={x[1],x[2],x[3],x[4]} (* :[font = output; output; inactive; preserveAspect; endGroup] {86539/5092, -20535/5092, 3957/5092, -11326/1273} ;[o] 86539 20535 3957 11326 {-----, -(-----), ----, -(-----)} 5092 5092 5092 1273 :[font = input; initialization; preserveAspect; startGroup] *) Do[Print[Simplify[Sum[M[[i,j]]x[j],{j,1,4}]]," ",M[[i,5]]],{i,1,4}] (* :[font = print; inactive; preserveAspect; endGroup] 5 5 - - 3 3 113 113 --- --- 17 17 863 863 --- --- 332 332 11326 11326 -(-----) -(-----) 1273 1273 :[font = input; initialization; preserveAspect] *) Clear[x] (* :[font = input; initialization; preserveAspect] *) Exercise 1.2.5 (* :[font = input; initialization; preserveAspect; startGroup] *) M={{3,2,-3,4,5}, \ {2,7,11,-3,41}}; M//MatrixForm (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{3, 2, -3, 4, 5}, {2, 7, 11, -3, 41}}] ;[o] 3 2 -3 4 5 2 7 11 -3 41 :[font = input; initialization; preserveAspect; startGroup] *) M[[1]]/=M[[1,1]]; M[[2]]-=2M[[1]]; M//MatrixForm (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1, 2/3, -1, 4/3, 5/3}, {0, 17/3, 13, -17/3, 113/3}}] ;[o] 2 4 5 - - - 1 3 -1 3 3 17 17 113 -- -(--) --- 0 3 13 3 3 :[font = input; initialization; preserveAspect; startGroup] *) M[[2]]/=M[[2,2]]; Do[x[4-i]=Simplify[M[[4-i,5]]-Sum[M[[4-i,j]]x[j],{j,5-i,4}]], \ {i,2,3}]; S={x[1],x[2],x[3],x[4]} (* :[font = output; output; inactive; preserveAspect; endGroup] {(-47 + 43*x[3] - 34*x[4])/17, 113/17 - (39*x[3])/17 + x[4], x[3], x[4]} ;[o] -47 + 43 x[3] - 34 x[4] 113 39 x[3] {-----------------------, --- - ------- + x[4], x[3], x[4]} 17 17 17 :[font = input; initialization; preserveAspect; startGroup] *) Do[Print[Simplify[Sum[M[[i,j]]x[j],{j,1,4}]]," ",M[[i,5]]],{i,1,2}] (* :[font = print; inactive; preserveAspect; endGroup] 5 5 - - 3 3 113 113 --- --- 17 17 :[font = input; initialization; preserveAspect] *) Clear[x] (* :[font = input; initialization; preserveAspect] *) Exercise 1.2.6 (* :[font = input; initialization; preserveAspect; startGroup] *) M={{2,3,3,-2,3}, \ {1,2,1,-1,1}, \ {4,7,5,-4,12}}; M//MatrixForm (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{2, 3, 3, -2, 3}, {1, 2, 1, -1, 1}, {4, 7, 5, -4, 12}}] ;[o] 2 3 3 -2 3 1 2 1 -1 1 4 7 5 -4 12 :[font = input; initialization; preserveAspect; startGroup] *) M[[1]]/=M[[1,1]]; M[[2]]-=M[[1]]; M[[3]]-=4M[[1]]; M//MatrixForm (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1, 3/2, 3/2, -1, 3/2}, {0, 1/2, -1/2, 0, -1/2}, {0, 1, -1, 0, 6}}] ;[o] 3 3 3 - - - 1 2 2 -1 2 1 1 1 - -(-) -(-) 0 2 2 0 2 0 1 -1 0 6 :[font = input; initialization; preserveAspect; startGroup] *) M[[2]]/=M[[2,2]]; M[[3]]-=M[[2]]; M//MatrixForm (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1, 3/2, 3/2, -1, 3/2}, {0, 1, -1, 0, -1}, {0, 0, 0, 0, 7}}] ;[o] 3 3 3 - - - 1 2 2 -1 2 0 1 -1 0 -1 0 0 0 0 7 :[font = input; initialization; preserveAspect] *) No solution (see last row). (* :[font = input; initialization; preserveAspect] *) Exercise 1.2.10 (This exercise has been inserted here because it needs to be run prior to any other call to AppendRows in a Mathematica session.) (* :[font = input; initialization; preserveAspect; startGroup] *) A={{1,2}}; B={{3,4}}; AppendRows[A,B] (* :[font = output; output; inactive; preserveAspect; endGroup] AppendRows[{{1, 2}}, {{3, 4}}] ;[o] AppendRows[{{1, 2}}, {{3, 4}}] :[font = input; initialization; preserveAspect; startGroup] *) <