(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 6.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 11796, 431] NotebookOptionsPosition[ 9911, 357] NotebookOutlinePosition[ 10345, 376] CellTagsIndexPosition[ 10302, 373] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Orthogonal projection exercises ", "Section", CellChangeTimes->{{3.444573858355137*^9, 3.444573870248788*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"proj", "[", RowBox[{"y_", ",", "u_"}], "]"}], ":=", RowBox[{"Plus", "@@", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ FractionBox[ RowBox[{"y", ".", "#"}], RowBox[{"#", ".", "#"}]], "#"}], ")"}], "&"}], "/@", "u"}], ")"}]}]}]], "Input", CellChangeTimes->{{3.444574223146496*^9, 3.4445742516322727`*^9}, { 3.444574359843828*^9, 3.444574362175951*^9}, 3.444574532156714*^9, { 3.444574593372129*^9, 3.444574595468782*^9}, {3.444574707341674*^9, 3.444574780506961*^9}, {3.444574860940287*^9, 3.444574873403356*^9}, { 3.444575020476015*^9, 3.444575023642675*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[TextData[StyleBox["15", FontSize->16]], "Section", CellChangeTimes->{{3.444573264304192*^9, 3.444573264372031*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"proj", "[", RowBox[{ RowBox[{"{", RowBox[{"5", ",", RowBox[{"-", "9"}], ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "3"}], ",", RowBox[{"-", "5"}], ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "3"}], ",", "2", ",", "1"}], "}"}]}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.444574259957906*^9, 3.444574271782681*^9}, { 3.44457454923295*^9, 3.44457456617372*^9}, {3.44457459992122*^9, 3.4445746005121527`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"3", ",", RowBox[{"-", "9"}], ",", RowBox[{"-", "1"}]}], "}"}]], "Output", CellChangeTimes->{3.444574566643935*^9, 3.4445746010306396`*^9, 3.4445748815434237`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{ SqrtBox[ RowBox[{"#", ".", "#"}]], "&"}], "[", RowBox[{ RowBox[{"{", RowBox[{"5", ",", RowBox[{"-", "9"}], ",", "5"}], "}"}], "-", "%"}], "]"}]], "Input", CellChangeTimes->{{3.444573271498948*^9, 3.444573341721055*^9}, { 3.444574182490117*^9, 3.444574184223619*^9}, {3.444574576475319*^9, 3.444574576808148*^9}}], Cell[BoxData[ RowBox[{"2", " ", SqrtBox["10"]}]], "Output", CellChangeTimes->{ 3.444573343559429*^9, 3.4445741847922783`*^9, 3.4445742882967587`*^9, { 3.444574577536562*^9, 3.444574603760149*^9}, 3.4445748833170223`*^9}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[StyleBox["17", FontSize->16]], "Section", CellChangeTimes->{{3.444573264304192*^9, 3.444573264372031*^9}, { 3.4445733794148397`*^9, 3.4445733798227673`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"u", "=", RowBox[{"Transpose", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"2", ",", "1", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", "2", ",", "1"}], "}"}]}], "}"}], "/", "3"}], "]"}]}]], "Input", CellChangeTimes->{{3.444573388827188*^9, 3.444573446097574*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ FractionBox["2", "3"], ",", RowBox[{"-", FractionBox["2", "3"]}]}], "}"}], ",", RowBox[{"{", RowBox[{ FractionBox["1", "3"], ",", FractionBox["2", "3"]}], "}"}], ",", RowBox[{"{", RowBox[{ FractionBox["2", "3"], ",", FractionBox["1", "3"]}], "}"}]}], "}"}]], "Output", CellChangeTimes->{3.444573448243499*^9, 3.44457450502754*^9, 3.444574889825132*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"Transpose", "[", "u", "]"}], ".", "u"}]], "Input", CellChangeTimes->{{3.444573453054021*^9, 3.444573457553164*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{3.444573460474538*^9, 3.444574890077721*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"u", ".", RowBox[{"Transpose", "[", "u", "]"}]}]], "Input", CellChangeTimes->{{3.444573453054021*^9, 3.444573469479104*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ FractionBox["8", "9"], ",", RowBox[{"-", FractionBox["2", "9"]}], ",", FractionBox["2", "9"]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", FractionBox["2", "9"]}], ",", FractionBox["5", "9"], ",", FractionBox["4", "9"]}], "}"}], ",", RowBox[{"{", RowBox[{ FractionBox["2", "9"], ",", FractionBox["4", "9"], ",", FractionBox["5", "9"]}], "}"}]}], "}"}]], "Output", CellChangeTimes->{3.444573470072135*^9, 3.444574509177281*^9, 3.444574890164496*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"%", ".", RowBox[{"{", RowBox[{"4", ",", "8", ",", "1"}], "}"}]}]], "Input", CellChangeTimes->{{3.4445734891355133`*^9, 3.444573493081101*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"2", ",", "4", ",", "5"}], "}"}]], "Output", CellChangeTimes->{3.444573493652981*^9, 3.4445745115775948`*^9, 3.4445748902486343`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"proj", "[", RowBox[{ RowBox[{"{", RowBox[{"4", ",", "8", ",", "1"}], "}"}], ",", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"2", ",", "1", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", "2", ",", "1"}], "}"}]}], "}"}], "/", "3"}]}], "]"}]], "Input", CellChangeTimes->{{3.444573271498948*^9, 3.444573341721055*^9}, { 3.444573507933659*^9, 3.444573574105805*^9}, {3.4445742944462214`*^9, 3.444574302372802*^9}, {3.44457433791675*^9, 3.444574342083077*^9}, { 3.444574374361145*^9, 3.444574378381631*^9}, {3.444574612122704*^9, 3.4445746127832327`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"2", ",", "4", ",", "5"}], "}"}]], "Output", CellChangeTimes->{{3.44457354614447*^9, 3.4445735745920677`*^9}, 3.444574309828597*^9, 3.44457434255902*^9, 3.444574382145822*^9, 3.4445746132614193`*^9, 3.444574890331361*^9}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[StyleBox["18", FontSize->16]], "Section", CellChangeTimes->{{3.444573264304192*^9, 3.444573264372031*^9}, { 3.4445733794148397`*^9, 3.4445733798227673`*^9}, {3.4445737889543*^9, 3.4445737893324137`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"#", ".", "#"}], "&"}], "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", RowBox[{"-", "3"}]}], "}"}], "/", SqrtBox["10"]}], "]"}]], "Input", CellChangeTimes->{{3.444573453054021*^9, 3.444573457553164*^9}, { 3.4445736236593657`*^9, 3.444573654710102*^9}}], Cell[BoxData["1"], "Output", CellChangeTimes->{ 3.444573460474538*^9, {3.4445736427357407`*^9, 3.444573655224387*^9}, 3.444574634494624*^9, 3.444574903688203*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"Outer", "[", RowBox[{"Times", ",", "#", ",", "#"}], "]"}], "&"}], "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", RowBox[{"-", "3"}]}], "}"}], "/", SqrtBox["10"]}], "]"}]], "Input", CellChangeTimes->{{3.444573453054021*^9, 3.444573469479104*^9}, { 3.444573661451833*^9, 3.4445736694877787`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ FractionBox["1", "10"], ",", RowBox[{"-", FractionBox["3", "10"]}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", FractionBox["3", "10"]}], ",", FractionBox["9", "10"]}], "}"}]}], "}"}]], "Output", CellChangeTimes->{3.444573470072135*^9, 3.444573670090364*^9, 3.444574634760384*^9, 3.444574903939477*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"%", ".", RowBox[{"{", RowBox[{"7", ",", "9"}], "}"}]}]], "Input", CellChangeTimes->{{3.4445734891355133`*^9, 3.444573493081101*^9}, { 3.4445736767446337`*^9, 3.444573677239396*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", "6"}], "}"}]], "Output", CellChangeTimes->{3.444573493652981*^9, 3.4445736777848253`*^9, 3.444574634861305*^9, 3.4445749040246143`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"proj", "[", RowBox[{ RowBox[{"{", RowBox[{"7", ",", "9"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", RowBox[{"-", "3"}]}], "}"}], "/", SqrtBox["10"]}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.444573271498948*^9, 3.444573341721055*^9}, { 3.444573507933659*^9, 3.444573574105805*^9}, {3.4445736871003*^9, 3.444573699887484*^9}, {3.4445746281225367`*^9, 3.4445746804960947`*^9}, { 3.444574791700468*^9, 3.4445747932986307`*^9}, {3.444574996983655*^9, 3.44457499952913*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", "6"}], "}"}]], "Output", CellChangeTimes->{{3.4445747937251587`*^9, 3.444574796288804*^9}, 3.444574904108794*^9, 3.444575027796598*^9}] }, Open ]], Cell["\<\ Note: When projecting onto a single vector, u must be given as a one-element \ list!\ \>", "Text", CellChangeTimes->{{3.4445749269541273`*^9, 3.444574969303447*^9}, { 3.444575043596045*^9, 3.444575072918593*^9}}] }, Open ]] }, WindowSize->{929, 653}, WindowMargins->{{47, Automatic}, {Automatic, 4}}, PrintingCopies->1, PrintingPageRange->{1, Automatic}, ShowSelection->True, Magnification->1., FrontEndVersion->"6.0 for Mac OS X PowerPC (32-bit) (April 20, 2007)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 117, 1, 67, "Section"], Cell[710, 26, 683, 18, 46, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[1430, 49, 122, 2, 63, "Section"], Cell[CellGroupData[{ Cell[1577, 55, 570, 18, 27, "Input"], Cell[2150, 75, 214, 6, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[2401, 86, 377, 11, 32, "Input"], Cell[2781, 99, 230, 5, 32, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[3060, 110, 175, 3, 63, "Section"], Cell[CellGroupData[{ Cell[3260, 117, 384, 12, 27, "Input"], Cell[3647, 131, 484, 17, 45, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[4168, 153, 151, 3, 27, "Input"], Cell[4322, 158, 235, 7, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[4594, 170, 151, 3, 27, "Input"], Cell[4748, 175, 609, 21, 45, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[5394, 201, 174, 4, 27, "Input"], Cell[5571, 207, 176, 4, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[5784, 216, 684, 18, 27, "Input"], Cell[6471, 236, 269, 5, 27, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[6789, 247, 224, 4, 63, "Section"], Cell[CellGroupData[{ Cell[7038, 255, 320, 10, 37, "Input"], Cell[7361, 267, 169, 3, 38, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[7567, 275, 368, 11, 37, "Input"], Cell[7938, 288, 426, 14, 51, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[8401, 307, 215, 5, 27, "Input"], Cell[8619, 314, 207, 5, 38, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[8863, 324, 581, 15, 37, "Input"], Cell[9447, 341, 208, 5, 38, "Output"] }, Open ]], Cell[9670, 349, 225, 5, 41, "Text"] }, Open ]] } ] *) (* End of internal cache information *)