(*^ ::[ 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 = "X Window System Mathematica Notebook Front End Version 2.2"; X11StandardFontEncoding; fontset = title, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e8, 24, fontName, "Times"; fontset = subtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e6, 18, fontName, "Times"; fontset = subsubtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, e6, 14, fontName, "Times"; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, a20, 18, fontName, "Times"; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, a15, 14, fontName, "Times"; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, a12, 12, fontName, "Times"; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "Times"; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, fontName, "Times"; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, L-5, 12, fontName, "Courier"; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, fontName, "Courier"; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, R65535, L-5, 12, fontName, "Courier"; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, fontName, "Courier"; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, B65535, L-5, 12, fontName, "Courier"; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, 12, fontName, "Courier"; fontset = name, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, 10, fontName, "Geneva"; fontset = header, inactive, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "Times"; fontset = leftheader, inactive, L2, 12, fontName, "Times"; fontset = footer, inactive, noKeepOnOnePage, preserveAspect, center, M7, 12, fontName, "Times"; fontset = leftfooter, inactive, L2, 12, fontName, "Times"; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, fontName, "Times"; fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "Times"; fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "Times"; fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "Times"; fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "Times"; fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "Times"; fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "Times"; fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "Times";paletteColors = 128; automaticGrouping; currentKernel; ] :[font = subsubtitle; inactive; preserveAspect; startGroup] Extra Credit Problem Gram-Schmidt Process Math221, Section 1 (G. McNinch) Solutions :[font = text; inactive; preserveAspect] Here are some functions we will use... NN is supposed to be "norm squared" and Norm is obviously the norm. ;[s] 5:0,0;39,1;41,2;79,3;83,4;106,-1; 5:1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0; :[font = input; preserveAspect] NN[x_] := x.x; Norm[x_] := Sqrt[ Evaluate[NN[ x ]] ]; ;[s] 1:0,0;53,-1; 1:1,0,0 ,Courier,1,12,0,0,0; :[font = text; inactive; preserveAspect] (a) The rows of A are as follows :[font = input; preserveAspect] r1 = {1/3, 2/3, 0, 2/3}; r2 = {0, 3, -1, 3/2}; :[font = text; inactive; preserveAspect] Since r1 is not a multiple of r2, these vectors are linearly independent and hence a basis for the rows space of A. :[font = text; inactive; preserveAspect] (b) We now apply Gram-Schmidt to produce an first an orthogonal basis {s1,s2} for Span(r1,r2). First take s1 = r1. Then compute s2. :[font = input; preserveAspect; startGroup] s1 = r1; s2 = r2 - (r2.r1 / NN[r1] ) r1; Print["The orthogonal basis vectors are: s1 = " ,s1," and s2 = ",s2] ;[s] 1:0,0;117,-1; 1:1,0,0 ,Courier,1,12,0,0,0; :[font = print; inactive; preserveAspect; endGroup] 1 2 2 The orthogonal basis vectors are: s1 = {-, -, 0, -} and 3 3 3 1 s2 = {-1, 1, -1, -(-)} 2 ;[s] 1:0,0;274,-1; 1:1,0,0 ,Courier,0,12,0,0,0; :[font = text; inactive; preserveAspect] Now we need actual Orthonormal basis vectors. Let us call the orthonormal basis {t1,t2}. Thus, we have :[font = input; preserveAspect; startGroup] t1 = (1/Norm[s1]) s1; t2 = (1/Norm[s2]) s2; Print["The orthogonal basis vectors are: t1 = " ,t1," and t2 = ",t2] :[font = print; inactive; preserveAspect; endGroup] 1 2 2 The orthogonal basis vectors are: t1 = {-, -, 0, -} and t2 = 3 3 3 -2 2 -2 1 {--------, --------, --------, -(--------)} Sqrt[13] Sqrt[13] Sqrt[13] Sqrt[13] :[font = input; preserveAspect] :[font = text; inactive; preserveAspect] (c). The formula for the projection of any vector x onto the subspace W is given by the following: ;[s] 5:0,0;52,1;53,2;72,3;73,4;103,-1; 5:1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0; :[font = input; preserveAspect] ProjW[x_] := (x.t1) t1 + (x.t2) t2 :[font = text; inactive; preserveAspect] Let v be e1 as specified in the problem... :[font = input; preserveAspect] e1 = {1,0,0,0}; :[font = text; inactive; preserveAspect] We compute v = w1 + w2 by taking w1 to be the projection of e1 on W and w2 = e1 - w1 :[font = input; preserveAspect; startGroup] w1 = ProjW[e1]; w2 = e1 - w1; Print["The decomposition {1,0,0,0} = w1 + w1 is as follows: "] Print[""] Print["w1 = ", w1] Print["w2 = ",w2] :[font = print; inactive; preserveAspect; endGroup] The decomposition {1,0,0,0} = w1 + w1 is as follows: 49 10 4 44 w1 = {---, -(---), --, ---} 117 117 13 117 68 10 4 44 w2 = {---, ---, -(--), -(---)} 117 117 13 117 :[font = text; inactive; preserveAspect] (d) We repeat the previous step except we replace e1 with e2... :[font = input; preserveAspect] e2 = {0,1,0,0}; :[font = input; preserveAspect; startGroup] v1 = ProjW[e2]; v2 = e2 - v1; Print["The decomposition {1,0,0,0} = v1 + v1 is as follows: "] Print[""] Print["v1 = ", v1] Print[""] Print["v2 = ",v2] :[font = print; inactive; preserveAspect; endGroup] The decomposition {1,0,0,0} = v1 + v1 is as follows: 10 88 4 34 v1 = {-(---), ---, -(--), ---} 117 117 13 117 10 29 4 34 v2 = {---, ---, --, -(---)} 117 117 13 117 :[font = text; inactive; preserveAspect] (e) Let me scrap the notation from the assignment. I will use w2 for the second component of e1 obtained in (c), and I will use v2 for the second component of e2 obtained in (d). ;[s] 9:0,0;75,1;77,2;106,3;108,4;151,5;153,6;182,7;184,8;201,-1; 9:1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0; :[font = text; inactive; preserveAspect] First let us observe that w2 and v2 are actually _in_ the space perpendicular to W. We can do this by checking that w2 is orthogonal to r1 and r2 (and similarly for v2). ;[s] 15:0,0;26,1;28,2;33,3;35,4;82,5;83,6;118,7;120,8;138,9;140,10;145,11;147,12;167,13;169,14;171,-1; 15:1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0; :[font = input; preserveAspect; startGroup] Print[" = ", w2.r1," = ", w2.r2] Print[" = ", v2.r1," = ", v2.r2] :[font = print; inactive; preserveAspect; endGroup] = 0 = 0 = 0 = 0 :[font = text; inactive; preserveAspect] Observe that they are all 0 as required. Next, let us observe that these vectors are linearly independent. Since there are only two vectors involved, it suffices to argue that neither is a multiple of the other. But that is clear by observation: :[font = input; preserveAspect; startGroup] Print["w2 = ",w2] Print["v2 = ",v2] :[font = print; inactive; preserveAspect; endGroup] 68 10 4 44 w2 = {---, ---, -(--), -(---)} 117 117 13 117 10 29 4 34 v2 = {---, ---, --, -(---)} 117 117 13 117 :[font = text; inactive; preserveAspect] Indeed, comparing third coordinates, if w2 were a multiple, say w2 = k v2, we'd learn that k = -1. But examining for example the first coordinate shows that k = -1 doesn't work. This verifies linear independence. I will omit here the proof that the perpendicular space to W has dimension two -- it follows from a result in the book (ask me later). If you believe that result, then it is immediate that { w2, v2 } is a basis. ;[s] 13:0,0;40,1;42,2;64,3;73,4;91,5;97,6;158,7;164,8;274,9;275,10;406,11;416,12;428,-1; 13:1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0; :[font = text; inactive; preserveAspect] (f) Recall that A is the following matrix: ;[s] 3:0,0;17,1;18,2;43,-1; 3:1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0; :[font = input; preserveAspect; startGroup] MatrixForm[A = {r1,r2}] :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1/3, 2/3, 0, 2/3}, {0, 3, -1, 3/2}}] ;[o] 1 2 2 - - - 3 3 0 3 3 - 0 3 -1 2 :[font = text; inactive; preserveAspect] We show that A w2 = 0 and A v2 = 0 as follows ;[s] 5:0,0;13,1;21,2;26,3;34,4;46,-1; 5:1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0; :[font = input; preserveAspect; startGroup] Print["A w2 = ", MatrixForm[Transpose[{A.w2}]]] Print[""] Print["A v2 = ", MatrixForm[Transpose[{A.v2}]]] :[font = print; inactive; preserveAspect; endGroup] A w2 = 0 0 A v2 = 0 0 :[font = text; inactive; preserveAspect] (g) We now use GramShmidt again on the basis {w2,v2}. Let us call the resulting orthogonal basis {s3,s4} (to pair up with our earlier basis {s1,s2} of W, remember?) We take s3 = w2 and compute s4 as follows: ;[s] 13:0,0;46,1;53,2;99,3;106,4;143,5;150,6;154,7;155,8;176,9;183,10;196,11;198,12;210,-1; 13:1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0; :[font = input; preserveAspect; startGroup] s3 = w2; s4 = v2 - ( v2 . s3 ) / NN[s3] s3; Print["The orthogonal basis vectors are: "] Print[""] Print["s3 = ",s3] Print[""] Print["s4 = ",s4] :[font = print; inactive; preserveAspect; endGroup] The orthogonal basis vectors are: 68 10 4 44 s3 = {---, ---, -(--), -(---)} 117 117 13 117 4 6 4 s4 = {0, --, --, -(--)} 17 17 17 :[font = text; inactive; preserveAspect] We now need to get the Orthonormal basis. We do this just like in part (b). Let us call the resulting basis {t3,t4} (to pair up with our earlier ON basis {t1,t2} ). ;[s] 5:0,0;109,1;116,2;156,3;163,4;166,-1; 5:1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0; :[font = input; preserveAspect; startGroup] t3 = (1/Norm[s3]) s3; t4 = (1/Norm[s4]) s4; Print["The orthogonal basis vectors are: "] Print[""] Print["t3 = ",t3] Print["t4 = ",t4] :[font = print; inactive; preserveAspect; endGroup] The orthogonal basis vectors are: 17 2 Sqrt[--] 13 5 -6 -22 t3 = {----------, -----------, ---------, -----------} 3 3 Sqrt[221] Sqrt[221] 3 Sqrt[221] 2 3 -2 t4 = {0, --------, --------, --------} Sqrt[17] Sqrt[17] Sqrt[17] :[font = text; inactive; preserveAspect] (h) Ok so the grammar in this question was bad. Here is the point: the set {t1,t2,t3,t4} is an ON basis for euclidean 4 space R4. Let us check that the inner products work... ;[s] 7:0,0;84,1;97,2;135,3;136,4;139,5;191,6;198,-1; 7:1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,33,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,33,12,0,0,0; :[font = input; preserveAspect; startGroup] Print[t1.t4," ",t1.t3] Print[t2.t4," ",t2.t3] :[font = print; inactive; preserveAspect; endGroup] 0 0 0 0 :[font = text; inactive; preserveAspect] (Why is it enough to just check just these four values?) This basis has the really nice(!!) property that {t1,t2} is a basis for W and {t3,t4} is a basis for W-perp. We already have the function ProjW[x] which computes the projection of a vector x onto W. We similarly define ProjWPerp ;[s] 19:0,0;77,1;93,2;109,3;116,4;132,5;133,6;138,7;145,8;161,9;167,10;198,11;206,12;250,13;251,14;257,15;258,16;281,17;290,18;291,-1; 19:1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0; :[font = input; preserveAspect] ProjWPerp[x_] := x.t3 t3 + x.t4 t4 :[font = text; inactive; preserveAspect] Just for laughs, lets compare some things we've already compute... :[font = input; preserveAspect; startGroup] Print["Here is ProjWPerp[e1] ",ProjWPerp[e1]] Print[""] Print["and here is w2 ", w2] :[font = print; inactive; preserveAspect; endGroup] 68 10 4 44 Here is ProjWPerp[e1] {---, ---, -(--), -(---)} 117 117 13 117 68 10 4 44 and here is w2 {---, ---, -(--), -(---)} 117 117 13 117 :[font = text; inactive; preserveAspect] We can always decompose any vector as follows: x = ProjW[x] + ProjWPerp[x] This question asks you to do this in case x = {a,a,b,b}. We are supposed to find the coordinate vector (x) {t1, t2, t3, t4} as well as decompose x as above. So here goes... ;[s] 11:0,0;49,1;76,2;122,3;135,4;185,5;189,6;205,7;206,8;227,9;228,10;257,-1; 11:1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,65,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0;1,0,0 ,Times,1,12,0,0,0;1,0,0 ,Times,0,12,0,0,0; :[font = input; preserveAspect; startGroup] x = {a,a,b,b}; Print["The coordinate vector of {a,a,b,b} for our ON basis is "] Print[Simplify[{x.t1, x.t2, x.t3, x.t4}]] Print[""] Print["The desired decomposition {a,a,b,b} = w1 + w2 is:"] Print[""] Print["w1 = ",Simplify[ProjW[x]]] Print[""] Print["w2 = ",Simplify[ProjWPerp[x]]] Print[""] Print["note that w1 + w2 = ",Simplify[ProjW[x] + ProjWPerp[x]]," as desired"] :[font = print; inactive; preserveAspect; endGroup; endGroup] The coordinate vector of {a,a,b,b} for our ON basis is 2 b -3 b 39 a - 40 b 2 a + b {a + ---, --------, -----------, --------} 3 Sqrt[13] 3 Sqrt[221] Sqrt[17] The desired decomposition {a,a,b,b} = w1 + w2 is: a 80 b 2 a 2 b 6 b 2 a 79 b w1 = {- + ----, --- - ---, ---, --- + ----} 3 117 3 117 13 3 117 2 (39 a - 40 b) a 2 b 7 b -2 a 38 b w2 = {---------------, - + ---, ---, ---- + ----} 117 3 117 13 3 117 note that w1 + w2 = {a, a, b, b} as desired ^*)