(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 10.2' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 28429, 915] NotebookOptionsPosition[ 25758, 831] NotebookOutlinePosition[ 26303, 852] CellTagsIndexPosition[ 26260, 849] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[{ "Introduction to ", StyleBox["Mathematica", FontSlant->"Italic"] }], "Title", CellChangeTimes->{{3.6826618323093286`*^9, 3.6826618413622*^9}}], Cell["Vito, 30/3/2017", "Text", CellChangeTimes->{{3.6672243733267775`*^9, 3.667224375881893*^9}, { 3.6826618481520457`*^9, 3.682661854066499*^9}, {3.69990165468799*^9, 3.6999016572877417`*^9}}], Cell[CellGroupData[{ Cell["Hidding variables", "Section", CellChangeTimes->{{3.6826618807430964`*^9, 3.6826618945023603`*^9}}], Cell["\<\ There are a few constructs to hide the variables in a function and/or avoid \ propagating local changes to the global namespace. We will see the Module[ ] \ construct, very akin to functions in C or Fortran. Later we will see how to \ define another namespace, with the Package construction. We will not discuss \ neither Block[ ] nor With[ ], which are complementary to Module[ ], but that \ happen less often in practice.\ \>", "Text", CellChangeTimes->{{3.6826619042062283`*^9, 3.682662124540331*^9}, { 3.68266247031424*^9, 3.6826626418439107`*^9}, {3.6999048138072214`*^9, 3.699904824483035*^9}, {3.6999048718912964`*^9, 3.6999048768418818`*^9}}], Cell[CellGroupData[{ Cell["\<\ Comparing the performance of different location estimators of the mean\ \>", "Subsection", CellChangeTimes->{{3.6826626959104385`*^9, 3.682662738977086*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"x0", "=", "20"}], ";", RowBox[{"\[Sigma]0", "=", "3"}], ";"}]], "Input", CellChangeTimes->{{3.6826627627276587`*^9, 3.682662783377694*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"u", "=", RowBox[{"RandomVariate", "[", RowBox[{ RowBox[{"NormalDistribution", "[", RowBox[{"x0", ",", "\[Sigma]0"}], "]"}], ",", "100"}], "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.6826627986305714`*^9, 3.682662801413988*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"Mean", "[", "u", "]"}], ",", RowBox[{"Median", "[", "u", "]"}], ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"Max", "[", "u", "]"}], "+", RowBox[{"Min", "[", "u", "]"}]}], ")"}], "/", "2"}]}], "}"}]], "Input", CellChangeTimes->{{3.682662809545164*^9, 3.6826628416252265`*^9}, { 3.6826628958203588`*^9, 3.6826629137404313`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"location", "[", RowBox[{"x0_", ",", "\[Sigma]0_", ",", "n_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", "u", "}"}], ",", RowBox[{ RowBox[{"u", "=", RowBox[{"RandomVariate", "[", RowBox[{ RowBox[{"NormalDistribution", "[", RowBox[{"x0", ",", "\[Sigma]0"}], "]"}], ",", "n"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"Mean", "[", "u", "]"}], ",", RowBox[{"StandardDeviation", "[", "u", "]"}], ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"Max", "[", "u", "]"}], "+", RowBox[{"Min", "[", "u", "]"}]}], ")"}], "/", "2"}]}], "}"}]}]}], "]"}]}]], "Input", CellChangeTimes->{{3.6826629578224087`*^9, 3.6826630114041305`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"v", "=", RowBox[{"Table", "[", " ", RowBox[{ RowBox[{"location", "[", RowBox[{"20", ",", "3", ",", "10"}], "]"}], ",", RowBox[{"{", "1000", "}"}]}], "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.6826630384469624`*^9, 3.682663088792184*^9}}], Cell[BoxData[ RowBox[{"StandardDeviation", "[", "v", "]"}]], "Input", CellChangeTimes->{{3.682663092645759*^9, 3.682663097395814*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"simulation", "[", RowBox[{"n_", ",", "histories_"}], "]"}], ":=", RowBox[{"StandardDeviation", "[", RowBox[{"Table", "[", " ", RowBox[{ RowBox[{"location", "[", RowBox[{"20", ",", "3", ",", "n"}], "]"}], ",", RowBox[{"{", "histories", "}"}]}], "]"}], "]"}]}]], "Input", CellChangeTimes->{{3.682663121182764*^9, 3.68266320021719*^9}}], Cell[BoxData[ RowBox[{"simulation", "[", RowBox[{"10", ",", "1000"}], "]"}]], "Input", CellChangeTimes->{{3.682663212535431*^9, 3.6826632240743704`*^9}}], Cell[BoxData[ RowBox[{"low", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Flatten", "[", RowBox[{"{", RowBox[{"n", ",", RowBox[{"simulation", "[", RowBox[{"n", ",", "1000"}], "]"}]}], "}"}], "]"}], ",", RowBox[{"{", RowBox[{"n", ",", "2", ",", "30"}], "}"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.682663232689118*^9, 3.682663271568513*^9}, { 3.68266330398036*^9, 3.6826633404186835`*^9}}], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{"{", RowBox[{ RowBox[{"low", "[", RowBox[{"[", RowBox[{"All", ",", RowBox[{"{", RowBox[{"1", ",", "2"}], "}"}]}], "]"}], "]"}], " ", ",", RowBox[{"low", "[", RowBox[{"[", RowBox[{"All", ",", RowBox[{"{", RowBox[{"1", ",", "3"}], "}"}]}], "]"}], "]"}], ",", RowBox[{"low", "[", RowBox[{"[", RowBox[{"All", ",", RowBox[{"{", RowBox[{"1", ",", "4"}], "}"}]}], "]"}], "]"}]}], "}"}], "]"}]], "Input", CellChangeTimes->{{3.6826633451224775`*^9, 3.682663387930354*^9}}], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"low", "[", RowBox[{"[", RowBox[{"All", ",", RowBox[{"{", RowBox[{"1", ",", "i"}], "}"}]}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "2", ",", "4"}], "}"}]}], "]"}], " ", "]"}]], "Input", CellChangeTimes->{{3.6826633978799*^9, 3.682663452439571*^9}, { 3.6826634938836055`*^9, 3.6826634962996006`*^9}}], Cell[BoxData[ RowBox[{"high", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Flatten", "[", RowBox[{"{", RowBox[{"n", ",", RowBox[{"simulation", "[", RowBox[{"n", ",", "1000"}], "]"}]}], "}"}], "]"}], ",", RowBox[{"{", RowBox[{"n", ",", "10", ",", "300", ",", "10"}], "}"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.682663519270293*^9, 3.6826635560894575`*^9}}], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"high", "[", RowBox[{"[", RowBox[{"All", ",", RowBox[{"{", RowBox[{"1", ",", "i"}], "}"}]}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "2", ",", "4"}], "}"}]}], "]"}], " ", "]"}]], "Input", CellChangeTimes->{{3.6826635622970886`*^9, 3.682663563182428*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["Rules", "Subsection", CellChangeTimes->{{3.682664023859974*^9, 3.6826640254125404`*^9}}], Cell["\<\ Many functions return their results as Rules. We need to learn to pick the \ desired answer, using the operator ReplaceAll, /.\ \>", "Text", CellChangeTimes->{{3.68266407985666*^9, 3.6826641229914036`*^9}, { 3.6826642881972027`*^9, 3.6826643224915733`*^9}}], Cell[BoxData[ RowBox[{"solution", "=", RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"x", "^", "4"}], "-", RowBox[{"2", RowBox[{"x", "^", "3"}]}], "-", RowBox[{"13", RowBox[{"x", "^", "2"}]}], "+", RowBox[{"14", "x"}], "+", "24"}], "\[Equal]", "0"}], ",", "x"}], "]"}]}]], "Input", CellChangeTimes->{{3.682664161255598*^9, 3.682664240865622*^9}}], Cell[BoxData[ RowBox[{"solution", "[", RowBox[{"[", "1", "]"}], "]"}]], "Input", CellChangeTimes->{{3.6826642440709553`*^9, 3.6826642462354712`*^9}}], Cell[BoxData[ RowBox[{"x", "/.", RowBox[{"solution", "[", RowBox[{"[", "1", "]"}], "]"}]}]], "Input", CellChangeTimes->{{3.682664254695903*^9, 3.6826642651450195`*^9}}], Cell[BoxData[ RowBox[{"a", "=", RowBox[{"x", "/.", RowBox[{"solution", "[", RowBox[{"[", "2", "]"}], "]"}]}]}]], "Input", CellChangeTimes->{{3.682664268047778*^9, 3.6826642733539734`*^9}, { 3.6826643626963987`*^9, 3.682664363143454*^9}}], Cell[BoxData[ RowBox[{"v", "=", RowBox[{"x", "/.", "solution"}]}]], "Input", CellChangeTimes->{{3.682664280859592*^9, 3.6826642833816776`*^9}, { 3.682664329205744*^9, 3.682664335709654*^9}}], Cell[BoxData[ RowBox[{"v", "[", RowBox[{"[", "1", "]"}], "]"}]], "Input", CellChangeTimes->{{3.682664342428404*^9, 3.682664345475317*^9}}], Cell[BoxData[ RowBox[{"Clear", "[", RowBox[{"x", ",", "x0", ",", "\[Omega]"}], "]"}]], "Input", CellChangeTimes->{{3.682664475480867*^9, 3.682664477137368*^9}, { 3.6826646241335783`*^9, 3.6826646248642316`*^9}, {3.682664851868271*^9, 3.682664854434967*^9}}], Cell[BoxData[ RowBox[{"funcRule", "=", RowBox[{"DSolve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"x", "''"}], "[", "t", "]"}], "+", RowBox[{ RowBox[{"\[Omega]", "^", "2"}], " ", RowBox[{"x", "[", "t", "]"}]}]}], "\[Equal]", "0"}], ",", " ", RowBox[{ RowBox[{ RowBox[{"x", "'"}], "[", "0", "]"}], "\[Equal]", "0"}], ",", RowBox[{ RowBox[{"x", "[", "0", "]"}], "\[Equal]", "x0"}]}], "}"}], ",", RowBox[{"x", "[", "t", "]"}], ",", "t", ",", RowBox[{"Assumptions", "\[Rule]", RowBox[{"\[Omega]", ">", "0"}]}]}], "]"}]}]], "Input", CellChangeTimes->{{3.6826643965287075`*^9, 3.6826644719101534`*^9}, { 3.682664523711181*^9, 3.6826645666877117`*^9}, {3.6826646187017145`*^9, 3.6826646467011995`*^9}}], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"x", "[", "t", "]"}], "/.", "funcRule"}], "/.", RowBox[{"{", RowBox[{ RowBox[{"x0", "\[Rule]", "10"}], ",", RowBox[{"\[Omega]", "->", RowBox[{"1", "/", "10"}]}]}], "}"}]}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", "20"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.682664681759616*^9, 3.6826647778967257`*^9}, { 3.6826648166741705`*^9, 3.682664820422258*^9}}], Cell[BoxData[ RowBox[{"func", "=", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"x", "[", "t", "]"}], "/.", "funcRule"}], ")"}], "[", RowBox[{"[", "1", "]"}], "]"}]}]], "Input", CellChangeTimes->{{3.682664866824902*^9, 3.6826648959605565`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"x", "[", "t", "]"}], "/.", RowBox[{"funcRule", "[", RowBox[{"[", "1", "]"}], "]"}]}]], "Input", CellChangeTimes->{{3.6826649380306883`*^9, 3.682664948286121*^9}}] }, Open ]], Cell["Interactive objects", "Subsection", CellChangeTimes->{{3.682665732796682*^9, 3.6826657372341237`*^9}}], Cell[CellGroupData[{ Cell["How the normal Limit is approached", "Subsection", CellChangeTimes->{{3.6826657633814993`*^9, 3.6826657889353676`*^9}}], Cell[BoxData[ RowBox[{"d", "=", RowBox[{"RandomVariate", "[", " ", RowBox[{ RowBox[{"ChiSquareDistribution", "[", "5", "]"}], ",", "10"}], "]"}]}]], "Input", CellChangeTimes->{{3.68266579563422*^9, 3.6826658197022343`*^9}}], Cell[BoxData[ RowBox[{"Mean", "[", "d", "]"}]], "Input", CellChangeTimes->{{3.6826658237576056`*^9, 3.6826658279897814`*^9}}], Cell[BoxData[ RowBox[{"Histogram", "[", " ", RowBox[{"Table", "[", " ", RowBox[{ RowBox[{"Mean", "[", " ", RowBox[{"RandomVariate", "[", " ", RowBox[{ RowBox[{"ChiSquareDistribution", "[", "5", "]"}], ",", "10"}], "]"}], " ", "]"}], ",", RowBox[{"{", "1000", "}"}]}], "]"}], " ", "]"}]], "Input", CellChangeTimes->{{3.682665831298793*^9, 3.6826658630758076`*^9}}], Cell[BoxData[ RowBox[{"Manipulate", "[", " ", RowBox[{ RowBox[{"Histogram", "[", " ", RowBox[{"Table", "[", " ", RowBox[{ RowBox[{"Mean", "[", " ", RowBox[{"RandomVariate", "[", " ", RowBox[{ RowBox[{"ChiSquareDistribution", "[", "n", "]"}], ",", "10"}], "]"}], " ", "]"}], ",", RowBox[{"{", "1000", "}"}]}], "]"}], " ", "]"}], ",", RowBox[{"{", RowBox[{"n", ",", "1", ",", "30", ",", "1"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.682665871259787*^9, 3.6826658991118107`*^9}}], Cell[BoxData[ RowBox[{"Manipulate", "[", " ", RowBox[{ RowBox[{"Histogram", "[", " ", RowBox[{"Table", "[", " ", RowBox[{ RowBox[{"Mean", "[", " ", RowBox[{"RandomVariate", "[", " ", RowBox[{ RowBox[{"ChiSquareDistribution", "[", "n", "]"}], ",", "m"}], "]"}], " ", "]"}], ",", RowBox[{"{", "1000", "}"}]}], "]"}], " ", "]"}], ",", RowBox[{"{", RowBox[{"n", ",", "1", ",", "30", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"m", ",", "1", ",", "30", ",", "1"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.6826659214940987`*^9, 3.6826659389521627`*^9}, { 3.6826659957396984`*^9, 3.682666009103011*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "Using Mathematica in place of the tables of t, ", Cell[BoxData[ FormBox[ RowBox[{ SuperscriptBox["\[Chi]", "2"], ",", " "}], TraditionalForm]], FormatType->"TraditionalForm"], "etc" }], "Subsection", CellChangeTimes->{{3.6999008317559075`*^9, 3.699900876985115*^9}}], Cell[BoxData[ RowBox[{"CDF", "[", RowBox[{ RowBox[{"StudentTDistribution", "[", "\[Nu]", "]"}], ",", "x"}], "]"}]], "Input", CellChangeTimes->{{3.6999008917093687`*^9, 3.6999009212211094`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"CDF", "[", RowBox[{ RowBox[{"StudentTDistribution", "[", "5", "]"}], ",", "1"}], "]"}], "//", "N"}]], "Input", CellChangeTimes->{{3.699900940237665*^9, 3.6999009523889627`*^9}}], Cell[BoxData[ RowBox[{"Table", "[", " ", RowBox[{ RowBox[{"CDF", "[", RowBox[{ RowBox[{"StudentTDistribution", "[", "n", "]"}], ",", "1"}], "]"}], ",", RowBox[{"{", RowBox[{"n", ",", "10"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.699900956247427*^9, 3.6999009775030107`*^9}}], Cell["\<\ Note CDF[StudentTDistribution[n],1] -CDF[StudentTDistribution[n],-1] ==2 \ CDF[StudentTDistribution[n],1] -1 ONLY because pdf(t) is symmetric around 0\ \>", "Text", CellChangeTimes->{{3.6999023293391323`*^9, 3.6999024025087223`*^9}}], Cell[BoxData[ RowBox[{"TableForm", "[", " ", RowBox[{ RowBox[{"Table", "[", " ", RowBox[{ RowBox[{"{", RowBox[{"n", ",", RowBox[{"N", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"CDF", "[", RowBox[{ RowBox[{"StudentTDistribution", "[", "n", "]"}], ",", "1"}], "]"}]}], " ", "-", "1"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"n", ",", "10"}], "}"}]}], "]"}], " ", ",", RowBox[{"TableHeadings", "\[Rule]", RowBox[{"{", RowBox[{"None", ",", RowBox[{"{", RowBox[{"\[Nu]", ",", "\"\\""}], "}"}]}], "}"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.6999009876812906`*^9, 3.6999010841639*^9}, { 3.699901133194194*^9, 3.6999012053667407`*^9}, {3.6999022538134394`*^9, 3.699902265935616*^9}}], Cell[BoxData[ RowBox[{"TableForm", "[", " ", RowBox[{ RowBox[{"Table", "[", " ", RowBox[{ RowBox[{"{", RowBox[{"n", ",", RowBox[{"1", "-", RowBox[{"N", "[", RowBox[{"CDF", "[", RowBox[{ RowBox[{"ChiSquareDistribution", "[", "n", "]"}], ",", RowBox[{"2", "n"}]}], "]"}], " ", "]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"n", ",", "10"}], "}"}]}], "]"}], " ", ",", RowBox[{"TableHeadings", "\[Rule]", RowBox[{"{", RowBox[{"None", ",", RowBox[{"{", RowBox[{ "\[Nu]", ",", "\"\2\[Nu])\>\""}], "}"}]}], "}"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.6999010741246777`*^9, 3.699901075292341*^9}, { 3.6999012173094425`*^9, 3.6999013274190416`*^9}}], Cell[BoxData[ RowBox[{"NSolve", "[", " ", RowBox[{ RowBox[{ RowBox[{"1", "-", RowBox[{"CDF", "[", RowBox[{ RowBox[{"ChiSquareDistribution", "[", "7", "]"}], ",", "x"}], "]"}]}], " ", "\[Equal]", "0.05"}], " ", ",", " ", "x"}], "]"}]], "Input", CellChangeTimes->{{3.699901342632009*^9, 3.6999013750707307`*^9}}], Cell[BoxData[ RowBox[{"FindRoot", "[", " ", RowBox[{ RowBox[{ RowBox[{"1", "-", RowBox[{"CDF", "[", RowBox[{ RowBox[{"ChiSquareDistribution", "[", "7", "]"}], ",", "x"}], "]"}]}], " ", "\[Equal]", "0.05"}], " ", ",", " ", RowBox[{"{", RowBox[{"x", ",", "14"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.6999013913446674`*^9, 3.6999014335201883`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"Table", "[", " ", RowBox[{ RowBox[{"{", RowBox[{"n", ",", RowBox[{"FindRoot", "[", " ", RowBox[{ RowBox[{ RowBox[{"1", "-", RowBox[{"CDF", "[", RowBox[{ RowBox[{"ChiSquareDistribution", "[", "n", "]"}], ",", "x"}], "]"}]}], " ", "\[Equal]", "0.05"}], " ", ",", " ", RowBox[{"{", RowBox[{"x", ",", RowBox[{"2", "n"}]}], "}"}]}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"n", ",", "10"}], "}"}]}], "]"}], " "}]], "Input", CellChangeTimes->{{3.6999014507969313`*^9, 3.69990151105624*^9}}], Cell[BoxData[ RowBox[{"tab", "=", RowBox[{"Table", "[", " ", RowBox[{ RowBox[{"{", RowBox[{"n", ",", RowBox[{"x", "/.", RowBox[{"FindRoot", "[", " ", RowBox[{ RowBox[{ RowBox[{"1", "-", RowBox[{"CDF", "[", RowBox[{ RowBox[{"ChiSquareDistribution", "[", "n", "]"}], ",", "x"}], "]"}]}], " ", "\[Equal]", "0.05"}], " ", ",", " ", RowBox[{"{", RowBox[{"x", ",", RowBox[{"2", "n"}]}], "}"}]}], "]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"n", ",", "10"}], "}"}]}], "]"}], " "}]], "Input", CellChangeTimes->{{3.6999015150525184`*^9, 3.6999015264436507`*^9}}], Cell[BoxData[ RowBox[{"TableForm", "[", RowBox[{"tab", ",", RowBox[{"TableHeadings", "\[Rule]", RowBox[{"{", RowBox[{"None", ",", RowBox[{"{", RowBox[{ "\[Nu]", ",", "\"\<\!\(\*SubscriptBox[\((\*SuperscriptBox[\(\[Chi]\), \(2\)])\), \ \(critico\)]\) | P(\!\(\*SuperscriptBox[\(\[Chi]\), \ \(2\)]\)>\!\(\*SubscriptBox[\((\*SuperscriptBox[\(\[Chi]\), \(2\)])\), \ \(critico\)]\))=5%\>\""}], "}"}]}], "}"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.699901530024841*^9, 3.6999016248112535`*^9}}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Exerc\[IAcute]cio 10", "Section", CellChangeTimes->{{3.6999020181901484`*^9, 3.6999020224716144`*^9}, { 3.6999046050129976`*^9, 3.6999046055659704`*^9}}], Cell[TextData[{ "Em uma medi\[CCedilla]\[ATilde]o com N dados, todos distribu\[IAcute]dos \ normalmente com m\[EAcute]dia ", Cell[BoxData[ FormBox[ SubscriptBox["x", "0"], TraditionalForm]], FormatType->"TraditionalForm"], " e desvio-padr\[ATilde]o ", Cell[BoxData[ FormBox[ SubscriptBox["\[Sigma]", "0"], TraditionalForm]], FormatType->"TraditionalForm"], " , os n\[IAcute]veis de confian\[CCedilla]a associados aos intervalos \n", Cell[BoxData[ FormBox[ OverscriptBox["x", "_"], TraditionalForm]], FormatType->"TraditionalForm"], " - ", Cell[BoxData[ FormBox[ SubscriptBox["\[Sigma]", RowBox[{"m", ",", "0"}]], TraditionalForm]]], " \[LessEqual] ", Cell[BoxData[ FormBox[ RowBox[{" ", SubscriptBox["x", "0"]}], TraditionalForm]]], " \[LessEqual] ", Cell[BoxData[ FormBox[ OverscriptBox["x", "_"], TraditionalForm]], FormatType->"TraditionalForm"], " + ", Cell[BoxData[ FormBox[ SubscriptBox["\[Sigma]", RowBox[{"m", ",", "0"}]], TraditionalForm]]], " , ", Cell[BoxData[ FormBox[ OverscriptBox["x", "_"], TraditionalForm]], FormatType->"TraditionalForm"], " - 2", Cell[BoxData[ FormBox[ SubscriptBox["\[Sigma]", RowBox[{"m", ".0"}]], TraditionalForm]]], " \[LessEqual] ", Cell[BoxData[ FormBox[ RowBox[{" ", SubscriptBox["x", "0"]}], TraditionalForm]]], " \[LessEqual] ", Cell[BoxData[ FormBox[ OverscriptBox["x", "_"], TraditionalForm]], FormatType->"TraditionalForm"], " + ", Cell[BoxData[ FormBox[ RowBox[{"2", SubscriptBox["\[Sigma]", RowBox[{"m", ".0"}]]}], TraditionalForm]]], " e ", Cell[BoxData[ FormBox[ OverscriptBox["x", "_"], TraditionalForm]], FormatType->"TraditionalForm"], " - 3 ", Cell[BoxData[ FormBox[ SubscriptBox["\[Sigma]", RowBox[{"m", ",", "0"}]], TraditionalForm]]], " \[LessEqual] ", Cell[BoxData[ FormBox[ RowBox[{" ", SubscriptBox["x", "0"]}], TraditionalForm]]], " \[LessEqual] ", Cell[BoxData[ FormBox[ OverscriptBox["x", "_"], TraditionalForm]], FormatType->"TraditionalForm"], " + 3 ", Cell[BoxData[ FormBox[ SubscriptBox["\[Sigma]", RowBox[{"m", ",", "0"}]], TraditionalForm]]], " \ns\[ATilde]o 68,3%; 95,4% e 99,7%, respectivamente.\nSe o desvio-padr\ \[ATilde]o verdadeiro da m\[EAcute]dia \[EAcute] desconhecido e usamos sua \ estimativa convencional no lugar de ", Cell[BoxData[ FormBox[ SubscriptBox["\[Sigma]", RowBox[{"m", ",", "0"}]], TraditionalForm]]], " nos intervalos acima, a fiim de manter esses n\[IAcute]veis de confian\ \[CCedilla]a usuais precisamos usar intervalos\n", Cell[BoxData[ FormBox[ OverscriptBox["x", "_"], TraditionalForm]], FormatType->"TraditionalForm"], " - ", Cell[BoxData[ FormBox[ RowBox[{ SubscriptBox["t", "I"], " ", SubscriptBox["\[Sigma]", "m"]}], TraditionalForm]]], " \[LessEqual] ", Cell[BoxData[ FormBox[ RowBox[{" ", SubscriptBox["x", "0"]}], TraditionalForm]]], " \[LessEqual] ", Cell[BoxData[ FormBox[ OverscriptBox["x", "_"], TraditionalForm]], FormatType->"TraditionalForm"], " + ", Cell[BoxData[ FormBox[ RowBox[{" ", FormBox[ RowBox[{ SubscriptBox["t", "I"], " ", SubscriptBox["\[Sigma]", "m"]}], TraditionalForm]}], TraditionalForm]]], ", ", Cell[BoxData[ FormBox[ OverscriptBox["x", "_"], TraditionalForm]], FormatType->"TraditionalForm"], " - ", Cell[BoxData[ FormBox[ RowBox[{ SubscriptBox["t", "II"], " ", SubscriptBox["\[Sigma]", "m"]}], TraditionalForm]]], " \[LessEqual] ", Cell[BoxData[ FormBox[ RowBox[{" ", SubscriptBox["x", "0"]}], TraditionalForm]]], " \[LessEqual] ", Cell[BoxData[ FormBox[ OverscriptBox["x", "_"], TraditionalForm]], FormatType->"TraditionalForm"], " + ", Cell[BoxData[ FormBox[ RowBox[{" ", FormBox[ RowBox[{ SubscriptBox["t", "II"], " ", SubscriptBox["\[Sigma]", "m"]}], TraditionalForm]}], TraditionalForm]]], " e ", Cell[BoxData[ FormBox[ OverscriptBox["x", "_"], TraditionalForm]], FormatType->"TraditionalForm"], " - ", Cell[BoxData[ FormBox[ RowBox[{ SubscriptBox["t", "III"], " ", SubscriptBox["\[Sigma]", "m"]}], TraditionalForm]]], " \[LessEqual] ", Cell[BoxData[ FormBox[ RowBox[{" ", SubscriptBox["x", "0"]}], TraditionalForm]]], " \[LessEqual] ", Cell[BoxData[ FormBox[ OverscriptBox["x", "_"], TraditionalForm]], FormatType->"TraditionalForm"], " + ", Cell[BoxData[ FormBox[ RowBox[{" ", FormBox[ RowBox[{ SubscriptBox["t", "III"], " ", SubscriptBox["\[Sigma]", "m"]}], TraditionalForm]}], TraditionalForm]]], "\ncom valores adequados de ", Cell[BoxData[ FormBox[ RowBox[{ SubscriptBox["t", "I"], ",", " "}], TraditionalForm]], FormatType->"TraditionalForm"], Cell[BoxData[ FormBox[ SubscriptBox["t", "II"], TraditionalForm]]], " e ", Cell[BoxData[ FormBox[ SubscriptBox["t", "III"], TraditionalForm]]], ", que devem ser obtidos a partir da distribui\[CCedilla]\[ATilde]o de t de \ Student.\nConstrua uma tabela de ", Cell[BoxData[ FormBox[ RowBox[{ SubscriptBox["t", "I"], ",", " "}], TraditionalForm]], FormatType->"TraditionalForm"], Cell[BoxData[ FormBox[ SubscriptBox["t", "II"], TraditionalForm]]], " e ", Cell[BoxData[ FormBox[ SubscriptBox["t", "III"], TraditionalForm]]], " para um n\[UAcute]mero de dados 2{{3.6999030818715477`*^9, 3.6999032137003117`*^9}, { 3.699903254212858*^9, 3.6999036575503335`*^9}, {3.699903692894508*^9, 3.6999044165369463`*^9}, {3.699904457343747*^9, 3.699904528252676*^9}}] }, Open ]] }, Open ]] }, WindowSize->{1149, 888}, WindowMargins->{{74, Automatic}, {Automatic, 7}}, PrintingCopies->1, PrintingPageRange->{32000, 32000}, PrintingOptions->{"Magnification"->1., "PaperOrientation"->"Portrait", "PaperSize"->{595.1999999999999, 841.68}}, Magnification:>1.1 Inherited, FrontEndVersion->"11.0 for Microsoft Windows (64-bit) (September 21, 2016)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[580, 22, 163, 5, 111, "Title"], Cell[746, 29, 200, 3, 32, "Text"], Cell[CellGroupData[{ Cell[971, 36, 106, 1, 78, "Section"], Cell[1080, 39, 667, 10, 73, "Text"], Cell[CellGroupData[{ Cell[1772, 53, 168, 3, 53, "Subsection"], Cell[1943, 58, 178, 4, 33, "Input"], Cell[2124, 64, 290, 8, 33, "Input"], Cell[2417, 74, 412, 11, 33, "Input"], Cell[2832, 87, 840, 24, 56, "Input"], Cell[3675, 113, 304, 8, 33, "Input"], Cell[3982, 123, 136, 2, 33, "Input"], Cell[4121, 127, 403, 10, 33, "Input"], Cell[4527, 139, 158, 3, 33, "Input"], Cell[4688, 144, 448, 12, 33, "Input"], Cell[5139, 158, 626, 20, 33, "Input"], Cell[5768, 180, 444, 12, 33, "Input"], Cell[6215, 194, 418, 12, 33, "Input"], Cell[6636, 208, 396, 11, 33, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[7069, 224, 95, 1, 53, "Subsection"], Cell[7167, 227, 270, 5, 32, "Text"], Cell[7440, 234, 422, 13, 33, "Input"], Cell[7865, 249, 154, 3, 33, "Input"], Cell[8022, 254, 177, 4, 33, "Input"], Cell[8202, 260, 253, 6, 33, "Input"], Cell[8458, 268, 197, 4, 33, "Input"], Cell[8658, 274, 143, 3, 33, "Input"], Cell[8804, 279, 267, 5, 33, "Input"], Cell[9074, 286, 859, 23, 33, "Input"], Cell[9936, 311, 498, 14, 33, "Input"], Cell[10437, 327, 260, 7, 33, "Input"], Cell[10700, 336, 205, 5, 33, "Input"] }, Open ]], Cell[10920, 344, 109, 1, 53, "Subsection"], Cell[CellGroupData[{ Cell[11054, 349, 126, 1, 43, "Subsection"], Cell[11183, 352, 240, 6, 33, "Input"], Cell[11426, 360, 127, 2, 33, "Input"], Cell[11556, 364, 407, 10, 33, "Input"], Cell[11966, 376, 559, 14, 33, "Input"], Cell[12528, 392, 691, 17, 56, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[13256, 414, 298, 9, 53, "Subsection"], Cell[13557, 425, 204, 5, 33, "Input"], Cell[13764, 432, 224, 6, 33, "Input"], Cell[13991, 440, 310, 8, 33, "Input"], Cell[14304, 450, 244, 4, 32, "Text"], Cell[14551, 456, 842, 24, 33, "Input"], Cell[15396, 482, 843, 24, 36, "Input"], Cell[16242, 508, 347, 9, 33, "Input"], Cell[16592, 519, 401, 11, 33, "Input"], Cell[16996, 532, 656, 19, 33, "Input"], Cell[17655, 553, 710, 20, 33, "Input"], Cell[18368, 575, 543, 13, 37, "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[18960, 594, 162, 2, 78, "Section"], Cell[19125, 598, 6605, 229, 323, "Text"] }, Open ]] }, Open ]] } ] *)