(* 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[ 25721, 667] NotebookOptionsPosition[ 19372, 572] NotebookOutlinePosition[ 19804, 589] CellTagsIndexPosition[ 19761, 586] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Introduction to Mathematica", "Title", CellChangeTimes->{{3.6660391054616375`*^9, 3.666039123583289*^9}},ExpressionUUID->"2775fbcf-0695-450d-ad4a-\ 70da2cf15577"], Cell["Vito, March 2023", "Text", CellChangeTimes->{{3.6660391342891912`*^9, 3.6660391478536825`*^9}, { 3.6819866909501514`*^9, 3.6819866947018976`*^9}, {3.699085873792968*^9, 3.6990858779759912`*^9}, {3.8883424331032376`*^9, 3.888342433705626*^9}},ExpressionUUID->"ae5b656e-bb95-4c5f-9be9-\ 9fec9950139e"], Cell[CellGroupData[{ Cell["Class 3 - Vectors and matrices, part I", "Section", CellChangeTimes->{{3.6819872339244375`*^9, 3.6819872360021133`*^9}, { 3.6820930745612793`*^9, 3.6820930756238537`*^9}, {3.6821357079595137`*^9, 3.6821357244666667`*^9}},ExpressionUUID->"f73b43e7-d73e-428c-8221-\ d4754d57cf44"], Cell[CellGroupData[{ Cell["Vectors are single level lists", "Subsection", CellChangeTimes->{{3.6668662435658436`*^9, 3.66686625744197*^9}, { 3.682093322503855*^9, 3.682093330622294*^9}},ExpressionUUID->"16c88c03-8f0c-4d90-8b0d-\ c1920dfc1c85"], Cell[BoxData[ RowBox[{"a", "=", RowBox[{"Range", "[", RowBox[{"11", ",", "14"}], "]"}]}]], "Input", CellChangeTimes->{{3.6668662656362963`*^9, 3.666866273042045*^9}},ExpressionUUID->"ed4e2d38-e837-4e74-96f7-\ 34b2121656d7"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Most Mathematica functions generate lists when applied to lists\ \>", "Subsection", CellChangeTimes->{{3.666866457703485*^9, 3.6668664806119566`*^9}, 3.667033801054764*^9, {3.682093337540387*^9, 3.682093361703262*^9}},ExpressionUUID->"21bc557e-19ee-4d3e-8ab3-\ b8af1efaa987"], Cell[BoxData[ RowBox[{"b", "=", RowBox[{"Sin", "[", RowBox[{"{", RowBox[{ RowBox[{"Pi", "/", "5"}], ",", RowBox[{"Pi", "/", "4"}], ",", RowBox[{"Pi", "/", "7"}], ",", RowBox[{"Pi", "/", "9"}]}], "}"}], "]"}]}]], "Input", CellChangeTimes->{{3.6668662830016584`*^9, 3.6668663230324917`*^9}},ExpressionUUID->"5cabe936-7909-4e79-b267-\ 97427b8f28e9"], Cell[BoxData[ RowBox[{"b", "=", RowBox[{ RowBox[{"Sin", "[", RowBox[{"{", RowBox[{ RowBox[{"Pi", "/", "5"}], ",", RowBox[{"Pi", "/", "4"}], ",", RowBox[{"Pi", "/", "7"}], ",", RowBox[{"Pi", "/", "9"}]}], "}"}], "]"}], "//", "N"}]}]], "Input", CellChangeTimes->{{3.6668663481827574`*^9, 3.6668663491311355`*^9}},ExpressionUUID->"67731796-9f8c-410f-acf8-\ fa27aa72c0be"], Cell[BoxData[ RowBox[{"a", "-", "10"}]], "Input", CellChangeTimes->{{3.6668664312992797`*^9, 3.666866433099613*^9}},ExpressionUUID->"3c88c192-25b3-4228-9f58-\ 2de2b280aef2"], Cell[BoxData[ RowBox[{"10", "b"}]], "Input", CellChangeTimes->{{3.6668664365396376`*^9, 3.6668664373705215`*^9}},ExpressionUUID->"6b8bd171-58e2-40cd-bf19-\ 15d628b340df"], Cell["\<\ TableForm[ ] displays vectors and matrices in tabular format; headings can be \ provided\ \>", "Text", CellChangeTimes->{{3.6820934095856113`*^9, 3.682093473088024*^9}},ExpressionUUID->"9c4b29bd-357f-4e24-8a8d-\ 4592630a610a"], Cell[BoxData[ RowBox[{"a", "//", "TableForm"}]], "Input", CellChangeTimes->{{3.6668665051996984`*^9, 3.666866509484618*^9}},ExpressionUUID->"2eb242f9-7c98-4e89-ae28-\ dec65bfd0b9a"] }, Open ]], Cell[CellGroupData[{ Cell["Extracting list elements", "Subsection", CellChangeTimes->{{3.6668665315234776`*^9, 3.666866536811123*^9}, { 3.6820935394656143`*^9, 3.6820935496015387`*^9}},ExpressionUUID->"753d6b42-afda-49f4-b383-\ b1c478a32b76"], Cell[BoxData[ RowBox[{"c", "=", RowBox[{"Range", "[", RowBox[{"11", ",", "111", ",", "10"}], "]"}]}]], "Input", CellChangeTimes->{{3.666866539491373*^9, 3.6668665696981525`*^9}, { 3.666867532257913*^9, 3.6668675324737835`*^9}, {3.666867574963955*^9, 3.6668675819694977`*^9}},ExpressionUUID->"8b96117d-cef7-49a4-af45-\ 87789a62acfe"], Cell[BoxData[ RowBox[{"c", "[", RowBox[{"[", "2", "]"}], "]"}]], "Input", CellChangeTimes->{{3.666866577519427*^9, 3.666866579121828*^9}},ExpressionUUID->"fabce779-077d-4e33-816f-\ ffa615ac8986"], Cell[BoxData[ RowBox[{"c", "[", RowBox[{"[", RowBox[{"-", "2"}], "]"}], "]"}]], "Input", CellChangeTimes->{{3.666866633440668*^9, 3.6668666356248493`*^9}},ExpressionUUID->"c60f1c55-0921-44d5-8929-\ 570c940db059"], Cell[BoxData[ RowBox[{"First", "[", "c", "]"}]], "Input", CellChangeTimes->{{3.6668666388576946`*^9, 3.6668666413795285`*^9}},ExpressionUUID->"7c2fb7c9-5af1-48bb-bf30-\ c5f78683ee21"], Cell[BoxData[ RowBox[{"Last", "[", "c", "]"}]], "Input", CellChangeTimes->{{3.6668666427286367`*^9, 3.6668666447603006`*^9}},ExpressionUUID->"71555705-a759-488e-a96b-\ ad6c0ae74a8c"], Cell[BoxData[ RowBox[{"c", "[", RowBox[{"[", RowBox[{"2", ";;", "4"}], "]"}], "]"}]], "Input", CellChangeTimes->{{3.666866582846919*^9, 3.6668665874262705`*^9}},ExpressionUUID->"5e920b93-0670-42c9-8129-\ 58bb50064a95"], Cell[BoxData[ RowBox[{"Length", "[", RowBox[{"c", "[", RowBox[{"[", RowBox[{"5", ";;", "8"}], "]"}], "]"}], " ", "]"}]], "Input", CellChangeTimes->{{3.666866592614224*^9, 3.6668666036708393`*^9}},ExpressionUUID->"ce8870f4-a34a-4a38-9e46-\ dc53a77d38a3"], Cell[BoxData["c"], "Input", CellChangeTimes->{ 3.666866609805483*^9},ExpressionUUID->"903c232d-4a87-4dd3-837d-\ 0af82c39f2b5"], Cell["\<\ Example - Calculating the median without using the specialized Mathematica \ function\ \>", "Text", CellChangeTimes->{{3.6668677857058*^9, 3.666867788772224*^9}, { 3.6820943142652154`*^9, 3.6820943566773453`*^9}},ExpressionUUID->"653e6935-00a4-47df-9eec-\ 9a345c9c55f1"], Cell[BoxData[ RowBox[{"d", "=", RowBox[{"RandomReal", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "100"}], "}"}], ",", "11"}], "]"}]}]], "Input", CellChangeTimes->{{3.666866689415453*^9, 3.6668666918485017`*^9}, { 3.6668672119671464`*^9, 3.666867212514126*^9}, {3.6668675627685814`*^9, 3.6668676095776124`*^9}},ExpressionUUID->"28205754-6e3e-4452-b6ea-\ 71dc2f8fedee"], Cell[BoxData[ RowBox[{"ds", "=", RowBox[{"Sort", "[", "d", "]"}]}]], "Input", CellChangeTimes->{{3.666867547791129*^9, 3.6668675515936728`*^9}, { 3.666867612980186*^9, 3.666867616968213*^9}},ExpressionUUID->"1a0c11dc-8dc5-485d-973f-\ 200f5bc77c93"], Cell[BoxData[ RowBox[{ RowBox[{"ds", "[", RowBox[{"[", " ", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"Length", "[", "ds", "]"}], "+", "1"}], ")"}], "/", "2"}], " ", "]"}], "]"}], " ", RowBox[{"(*", " ", RowBox[{ RowBox[{"11", " ", "elements"}], ",", " ", RowBox[{ RowBox[{ "there", " ", "is", " ", "a", " ", "term", " ", "exactly", " ", "in", " ", "the", " ", "middle"}], " ", "-", " ", RowBox[{ "this", " ", "is", " ", "the", " ", "estimate", " ", "of", " ", "the", " ", "median"}]}]}], " ", "*)"}]}]], "Input", CellChangeTimes->{{3.666867621388485*^9, 3.6668676256740074`*^9}, { 3.6668677943321824`*^9, 3.6668678670000057`*^9}, {3.682094370065855*^9, 3.682094408262768*^9}, {3.6821357930346584`*^9, 3.682135795449668*^9}},ExpressionUUID->"455b12de-515c-470c-9f34-\ dae493607686"] }, Open ]], Cell[CellGroupData[{ Cell["adding the members of a list", "Subsection", CellChangeTimes->{{3.6668685215162644`*^9, 3.6668685296912956`*^9}, { 3.6820944202670712`*^9, 3.6820944326376286`*^9}},ExpressionUUID->"a625d231-0eea-4ad7-89b1-\ 6bf85e90e87b"], Cell[BoxData[ RowBox[{"Total", "[", "d", "]"}]], "Input", CellChangeTimes->{{3.6668685358277473`*^9, 3.666868538759985*^9}},ExpressionUUID->"2f0d16f4-864a-4801-93e4-\ e56be562ca65"], Cell[BoxData[ RowBox[{"Total", "[", RowBox[{"d", "[", RowBox[{"[", RowBox[{"2", ";;", RowBox[{"-", "2"}]}], "]"}], "]"}], " ", "]"}]], "Input", CellChangeTimes->{{3.6668685406469655`*^9, 3.666868560831086*^9}},ExpressionUUID->"d4664b8b-6ba3-4375-9d2e-\ 15aa76dd5f05"], Cell[BoxData[ RowBox[{"%", "+", RowBox[{"First", "[", "d", "]"}], "+", RowBox[{"Last", "[", "d", "]"}]}]], "Input", CellChangeTimes->{{3.666868565267731*^9, 3.666868579661606*^9}},ExpressionUUID->"7edb85f1-92cc-4ba5-9f5b-\ 6fbd08272134"], Cell["\<\ Evaluating the median of a dataset with an even number of elements is more \ involved\ \>", "Text", CellChangeTimes->{{3.667033973853792*^9, 3.6670340076147857`*^9}, { 3.6820944555496235`*^9, 3.6820944985271378`*^9}},ExpressionUUID->"9c8278cc-fdd3-4507-a7fa-\ 17098ca906ac"], Cell[BoxData[ RowBox[{"e", "=", RowBox[{"RandomReal", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "100"}], "}"}], ",", "10"}], "]"}]}]], "Input", CellChangeTimes->{{3.6668686218944373`*^9, 3.666868633939985*^9}},ExpressionUUID->"8133ef63-804a-4fd1-9b57-\ eebe02fd5255"], Cell["but there is a compact way", "Text", CellChangeTimes->{{3.666868697543028*^9, 3.6668687048175893`*^9}, { 3.682094508046528*^9, 3.682094512949089*^9}},ExpressionUUID->"d27e3259-ea21-4557-a832-\ 8f1a6f9a6f22"], Cell[BoxData[ RowBox[{ RowBox[{"Total", "[", " ", RowBox[{ RowBox[{"Sort", "[", "e", "]"}], "[", RowBox[{"[", RowBox[{"5", ";;", "6"}], "]"}], "]"}], " ", "]"}], "/", "2"}]], "Input", CellChangeTimes->{{3.6668686464976053`*^9, 3.666868681960099*^9}},ExpressionUUID->"c6e0505f-be83-4c95-94c1-\ 2d72511817e6"] }, Open ]], Cell[CellGroupData[{ Cell["another operation", "Subsection", CellChangeTimes->{{3.666868888319234*^9, 3.666868893422284*^9}, { 3.682094531676769*^9, 3.682094535209807*^9}},ExpressionUUID->"eb965f21-5e46-47ec-921d-\ 4b243879eb6c"], Cell[BoxData[ RowBox[{"u", "=", RowBox[{"{", RowBox[{"u1", ",", "u2"}], "}"}]}]], "Input", CellChangeTimes->{{3.6668682759505367`*^9, 3.6668683010191402`*^9}},ExpressionUUID->"c4164977-92c4-43c1-a0ee-\ 6ccf8f536ad0"], Cell[BoxData[ RowBox[{"Norm", "[", "u", "]"}]], "Input", CellChangeTimes->{{3.66686892918864*^9, 3.6668689319132495`*^9}},ExpressionUUID->"c0fbccd4-d046-403f-be0f-\ 85887723076b"], Cell[BoxData[ RowBox[{"Norm", "[", "a", "]"}]], "Input", CellChangeTimes->{{3.6668688177756386`*^9, 3.6668688204449944`*^9}, { 3.666868905101922*^9, 3.6668689052647305`*^9}},ExpressionUUID->"46189031-2f8e-460d-82f1-\ b835ff2b2633"] }, Open ]], Cell[CellGroupData[{ Cell["Matrices are lists of lists", "Subsection", CellChangeTimes->{{3.6668682291318913`*^9, 3.6668682363365774`*^9}, { 3.682094550070943*^9, 3.682094560856857*^9}},ExpressionUUID->"249ff703-3797-42dd-bad9-\ 775c113b1ba6"], Cell[BoxData[ RowBox[{"m", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"11", ",", "12"}], "}"}], ",", RowBox[{"{", RowBox[{"21", ",", "22"}], "}"}]}], "}"}]}]], "Input", CellChangeTimes->{{3.586108791616685*^9, 3.586108817272934*^9}, 3.586109027085434*^9},ExpressionUUID->"9317f060-f288-4bda-9ede-\ b4da5866759d"], Cell[BoxData[ RowBox[{"TableForm", "[", "m", "]"}]], "Input", CellChangeTimes->{{3.66686825164789*^9, 3.6668682558658805`*^9}},ExpressionUUID->"f4f790b1-5ed8-4b02-a0d5-\ 3aff4af7bd17"], Cell["remember, there are many kinds of multiplication of lists", "Text", CellChangeTimes->{{3.666868332014702*^9, 3.6668683605430555`*^9}, { 3.6820945900074186`*^9, 3.682094604810093*^9}},ExpressionUUID->"1f85f7d6-55e0-4cca-bfde-\ d1fb77fefcfc"], Cell[BoxData[ RowBox[{"m", " ", "u", " ", RowBox[{"(*", " ", RowBox[{ "may", " ", "be", " ", "this", " ", "result", " ", "is", " ", "unexpected"}], "*)"}]}]], "Input", CellChangeTimes->{{3.666868304335669*^9, 3.6668683050519905`*^9}, { 3.666868366162393*^9, 3.6668683798589854`*^9}, {3.6820946246201057`*^9, 3.6820946425858355`*^9}},ExpressionUUID->"1cec3716-0b74-4563-acd4-\ 262de4810c11"], Cell[BoxData[ RowBox[{"m", ".", "u", " ", RowBox[{"(*", " ", RowBox[{ RowBox[{ "this", " ", "is", " ", "how", " ", "we", " ", "multiply", " ", "a", " ", "matrix", " ", "by", " ", "a", " ", "vector"}], ",", " ", RowBox[{"as", " ", "we", " ", "are", " ", "used", " ", "to"}]}], " ", "*)"}]}]], "Input", CellChangeTimes->{{3.666868311445393*^9, 3.666868313747185*^9}, { 3.6668683845949974`*^9, 3.666868398653589*^9}, {3.6820946549268813`*^9, 3.6820946799265666`*^9}, 3.68213584724372*^9},ExpressionUUID->"ffc4962c-5dba-4b0d-a579-\ 6c3b4a67f98e"], Cell[BoxData[ RowBox[{"u", " ", "m"}]], "Input", CellChangeTimes->{{3.666868407414702*^9, 3.66686840796803*^9}},ExpressionUUID->"431c8df1-7aad-4a39-96e8-\ 2995e5fe709c"], Cell[BoxData[ RowBox[{ RowBox[{"u", " ", "m"}], " ", "\[Equal]", " ", RowBox[{"m", " ", "u"}]}]], "Input", CellChangeTimes->{{3.682094711501095*^9, 3.682094715071369*^9}},ExpressionUUID->"4a835176-1df5-4d0b-b495-\ 1c1d300557ab"], Cell[BoxData[ RowBox[{ RowBox[{"m", " ", "u"}], " ", "\[Equal]", " ", RowBox[{"m", ".", "u"}]}]], "Input", CellChangeTimes->{{3.6820947197550073`*^9, 3.6820947234708395`*^9}},ExpressionUUID->"0954c3fd-1955-42b7-860c-\ e9aecb442905"], Cell[BoxData[ RowBox[{"2", "\[Equal]", "3"}]], "Input", CellChangeTimes->{{3.682135983593911*^9, 3.682135987525251*^9}},ExpressionUUID->"e236d650-1eef-4124-b1d3-\ e3b15ba43853"], Cell["\<\ An identity (asked by the C-like operator == ) can be True, False, or \ undetermined; when Mathematica cannot figure out whether it is True or False, \ it repeats the statement. \ \>", "Text", CellChangeTimes->{{3.682135891189131*^9, 3.6821360632872076`*^9}},ExpressionUUID->"016a0232-04b4-436d-8fed-\ 9f1ad0267dcf"], Cell[TextData[StyleBox["Every single-level list can be interpreted as a \ single line- or column-matrix to allow for the matrix product", FontSlant->"Italic"]], "Text", CellChangeTimes->{{3.666868775965621*^9, 3.6668687918418255`*^9}, { 3.6820947471699333`*^9, 3.6820948255222692`*^9}, {3.6821361012847004`*^9, 3.682136121209532*^9}, {3.682136152840276*^9, 3.6821361540877953`*^9}},ExpressionUUID->"cadd244c-c180-473e-82ee-\ da55e204f1ed"], Cell[BoxData[ RowBox[{"u", ".", "m", " ", RowBox[{"(*", " ", RowBox[{ RowBox[{ "Mathematica", " ", "does", " ", "not", " ", "distinguish", " ", "line", " ", "from", " ", "column", " ", RowBox[{"vector", ".", " ", "Odd"}], " ", "at", " ", "the", " ", "beginning"}], ",", " ", RowBox[{"quite", " ", "convenient", " ", "in", " ", RowBox[{"practice", "."}]}]}], " ", "*)"}]}]], "Input", CellChangeTimes->{{3.666868413536106*^9, 3.66686848240434*^9}, { 3.682094831709087*^9, 3.682094848358983*^9}, {3.6820948923398676`*^9, 3.6820949253682175`*^9}},ExpressionUUID->"8840b7d4-8411-480c-bcb1-\ 7c7000e23055"], Cell[BoxData[ RowBox[{"u", ".", "m", ".", "u", " ", RowBox[{"(*", " ", RowBox[{"this", " ", "is", " ", "an", " ", "escalar"}], " ", "*)"}]}]], "Input", CellChangeTimes->{{3.6668688052046604`*^9, 3.666868806921917*^9}, { 3.6670340738981886`*^9, 3.6670340811233897`*^9}, {3.6820950395803437`*^9, 3.682095056719858*^9}},ExpressionUUID->"7b5246bd-c5d4-4c46-9d58-\ 3b7efacc8175"], Cell[BoxData[ RowBox[{"Det", "[", "m", "]"}]], "Input", CellChangeTimes->{{3.666868839948182*^9, 3.6668688492235394`*^9}},ExpressionUUID->"702c2fad-50ee-41d9-9f41-\ 5eca0c537481"], Cell[BoxData[ RowBox[{"IdentityMatrix", "[", "4", "]"}]], "Input", CellChangeTimes->{{3.6668689844205575`*^9, 3.6668689901587515`*^9}},ExpressionUUID->"f424befa-7cbe-4da5-9b1c-\ 7ac70d57da91"], Cell[BoxData[ RowBox[{"%", "//", "TableForm"}]], "Input", CellChangeTimes->{{3.6668689937441373`*^9, 3.666868998233506*^9}},ExpressionUUID->"d38c3c6b-b70f-4385-8379-\ e0f4879fcef8"], Cell[BoxData[ RowBox[{"DiagonalMatrix", "[", "u", "]"}]], "Input", CellChangeTimes->{{3.6668690074114037`*^9, 3.666869015364975*^9}},ExpressionUUID->"d950d551-c381-4a83-b984-\ 59288c04ce8e"], Cell[BoxData[ RowBox[{"%", "//", "MatrixForm"}]], "Input", CellChangeTimes->{{3.6668690237225513`*^9, 3.6668690300967007`*^9}},ExpressionUUID->"8f35af6b-d422-4caf-a359-\ 82b9422a7993"], Cell[BoxData[ RowBox[{"Diagonal", "[", "m", "]"}]], "Input", CellChangeTimes->{{3.666869043822498*^9, 3.66686904678796*^9}},ExpressionUUID->"21fa1d38-5575-4809-9c77-\ ad6bb0ca3aad"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Exerc\[IAcute]cio", "Section", CellChangeTimes->{{3.699085923666687*^9, 3.699085930362542*^9}},ExpressionUUID->"b58455e4-606d-47bb-8346-\ b9eb5cead1c4"], Cell["\<\ 4) A fun\[CCedilla]\[ATilde]o de probabilidade binomial Comparar a simula\[CCedilla]\[ATilde]o da quantidade de faces 2 em um lan\ \[CCedilla]amento de 5 dados de seis faces com as respectivas probabilidades \ calculadas. i.\tGere um n\[UAcute]mero aleat\[OAcute]rio binomial com n=5 e p=1/6. ii.\tPrepare uma lista com 100 desses n\[UAcute]meros aleat\[OAcute]rios. iii.\tFa\[CCedilla]a um histograma dessa tabela iv.\tRealize todas essas opera\[CCedilla]\[OTilde]es (i, ii e iii) todas em \ uma \[UAcute]nica linha de c\[OAcute]digo. v.\tFa\[CCedilla]a uma tabela com as probabilidades de obter 0, 1, 2 ... 5 \ faces 2 no lan\[CCedilla]amento de 5 dados. vi.\tFa\[CCedilla]a um gr\[AAcute]fico com o n\[UAcute]mero esperado de faces \ 2 em 100 lan\[CCedilla]amentos de 5 dados; use DiscretePlot[ ] para isso vii.\tSuperponha os gr\[AAcute]ficos dos itens iii e vi \ \>", "Text", CellChangeTimes->{{3.6990859363221703`*^9, 3.6990860168732586`*^9}},ExpressionUUID->"25d343ca-bb0e-4a93-9cb6-\ a07be861688f"] }, Open ]], Cell[CellGroupData[{ Cell["Exercise", "Section", CellChangeTimes->{{3.666882298622964*^9, 3.6668823002552814`*^9}, { 3.6820931794420004`*^9, 3.682093180788166*^9}},ExpressionUUID->"e56b1c78-0ac3-43f8-b48f-\ 5c34c8bfa45b"], Cell[TextData[{ "Compare the simulation of the number of dices that show 2 spots when \ rolling 5 dices (the traditional ones, of 6 faces) with their expected values \ when the dices are true (hence p=1/6) and the set of five is rolled many \ times.\ni. Generate a binomial random number with n = 5 and p = 1/6.\nii. \ Prepare a list with 100 random numbers.\niii. Make an histogram of that \ table.\niv. Develop an instruction that performs all 3 actions i, ii and iii \ in a single line.\nv. Make a table with the calculated probabilities of 0, \ 1, 2, .., 5 dice(s) \n showing two spots when throwing 5 dices.\nvi. Make a \ DiscretePlot[ ] of the expected ", StyleBox["number", FontWeight->"Bold", FontSlant->"Italic"], " of throws that \n showed 2 spots when rolling 5 dices 100 times.\nvii. \ Superimpose the graphics of items iii and vi." }], "Text", CellChangeTimes->{{3.6820951998812017`*^9, 3.682095210628632*^9}, { 3.6820953057168016`*^9, 3.682095758045642*^9}, {3.6820958028231845`*^9, 3.68209595281548*^9}, {3.682135529718293*^9, 3.6821356825947723`*^9}, { 3.6821362401849747`*^9, 3.682136294330301*^9}},ExpressionUUID->"4af009e4-db87-40ff-89c3-\ 8754ea10eaf2"] }, Open ]] }, Open ]] }, WindowSize->{1012, 709}, WindowMargins->{{29, Automatic}, {Automatic, 19}}, Magnification:>1.4 Inherited, FrontEndVersion->"13.0 for Microsoft Windows (64-bit) (February 4, 2022)", StyleDefinitions->"Default.nb", ExpressionUUID->"8e7e14f4-a2ff-417e-b50c-9c6819052478" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[580, 22, 172, 3, 136, "Title",ExpressionUUID->"2775fbcf-0695-450d-ad4a-70da2cf15577"], Cell[755, 27, 314, 5, 48, "Text",ExpressionUUID->"ae5b656e-bb95-4c5f-9be9-9fec9950139e"], Cell[CellGroupData[{ Cell[1094, 36, 290, 4, 93, "Section",ExpressionUUID->"f73b43e7-d73e-428c-8221-d4754d57cf44"], Cell[CellGroupData[{ Cell[1409, 44, 228, 4, 75, "Subsection",ExpressionUUID->"16c88c03-8f0c-4d90-8b0d-c1920dfc1c85"], Cell[1640, 50, 235, 6, 39, "Input",ExpressionUUID->"ed4e2d38-e837-4e74-96f7-34b2121656d7"] }, Open ]], Cell[CellGroupData[{ Cell[1912, 61, 294, 6, 75, "Subsection",ExpressionUUID->"21bc557e-19ee-4d3e-8ab3-b8af1efaa987"], Cell[2209, 69, 386, 11, 39, "Input",ExpressionUUID->"5cabe936-7909-4e79-b267-97427b8f28e9"], Cell[2598, 82, 417, 12, 39, "Input",ExpressionUUID->"67731796-9f8c-410f-acf8-fa27aa72c0be"], Cell[3018, 96, 178, 4, 39, "Input",ExpressionUUID->"3c88c192-25b3-4228-9f58-2de2b280aef2"], Cell[3199, 102, 175, 4, 39, "Input",ExpressionUUID->"6b8bd171-58e2-40cd-bf19-15d628b340df"], Cell[3377, 108, 240, 6, 48, "Text",ExpressionUUID->"9c4b29bd-357f-4e24-8a8d-4592630a610a"], Cell[3620, 116, 186, 4, 39, "Input",ExpressionUUID->"2eb242f9-7c98-4e89-ae28-dec65bfd0b9a"] }, Open ]], Cell[CellGroupData[{ Cell[3843, 125, 227, 4, 75, "Subsection",ExpressionUUID->"753d6b42-afda-49f4-b383-b1c478a32b76"], Cell[4073, 131, 346, 7, 39, "Input",ExpressionUUID->"8b96117d-cef7-49a4-af45-87789a62acfe"], Cell[4422, 140, 203, 5, 39, "Input",ExpressionUUID->"fabce779-077d-4e33-816f-ffa615ac8986"], Cell[4628, 147, 224, 6, 39, "Input",ExpressionUUID->"c60f1c55-0921-44d5-8929-570c940db059"], Cell[4855, 155, 188, 4, 39, "Input",ExpressionUUID->"7c2fb7c9-5af1-48bb-bf30-c5f78683ee21"], Cell[5046, 161, 187, 4, 39, "Input",ExpressionUUID->"71555705-a759-488e-a96b-ad6c0ae74a8c"], Cell[5236, 167, 230, 6, 39, "Input",ExpressionUUID->"5e920b93-0670-42c9-8129-58bb50064a95"], Cell[5469, 175, 270, 7, 39, "Input",ExpressionUUID->"ce8870f4-a34a-4a38-9e46-dc53a77d38a3"], Cell[5742, 184, 129, 3, 39, "Input",ExpressionUUID->"903c232d-4a87-4dd3-837d-0af82c39f2b5"], Cell[5874, 189, 286, 7, 48, "Text",ExpressionUUID->"653e6935-00a4-47df-9eec-9a345c9c55f1"], Cell[6163, 198, 393, 9, 39, "Input",ExpressionUUID->"28205754-6e3e-4452-b6ea-71dc2f8fedee"], Cell[6559, 209, 258, 6, 39, "Input",ExpressionUUID->"1a0c11dc-8dc5-485d-973f-200f5bc77c93"], Cell[6820, 217, 876, 23, 67, "Input",ExpressionUUID->"455b12de-515c-470c-9f34-dae493607686"] }, Open ]], Cell[CellGroupData[{ Cell[7733, 245, 233, 4, 75, "Subsection",ExpressionUUID->"a625d231-0eea-4ad7-89b1-6bf85e90e87b"], Cell[7969, 251, 186, 4, 39, "Input",ExpressionUUID->"2f0d16f4-864a-4801-93e4-e56be562ca65"], Cell[8158, 257, 290, 8, 39, "Input",ExpressionUUID->"d4664b8b-6ba3-4375-9d2e-15aa76dd5f05"], Cell[8451, 267, 248, 6, 39, "Input",ExpressionUUID->"7edb85f1-92cc-4ba5-9f5b-6fbd08272134"], Cell[8702, 275, 290, 7, 48, "Text",ExpressionUUID->"9c8278cc-fdd3-4507-a7fa-17098ca906ac"], Cell[8995, 284, 292, 8, 39, "Input",ExpressionUUID->"8133ef63-804a-4fd1-9b57-eebe02fd5255"], Cell[9290, 294, 219, 4, 48, "Text",ExpressionUUID->"d27e3259-ea21-4557-a832-8f1a6f9a6f22"], Cell[9512, 300, 333, 9, 39, "Input",ExpressionUUID->"c6e0505f-be83-4c95-94c1-2d72511817e6"] }, Open ]], Cell[CellGroupData[{ Cell[9882, 314, 214, 4, 75, "Subsection",ExpressionUUID->"eb965f21-5e46-47ec-921d-4b243879eb6c"], Cell[10099, 320, 228, 6, 39, "Input",ExpressionUUID->"c4164977-92c4-43c1-a0ee-6ccf8f536ad0"], Cell[10330, 328, 184, 4, 39, "Input",ExpressionUUID->"c0fbccd4-d046-403f-be0f-85887723076b"], Cell[10517, 334, 238, 5, 39, "Input",ExpressionUUID->"46189031-2f8e-460d-82f1-b835ff2b2633"] }, Open ]], Cell[CellGroupData[{ Cell[10792, 344, 228, 4, 75, "Subsection",ExpressionUUID->"249ff703-3797-42dd-bad9-775c113b1ba6"], Cell[11023, 350, 351, 10, 39, "Input",ExpressionUUID->"9317f060-f288-4bda-9ede-b4da5866759d"], Cell[11377, 362, 189, 4, 39, "Input",ExpressionUUID->"f4f790b1-5ed8-4b02-a0d5-3aff4af7bd17"], Cell[11569, 368, 252, 4, 48, "Text",ExpressionUUID->"1f85f7d6-55e0-4cca-bfde-d1fb77fefcfc"], Cell[11824, 374, 413, 9, 39, "Input",ExpressionUUID->"1cec3716-0b74-4563-acd4-262de4810c11"], Cell[12240, 385, 586, 13, 39, "Input",ExpressionUUID->"ffc4962c-5dba-4b0d-a579-6c3b4a67f98e"], Cell[12829, 400, 174, 4, 39, "Input",ExpressionUUID->"431c8df1-7aad-4a39-96e8-2995e5fe709c"], Cell[13006, 406, 238, 6, 39, "Input",ExpressionUUID->"4a835176-1df5-4d0b-b495-1c1d300557ab"], Cell[13247, 414, 242, 6, 39, "Input",ExpressionUUID->"0954c3fd-1955-42b7-860c-e9aecb442905"], Cell[13492, 422, 182, 4, 39, "Input",ExpressionUUID->"e236d650-1eef-4124-b1d3-e3b15ba43853"], Cell[13677, 428, 330, 7, 79, "Text",ExpressionUUID->"016a0232-04b4-436d-8fed-9f1ad0267dcf"], Cell[14010, 437, 449, 7, 79, "Text",ExpressionUUID->"cadd244c-c180-473e-82ee-da55e204f1ed"], Cell[14462, 446, 653, 14, 67, "Input",ExpressionUUID->"8840b7d4-8411-480c-bcb1-7c7000e23055"], Cell[15118, 462, 393, 8, 39, "Input",ExpressionUUID->"7b5246bd-c5d4-4c46-9d58-3b7efacc8175"], Cell[15514, 472, 184, 4, 39, "Input",ExpressionUUID->"702c2fad-50ee-41d9-9f41-5eca0c537481"], Cell[15701, 478, 197, 4, 39, "Input",ExpressionUUID->"f424befa-7cbe-4da5-9b1c-7ac70d57da91"], Cell[15901, 484, 186, 4, 39, "Input",ExpressionUUID->"d38c3c6b-b70f-4385-8379-e0f4879fcef8"], Cell[16090, 490, 195, 4, 39, "Input",ExpressionUUID->"d950d551-c381-4a83-b984-59288c04ce8e"], Cell[16288, 496, 189, 4, 39, "Input",ExpressionUUID->"8f35af6b-d422-4caf-a359-82b9422a7993"], Cell[16480, 502, 186, 4, 39, "Input",ExpressionUUID->"21fa1d38-5575-4809-9c77-ad6bb0ca3aad"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[16715, 512, 162, 3, 93, "Section",ExpressionUUID->"b58455e4-606d-47bb-8346-b9eb5cead1c4"], Cell[16880, 517, 1021, 19, 391, "Text",ExpressionUUID->"25d343ca-bb0e-4a93-9cb6-a07be861688f"] }, Open ]], Cell[CellGroupData[{ Cell[17938, 541, 206, 4, 93, "Section",ExpressionUUID->"e56b1c78-0ac3-43f8-b48f-5c34c8bfa45b"], Cell[18147, 547, 1197, 21, 391, "Text",ExpressionUUID->"4af009e4-db87-40ff-89c3-8754ea10eaf2"] }, Open ]] }, Open ]] } ] *)