(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 8.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 157, 7] NotebookDataLength[ 4325, 142] NotebookOptionsPosition[ 3682, 114] NotebookOutlinePosition[ 4066, 131] CellTagsIndexPosition[ 4023, 128] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[BoxData[""], "Input", CellChangeTimes->{{3.52751219264989*^9, 3.5275121948806934`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"NormaVec", "[", RowBox[{"x_", ",", "norma_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{ RowBox[{"norma", " ", "euclideana"}], " ", "=", " ", "2"}], ",", " ", RowBox[{ RowBox[{"norma", " ", "1"}], " ", "=", " ", "1"}], ",", " ", RowBox[{ RowBox[{"norma", " ", "infinity"}], " ", "=", " ", "0"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"Which", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"norma", "\[Equal]", "2"}], ",", "\[IndentingNewLine]", RowBox[{"Sqrt", "[", RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"x", "[", RowBox[{"[", "i", "]"}], "]"}], "^", "2"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "x", "]"}]}], "}"}]}], "]"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"norma", "\[Equal]", "1"}], ",", "\[IndentingNewLine]", RowBox[{"Sum", "[", RowBox[{ RowBox[{"Abs", "[", RowBox[{"x", "[", RowBox[{"[", "i", "]"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "x", "]"}]}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"norma", "\[Equal]", "0"}], ",", "\[IndentingNewLine]", RowBox[{"Max", "[", RowBox[{"Abs", "[", "x", "]"}], "]"}]}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.527512155100624*^9, 3.5275122659388185`*^9}, 3.5275139306653376`*^9, {3.5275139979159513`*^9, 3.527514107254746*^9}, { 3.527514209663727*^9, 3.527514239014442*^9}, {3.5275142972077827`*^9, 3.5275143043112135`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"NormaVec", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "2", ",", "3"}], "}"}], ",", "0"}], "]"}]], "Input", CellChangeTimes->{{3.527514121673732*^9, 3.527514146720504*^9}}], Cell[BoxData["3"], "Output", CellChangeTimes->{3.527514147916907*^9, 3.527514247451413*^9, 3.5275143085016146`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"NormaVec", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "2", ",", "3"}], "}"}], ",", "2"}], "]"}]], "Input", CellChangeTimes->{{3.5275141569753857`*^9, 3.5275141572084513`*^9}}], Cell[BoxData[ SqrtBox["14"]], "Output", CellChangeTimes->{3.527514158063025*^9, 3.527514309373966*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"NormaVec", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "2", ",", "3"}], "}"}], ",", "1"}], "]"}]], "Input", CellChangeTimes->{{3.5275141641538033`*^9, 3.527514164278105*^9}}], Cell[BoxData["6"], "Output", CellChangeTimes->{3.5275141647597733`*^9, 3.5275143109940467`*^9}] }, Open ]] }, WindowSize->{1262, 862}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, ShowSelection->True, Magnification->2., FrontEndVersion->"8.0 for Microsoft Windows (32-bit) (February 23, 2011)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[557, 20, 93, 1, 57, "Input"], Cell[653, 23, 1953, 48, 432, "Input"], Cell[CellGroupData[{ Cell[2631, 75, 209, 5, 57, "Input"], Cell[2843, 82, 119, 2, 82, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[2999, 89, 213, 5, 57, "Input"], Cell[3215, 96, 104, 2, 87, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[3356, 103, 211, 5, 57, "Input"], Cell[3570, 110, 96, 1, 82, "Output"] }, Open ]] } ] *) (* End of internal cache information *)