(*^ ::[ 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] *) $Post:=If[MatrixQ[#],MatrixForm[#],#]& (* :[font = input; initialization; preserveAspect] *) Exercise 2.3.1 (* :[font = input; initialization; preserveAspect; startGroup] *) b=Array[#&,5] (* :[font = output; output; inactive; preserveAspect; endGroup] {1, 2, 3, 4, 5} ;[o] {1, 2, 3, 4, 5} :[font = input; initialization; preserveAspect] *) a) (* :[font = input; initialization; preserveAspect; startGroup] *) Do[v[i]=Table[Mod[6-i-j,5]+1,{j,5}],{i,3}]; {v[1],v[2],v[3]} (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{5, 4, 3, 2, 1}, {4, 3, 2, 1, 5}, {3, 2, 1, 5, 4}}] ;[o] 5 4 3 2 1 4 3 2 1 5 3 2 1 5 4 :[font = input; initialization; preserveAspect; startGroup] *) LinearSolve[Transpose[Array[v[#]&,3]],b] (* :[font = message; inactive; preserveAspect] LinearSolve::nosol: Linear equation encountered which has no solution. :[font = output; output; inactive; preserveAspect; endGroup] LinearSolve[{{5, 4, 3}, {4, 3, 2}, {3, 2, 1}, {2, 1, 5}, {1, 5, 4}}, {1, 2, 3, 4, 5}] ;[o] LinearSolve[{{5, 4, 3}, {4, 3, 2}, {3, 2, 1}, {2, 1, 5}, {1, 5, 4}}, {1, 2, 3, 4, 5}] :[font = input; initialization; preserveAspect] *) No solution means b does not lie in the span of v1,v2,v3 (* :[font = input; initialization; preserveAspect] *) b) (* :[font = input; initialization; preserveAspect; startGroup] *) LinearSolve[Transpose[{{2,3,4,5,6},{3,4,5,6,7}}],b] (* :[font = output; output; inactive; preserveAspect; endGroup] {2, -1} ;[o] {2, -1} :[font = input; initialization; preserveAspect] *) We conclude that b is in the span of the two vectors above. (* :[font = input; initialization; preserveAspect] *) Exercise 2.3.2 (* :[font = input; initialization; preserveAspect; startGroup] *) b=Array[1&,5] (* :[font = output; output; inactive; preserveAspect; endGroup] {1, 1, 1, 1, 1} ;[o] {1, 1, 1, 1, 1} :[font = input; initialization; preserveAspect] *) a) (* :[font = input; initialization; preserveAspect; startGroup] *) v[1]={5,4,3,2,1}; v[2]={1,2,3,4,5}; v[3]={3,2,1,5,4}; LinearSolve[Transpose[{v[1],v[2],v[3]}],b] (* :[font = output; output; inactive; preserveAspect; endGroup] {1/6, 1/6, 0} ;[o] 1 1 {-, -, 0} 6 6 :[font = input; initialization; preserveAspect] *) b in the span. (* :[font = input; initialization; preserveAspect] *) b) (* :[font = input; initialization; preserveAspect; startGroup] *) v[1]={2,3,4,5,6}; v[2]={8,7,6,5,4}; v[3]={1,0,1,0,1}; LinearSolve[Transpose[Array[v[#]&,3]],b] (* :[font = output; output; inactive; preserveAspect; endGroup] {1/10, 1/10, 0} ;[o] 1 1 {--, --, 0} 10 10 :[font = input; initialization; preserveAspect] *) b in the span. (* :[font = input; initialization; preserveAspect] *) Exercise 3.2.3 (* :[font = input; initialization; preserveAspect] *) Do[w[i]=Table[i-j,{j,15}],{i,15}] (* :[font = input; initialization; preserveAspect; startGroup] *) v=Array[#&,15] (* :[font = output; output; inactive; preserveAspect; endGroup] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} ;[o] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} :[font = input; initialization; preserveAspect; startGroup] *) LinearSolve[Transpose[Array[w[#]&,15]],v] (* :[font = output; output; inactive; preserveAspect; endGroup] {-2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} ;[o] {-2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} :[font = input; initialization; preserveAspect] *) v is in the span of the w's. (* :[font = input; initialization; preserveAspect; startGroup] *) v=Array[#^2&,15] (* :[font = output; output; inactive; preserveAspect; endGroup] {1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225} ;[o] {1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225} :[font = input; initialization; preserveAspect; startGroup] *) LinearSolve[Transpose[Array[w[#]&,15]],v] (* :[font = message; inactive; preserveAspect] LinearSolve::nosol: Linear equation encountered which has no solution. :[font = output; output; inactive; preserveAspect; endGroup] LinearSolve[{{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, {-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, {-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, {-3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, {-4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, {-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8}, {-7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7}, {-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6}, {-9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5}, {-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4}, {-11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3}, {-12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2}, {-13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1}, {-14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0}}, {1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225}] ;[o] LinearSolve[{{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, {-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, {-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, {-3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, {-4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, {-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8}, {-7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7}, {-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6}, {-9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5}, {-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4}, {-11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3}, {-12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2}, {-13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1}, {-14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0}}, {1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225}] :[font = input; initialization; preserveAspect] *) This v is not in the span. (* :[font = input; initialization; preserveAspect] *) Clear[v] Do[v[i]=Table[1/(1+Mod[i-j,5]),{j,10}],{i,10}] (* :[font = input; initialization; preserveAspect] *) Exercise 2.3.4 (* :[font = input; initialization; preserveAspect; startGroup] *) Det[Array[v[#]&,10]] (* :[font = output; output; inactive; preserveAspect; endGroup] 0 ;[o] 0 :[font = input; initialization; preserveAspect] *) The v's are NOT linearly independent. (* :[font = input; initialization; preserveAspect; startGroup] *) Do[ \ x=LinearSolve[Transpose[Array[v[#]&,10-i]],v[11-i]]; \ Print[11-i,": ",x], \ {i,9}] (* :[font = print; inactive; preserveAspect] 10: {0, 0, 0, 0, 1, 0, 0, 0, 0} 9: {0, 0, 0, 1, 0, 0, 0, 0} 8: {0, 0, 1, 0, 0, 0, 0} 7: {0, 1, 0, 0, 0, 0} 6: {1, 0, 0, 0, 0} 1 1 1 1 1 1 1 1 1 5: LinearSolve[{{1, -, -, -}, {-, 1, -, -}, {-, -, 1, -}, 2 3 4 5 2 3 4 5 2 1 1 1 1 1 1 1 1 1 1 1 1 1 {-, -, -, 1}, {-, -, -, -}, {1, -, -, -}, {-, 1, -, -}, 3 4 5 2 3 4 5 2 3 4 5 2 3 1 1 1 1 1 1 1 1 1 1 {-, -, 1, -}, {-, -, -, 1}, {-, -, -, -}}, 4 5 2 3 4 5 2 3 4 5 1 1 1 1 1 1 1 1 {-, -, -, -, 1, -, -, -, -, 1}] 5 4 3 2 5 4 3 2 1 1 1 1 1 1 1 1 1 4: LinearSolve[{{1, -, -}, {-, 1, -}, {-, -, 1}, {-, -, -}, 2 3 5 2 4 5 3 4 5 1 1 1 1 1 1 1 1 1 1 1 1 {-, -, -}, {1, -, -}, {-, 1, -}, {-, -, 1}, {-, -, -}, 2 3 4 2 3 5 2 4 5 3 4 5 1 1 1 1 1 1 1 1 1 1 1 {-, -, -}}, {-, -, -, 1, -, -, -, -, 1, -}] 2 3 4 4 3 2 5 4 3 2 5 1 1 1 1 1 1 1 1 3: LinearSolve[{{1, -}, {-, 1}, {-, -}, {-, -}, {-, -}, 2 5 4 5 3 4 2 3 1 1 1 1 1 1 1 1 {1, -}, {-, 1}, {-, -}, {-, -}, {-, -}}, 2 5 4 5 3 4 2 3 1 1 1 1 1 1 1 1 {-, -, 1, -, -, -, -, 1, -, -}] 3 2 5 4 3 2 5 4 1 1 1 1 1 1 1 2: LinearSolve[{{1}, {-}, {-}, {-}, {-}, {1}, {-}, {-}, {-}, 5 4 3 2 5 4 3 1 1 1 1 1 1 1 1 1 {-}}, {-, 1, -, -, -, -, 1, -, -, -}] 2 2 5 4 3 2 5 4 3 :[font = message; inactive; preserveAspect] LinearSolve::nosol: Linear equation encountered which has no solution. :[font = message; inactive; preserveAspect] LinearSolve::nosol: Linear equation encountered which has no solution. :[font = message; inactive; preserveAspect] LinearSolve::nosol: Linear equation encountered which has no solution. :[font = message; inactive; preserveAspect; endGroup] General::stop: Further output of LinearSolve::nosol will be suppressed during this calculation. :[font = input; initialization; preserveAspect] *) Vectors 6-10 are linear combinations of the preceding, 2-5 are not. (* :[font = input; initialization; preserveAspect] *) Exercise 2.3.6 (* :[font = input; initialization; preserveAspect; startGroup] *) Length[NullSpace[Transpose[Array[v[#]&,5]]]] (* :[font = output; output; inactive; preserveAspect; endGroup] 0 ;[o] 0 :[font = input; initialization; preserveAspect] *) The vectors 1-5 ARE linearly independent. (* :[font = input; initialization; preserveAspect] *) Exercise 2.3.7 (* :[font = input; initialization; preserveAspect] *) See exercise 2.3.5 (* ^*)