(* 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[ 10153, 347] NotebookOptionsPosition[ 9020, 303] NotebookOutlinePosition[ 9359, 318] CellTagsIndexPosition[ 9316, 315] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["QUIZ 1 ", "Section", CellChangeTimes->{ 3.448022271871222*^9, {3.463229520668041*^9, 3.463229523351799*^9}, 3.4638488703072443`*^9}], Cell[CellGroupData[{ Cell["NAME :", "Subsubsection", CellChangeTimes->{{3.4632305368071833`*^9, 3.463230541003278*^9}, 3.4638488589540462`*^9}], Cell[TextData[{ "1) Calculate 1+3+5+7+...+999 ", "exactly by applying ", StyleBox["Total", "Input"], " to a list." }], "Text", CellChangeTimes->{{3.46384895796784*^9, 3.4638490202438917`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Total", "[", RowBox[{"Range", "[", RowBox[{"1", ",", "999", ",", "2"}], "]"}], "]"}]], "Input", CellChangeTimes->{{3.4638490244878063`*^9, 3.463849037148327*^9}}, FontSlant->"Italic"], Cell[BoxData["250000"], "Output", CellChangeTimes->{3.463849038260689*^9}, FontSlant->"Italic"] }, Open ]], Cell[TextData[{ "2) Generate a list ", StyleBox["L", "Input"], " of 20 numbers of the form ", StyleBox[" sin(1/1), sin(1/2),...,sin(1/20)", "Input"], "." }], "Text", CellChangeTimes->{{3.463849144873848*^9, 3.463849145540414*^9}, { 3.463849219742919*^9, 3.463849322686802*^9}, {3.4638493601135473`*^9, 3.463849384615797*^9}, {3.463854073746203*^9, 3.46385407989825*^9}, { 3.463854380360819*^9, 3.463854380742159*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"L", "=", RowBox[{"Sin", "[", RowBox[{"1", "/", RowBox[{"Range", "[", "20", "]"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.463849326626122*^9, 3.463849336071612*^9}, { 3.463849378336982*^9, 3.463849378864358*^9}}, FontSlant->"Italic"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"Sin", "[", "1", "]"}], ",", RowBox[{"Sin", "[", FractionBox["1", "2"], "]"}], ",", RowBox[{"Sin", "[", FractionBox["1", "3"], "]"}], ",", RowBox[{"Sin", "[", FractionBox["1", "4"], "]"}], ",", RowBox[{"Sin", "[", FractionBox["1", "5"], "]"}], ",", RowBox[{"Sin", "[", FractionBox["1", "6"], "]"}], ",", RowBox[{"Sin", "[", FractionBox["1", "7"], "]"}], ",", RowBox[{"Sin", "[", FractionBox["1", "8"], "]"}], ",", RowBox[{"Sin", "[", FractionBox["1", "9"], "]"}], ",", RowBox[{"Sin", "[", FractionBox["1", "10"], "]"}], ",", RowBox[{"Sin", "[", FractionBox["1", "11"], "]"}], ",", RowBox[{"Sin", "[", FractionBox["1", "12"], "]"}], ",", RowBox[{"Sin", "[", FractionBox["1", "13"], "]"}], ",", RowBox[{"Sin", "[", FractionBox["1", "14"], "]"}], ",", RowBox[{"Sin", "[", FractionBox["1", "15"], "]"}], ",", RowBox[{"Sin", "[", FractionBox["1", "16"], "]"}], ",", RowBox[{"Sin", "[", FractionBox["1", "17"], "]"}], ",", RowBox[{"Sin", "[", FractionBox["1", "18"], "]"}], ",", RowBox[{"Sin", "[", FractionBox["1", "19"], "]"}], ",", RowBox[{"Sin", "[", FractionBox["1", "20"], "]"}]}], "}"}]], "Output", CellChangeTimes->{3.463849337274989*^9, 3.463849379772601*^9}, FontSlant->"Italic"] }, Open ]], Cell[TextData[{ "3) Generate a list ", StyleBox["M", "Input"], " of 20 decimal approximations of the numbers ", StyleBox["sin(1/1), 2 sin(1/2),..., 20 sin(1/20)", "Input"], ". You may use ", StyleBox["L", "Input"], " from the previous question if you like. You should see that the sequence \ of these numbers approaches 1." }], "Text", CellChangeTimes->{{3.463851640886784*^9, 3.46385169291191*^9}, { 3.4638538082481117`*^9, 3.4638538399025507`*^9}, {3.463853913025392*^9, 3.4638539452721663`*^9}, {3.463854042801972*^9, 3.4638540552022457`*^9}, { 3.4638547422225*^9, 3.463854742923633*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"M", "=", RowBox[{ RowBox[{ RowBox[{"Range", "[", "20", "]"}], " ", "L"}], " ", "//", "N"}]}]], "Input", CellChangeTimes->{{3.463853850339594*^9, 3.4638538989921303`*^9}}, FontSlant->"Italic"], Cell[BoxData[ RowBox[{"{", RowBox[{ "0.8414709848078965`", ",", "0.958851077208406`", ",", "0.9815840903884566`", ",", "0.9896158370180917`", ",", "0.9933466539753061`", ",", "0.9953767961604901`", ",", "0.9966021085458455`", ",", "0.9973978670818215`", ",", "0.9979436565895768`", ",", "0.9983341664682815`", ",", "0.998623158597574`", ",", "0.9988429944037229`", ",", "0.9990140984381753`", ",", "0.9991498767611002`", ",", "0.999259423850895`", ",", "0.9993490854780832`", ",", "0.9994233984983436`", ",", "0.9994856760852097`", ",", "0.9995383834233704`", ",", "0.9995833854135666`"}], "}"}]], "Output", CellChangeTimes->{{3.463853861898408*^9, 3.463853900251893*^9}}, FontSlant->"Italic"] }, Open ]], Cell["4) Generate the expression", "Text", CellChangeTimes->{{3.463854189143338*^9, 3.463854199827479*^9}}], Cell[BoxData[ RowBox[{"x", "+", RowBox[{"2", " ", SuperscriptBox["x", "2"]}], "+", RowBox[{"3", " ", SuperscriptBox["x", "3"]}], "+", RowBox[{"4", " ", SuperscriptBox["x", "4"]}], "+", RowBox[{"5", " ", SuperscriptBox["x", "5"]}], "+", RowBox[{"6", " ", SuperscriptBox["x", "6"]}], "+", RowBox[{"7", " ", SuperscriptBox["x", "7"]}], "+", RowBox[{"8", " ", SuperscriptBox["x", "8"]}], "+", RowBox[{"9", " ", SuperscriptBox["x", "9"]}], "+", RowBox[{"10", " ", SuperscriptBox["x", "10"]}], "+", RowBox[{"11", " ", SuperscriptBox["x", "11"]}], "+", RowBox[{"12", " ", SuperscriptBox["x", "12"]}], "+", RowBox[{"13", " ", SuperscriptBox["x", "13"]}], "+", RowBox[{"14", " ", SuperscriptBox["x", "14"]}], "+", RowBox[{"15", " ", SuperscriptBox["x", "15"]}]}]], "Output", CellChangeTimes->{3.463854262965496*^9, 3.4638543392050867`*^9}], Cell[TextData[{ "Make sure you do ", StyleBox["Clear[x]", "Input"], " first!" }], "Text", CellChangeTimes->{{3.4638542884952*^9, 3.463854322829153*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"Range", "[", "15", "]"}], ".", RowBox[{"x", "^", RowBox[{"Range", "[", "15", "]"}]}]}]], "Input", CellChangeTimes->{{3.4638542122860937`*^9, 3.4638542267968473`*^9}, { 3.463854329462481*^9, 3.463854331958124*^9}}, FontSlant->"Italic"], Cell[BoxData[ RowBox[{"x", "+", RowBox[{"2", " ", SuperscriptBox["x", "2"]}], "+", RowBox[{"3", " ", SuperscriptBox["x", "3"]}], "+", RowBox[{"4", " ", SuperscriptBox["x", "4"]}], "+", RowBox[{"5", " ", SuperscriptBox["x", "5"]}], "+", RowBox[{"6", " ", SuperscriptBox["x", "6"]}], "+", RowBox[{"7", " ", SuperscriptBox["x", "7"]}], "+", RowBox[{"8", " ", SuperscriptBox["x", "8"]}], "+", RowBox[{"9", " ", SuperscriptBox["x", "9"]}], "+", RowBox[{"10", " ", SuperscriptBox["x", "10"]}], "+", RowBox[{"11", " ", SuperscriptBox["x", "11"]}], "+", RowBox[{"12", " ", SuperscriptBox["x", "12"]}], "+", RowBox[{"13", " ", SuperscriptBox["x", "13"]}], "+", RowBox[{"14", " ", SuperscriptBox["x", "14"]}], "+", RowBox[{"15", " ", SuperscriptBox["x", "15"]}]}]], "Output", CellChangeTimes->{3.463854228623728*^9, 3.4638543372540894`*^9}, FontSlant->"Italic"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Total", "[", RowBox[{ RowBox[{"Range", "[", "15", "]"}], " ", RowBox[{"x", "^", RowBox[{"Range", "[", "15", "]"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.463854247830064*^9, 3.463854261893371*^9}, { 3.463854333990587*^9, 3.4638543359104233`*^9}}, FontSlant->"Italic"], Cell[BoxData[ RowBox[{"x", "+", RowBox[{"2", " ", SuperscriptBox["x", "2"]}], "+", RowBox[{"3", " ", SuperscriptBox["x", "3"]}], "+", RowBox[{"4", " ", SuperscriptBox["x", "4"]}], "+", RowBox[{"5", " ", SuperscriptBox["x", "5"]}], "+", RowBox[{"6", " ", SuperscriptBox["x", "6"]}], "+", RowBox[{"7", " ", SuperscriptBox["x", "7"]}], "+", RowBox[{"8", " ", SuperscriptBox["x", "8"]}], "+", RowBox[{"9", " ", SuperscriptBox["x", "9"]}], "+", RowBox[{"10", " ", SuperscriptBox["x", "10"]}], "+", RowBox[{"11", " ", SuperscriptBox["x", "11"]}], "+", RowBox[{"12", " ", SuperscriptBox["x", "12"]}], "+", RowBox[{"13", " ", SuperscriptBox["x", "13"]}], "+", RowBox[{"14", " ", SuperscriptBox["x", "14"]}], "+", RowBox[{"15", " ", SuperscriptBox["x", "15"]}]}]], "Output", CellChangeTimes->{3.463854262965496*^9, 3.4638543392050867`*^9}, FontSlant->"Italic"] }, Open ]] }, Open ]] }, Open ]] }, WindowSize->{848, 527}, WindowMargins->{{351, Automatic}, {205, Automatic}}, FrontEndVersion->"6.0 for Mac OS X x86 (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, 145, 3, 67, "Section"], Cell[CellGroupData[{ Cell[760, 30, 127, 2, 25, "Subsubsection"], Cell[890, 34, 197, 6, 26, "Text"], Cell[CellGroupData[{ Cell[1112, 44, 216, 5, 27, "Input"], Cell[1331, 51, 97, 2, 27, "Output"] }, Open ]], Cell[1443, 56, 430, 10, 26, "Text"], Cell[CellGroupData[{ Cell[1898, 70, 275, 7, 27, "Input"], Cell[2176, 79, 1407, 43, 80, "Output"] }, Open ]], Cell[3598, 125, 606, 13, 41, "Text"], Cell[CellGroupData[{ Cell[4229, 142, 231, 7, 27, "Input"], Cell[4463, 151, 737, 14, 43, "Output"] }, Open ]], Cell[5215, 168, 108, 1, 26, "Text"], Cell[5326, 171, 930, 30, 30, "Output"], Cell[6259, 203, 156, 5, 26, "Text"], Cell[CellGroupData[{ Cell[6440, 212, 280, 7, 27, "Input"], Cell[6723, 221, 952, 31, 30, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[7712, 257, 313, 8, 27, "Input"], Cell[8028, 267, 952, 31, 30, "Output"] }, Open ]] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)