(* 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[ 11283, 282] NotebookOptionsPosition[ 9503, 245] NotebookOutlinePosition[ 9844, 260] CellTagsIndexPosition[ 9801, 257] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"SetDirectory", "[", RowBox[{"NotebookDirectory", "[", "]"}], "]"}]], "Input", CellChangeTimes->{ 3.814853058743206*^9, {3.8148531576408625`*^9, 3.814853159080945*^9}}, CellLabel->"In[1]:=",ExpressionUUID->"fae206e0-ca00-4585-af4c-37e991b438a0"], Cell[BoxData["\<\"D:\\\\vv\"\>"], "Output", CellChangeTimes->{{3.814932469579048*^9, 3.814932494361466*^9}}, CellLabel->"Out[1]=",ExpressionUUID->"7edad036-cee7-4630-bc0b-c6130a8906df"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"strm", "=", RowBox[{"OpenRead", "[", "\"\\"", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Print", "[", RowBox[{"Read", "[", RowBox[{"strm", ",", "String"}], "]"}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"NI", "=", RowBox[{"{", "}"}]}], ";", RowBox[{"MI", "=", RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Do", "[", RowBox[{ RowBox[{ RowBox[{"NI", "=", RowBox[{"Append", "[", RowBox[{"NI", ",", RowBox[{"Read", "[", RowBox[{"strm", ",", "Number"}], "]"}]}], "]"}]}], ";", RowBox[{"MI", "=", RowBox[{"Append", "[", RowBox[{"MI", ",", RowBox[{"Read", "[", RowBox[{"strm", ",", "Number"}], "]"}]}], "]"}]}]}], ",", RowBox[{"{", "1310", "}"}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Close", "[", "strm", "]"}], ";"}], RowBox[{"(*", RowBox[{"Read", " ", "election", " ", "data"}], " ", "*)"}]}]}], "Input", CellChangeTimes->{{3.745822704279211*^9, 3.7458227169776335`*^9}, { 3.7458232909182415`*^9, 3.745823321853096*^9}, 3.7458269505006094`*^9, 3.745827018750729*^9, 3.745828661627013*^9, {3.8134684099074135`*^9, 3.8134684410918684`*^9}, {3.8134684896859536`*^9, 3.813468506377983*^9}, { 3.8134685669090896`*^9, 3.813468590699131*^9}, {3.8134686738316774`*^9, 3.8134686809452896`*^9}, {3.8134687920954847`*^9, 3.813468793842688*^9}, { 3.8134688379751654`*^9, 3.8134688497219863`*^9}, {3.8134688826380444`*^9, 3.8134689278781233`*^9}, {3.813468992509037*^9, 3.8134690331627083`*^9}, { 3.8134705350190363`*^9, 3.813470539324644*^9}, {3.813470632519208*^9, 3.813470633252409*^9}, 3.813470669425273*^9, {3.8134707847390766`*^9, 3.8134708138331275`*^9}, {3.813470853488397*^9, 3.8134708569204035`*^9}, { 3.813470932050135*^9, 3.81347093492054*^9}, {3.8139970757485256`*^9, 3.813997178577407*^9}, 3.813997220507805*^9, {3.814008919386244*^9, 3.8140089339098697`*^9}, {3.814011343282702*^9, 3.8140113440939035`*^9}, { 3.81402082626497*^9, 3.814020827466172*^9}, {3.814785665158472*^9, 3.8147856973683143`*^9}, {3.814785762911063*^9, 3.814785935487934*^9}, { 3.8147859677227774`*^9, 3.814785989147003*^9}, {3.8148463014499445`*^9, 3.814846305072152*^9}}, CellLabel->"In[2]:=",ExpressionUUID->"9f8fce77-c835-4962-bfc2-e0473d5744a0"], Cell[BoxData["\<\"Election data Ni and Mi\"\>"], "Print", CellChangeTimes->{{3.8149324700900774`*^9, 3.814932494626481*^9}}, CellLabel-> "During evaluation of \ In[2]:=",ExpressionUUID->"4e626c86-5d27-45dc-b1a8-15931f78e024"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"MeanMI", "=", RowBox[{ FractionBox["1", "1310."], RowBox[{ UnderoverscriptBox["\[Sum]", RowBox[{"i", "=", "1"}], "1310"], RowBox[{"MI", "[", RowBox[{"[", "i", "]"}], "]"}]}]}]}]], "Input", CellChangeTimes->{{3.8148493649129314`*^9, 3.8148494106205454`*^9}, { 3.8148496500622406`*^9, 3.8148496524343767`*^9}}, CellLabel->"In[7]:=",ExpressionUUID->"039a5a8d-c2cc-4e35-bacb-81c467155304"], Cell[BoxData["883.8106870229008`"], "Output", CellChangeTimes->{{3.8149324702630873`*^9, 3.814932494732487*^9}}, CellLabel->"Out[7]=",ExpressionUUID->"6c051a94-7dfc-46f2-aef4-a7ed94123a97"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"MeanNI", "=", RowBox[{ FractionBox["1", "1310."], RowBox[{ UnderoverscriptBox["\[Sum]", RowBox[{"i", "=", "1"}], "1310"], RowBox[{"NI", "[", RowBox[{"[", "i", "]"}], "]"}]}]}]}]], "Input", CellChangeTimes->{{3.8148494314627376`*^9, 3.8148494351979513`*^9}, { 3.8148496270639253`*^9, 3.814849635663417*^9}}, CellLabel->"In[8]:=",ExpressionUUID->"b0e4b9d2-13c0-44bd-a36a-87fc9e90406e"], Cell[BoxData["1432.0595419847327`"], "Output", CellChangeTimes->{{3.814932470388095*^9, 3.814932494812492*^9}}, CellLabel->"Out[8]=",ExpressionUUID->"59db3212-f6b9-4847-b576-7728d19d5c9d"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"mn", "=", RowBox[{"MeanMI", "/", "MeanNI", " ", RowBox[{"(*", RowBox[{ "mean", " ", "value", " ", "persentage", " ", "for", " ", "Lucashenko"}], " ", "*)"}]}]}]], "Input", CellChangeTimes->{{3.8148494386261473`*^9, 3.8148494590403147`*^9}, { 3.8148496683022842`*^9, 3.814849670873431*^9}, {3.814851698808422*^9, 3.814851728365113*^9}, {3.8148532962877927`*^9, 3.814853304072238*^9}}, CellLabel->"In[9]:=",ExpressionUUID->"01c0cfbc-6695-4e3f-8e69-2af2d1ed6773"], Cell[BoxData["0.6171605726658558`"], "Output", CellChangeTimes->{{3.8149324705211024`*^9, 3.814932496022561*^9}}, CellLabel->"Out[9]=",ExpressionUUID->"4a677b21-3df4-4b73-b585-aa988c22dff6"] }, Open ]], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ "Set", " ", "deflection", " ", "form", " ", "the", " ", "mean", " ", "value"}], "*)"}], " "}]], "Input", CellChangeTimes->{{3.8148514821360292`*^9, 3.8148515184451065`*^9}}, CellLabel->"In[10]:=",ExpressionUUID->"0fb718d0-e4dd-4c70-9a04-a913855204d7"], Cell[BoxData[ RowBox[{ RowBox[{"\[CapitalDelta]", "=", "0.15"}], ";"}]], "Input", CellChangeTimes->{{3.8148515294097333`*^9, 3.8148515427944984`*^9}, 3.814851855433381*^9, {3.814853227509859*^9, 3.814853231133066*^9}, { 3.8148533444045453`*^9, 3.814853344784567*^9}, {3.81485345848707*^9, 3.814853460778201*^9}, 3.814932483294833*^9}, CellLabel->"In[11]:=",ExpressionUUID->"8e63eadd-74f0-4a5e-b894-b1f71c6abdb7"], Cell[BoxData[ RowBox[{ RowBox[{"NumberOfSamples", "=", "1000000"}], ";"}]], "Input", CellChangeTimes->{{3.8148515607345247`*^9, 3.81485158530593*^9}, 3.8148516871907578`*^9}, CellLabel->"In[12]:=",ExpressionUUID->"309b542b-c911-4a9f-9887-1922a1802db9"], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{ "If", " ", "computed", " ", "mean", " ", "value", " ", "in", " ", "a", " ", "random", " ", "sample", " ", "of", " ", "327", " ", "from", " ", "1310", " ", "has", " ", "greater", " ", "deflection"}], ",", " ", RowBox[{"print", " ", "it"}]}], " ", "*)"}], " "}]], "Input", CellChangeTimes->{{3.8148515999387674`*^9, 3.8148516074551973`*^9}, { 3.8148518730313873`*^9, 3.814851906772317*^9}, {3.8148532428177347`*^9, 3.8148532733654823`*^9}, {3.8148533875070105`*^9, 3.814853443078189*^9}, { 3.8149325088112926`*^9, 3.814932510883411*^9}, {3.8149325413401527`*^9, 3.8149325481885448`*^9}, {3.8149325798103533`*^9, 3.8149325984464192`*^9}},ExpressionUUID->"5564c35a-2596-4403-a497-\ 5bd35050f4a8"], Cell[BoxData[ RowBox[{"Do", "[", RowBox[{ RowBox[{ RowBox[{"Sample", "=", RowBox[{"RandomSample", "[", RowBox[{ RowBox[{"Range", "[", "1310", "]"}], ",", "327"}], "]"}]}], ";", RowBox[{"z", "=", RowBox[{ UnderoverscriptBox["\[Sum]", RowBox[{"i", "=", "1"}], "327"], RowBox[{ RowBox[{"N", "[", RowBox[{"MI", "[", RowBox[{"[", RowBox[{"Sample", "[", RowBox[{"[", "i", "]"}], "]"}], "]"}], "]"}], "]"}], "/", RowBox[{ UnderoverscriptBox["\[Sum]", RowBox[{"i", "=", "1"}], "327"], RowBox[{"N", "[", RowBox[{"NI", "[", RowBox[{"[", RowBox[{"Sample", "[", RowBox[{"[", "i", "]"}], "]"}], "]"}], "]"}], "]"}]}]}]}]}], ";", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"mn", "-", "\[CapitalDelta]"}], ">", "z"}], "||", RowBox[{"z", ">", RowBox[{"mn", "+", "\[CapitalDelta]"}]}]}], ",", RowBox[{"Print", "[", "z", "]"}]}], "]"}]}], ",", "1000000"}], "]"}]], "Input", CellChangeTimes->{{3.8143700362738724`*^9, 3.8143700684321327`*^9}, { 3.814370111472009*^9, 3.814370122728431*^9}, {3.8143703038781824`*^9, 3.8143703069749885`*^9}, {3.814370358812082*^9, 3.81437037385131*^9}, { 3.8143704070827694`*^9, 3.8143704258388042`*^9}, 3.8143704823939085`*^9, { 3.814500865783807*^9, 3.8145009054120736`*^9}, {3.814500950656661*^9, 3.8145009589631367`*^9}, {3.814501012383192*^9, 3.8145011527982235`*^9}, 3.814501226199422*^9, 3.814501732162361*^9, 3.814851441342696*^9, 3.8148517453820863`*^9, 3.8148517791510177`*^9, {3.8148518103788037`*^9, 3.8148518493800344`*^9}}, CellLabel->"In[14]:=",ExpressionUUID->"56951962-a349-42e9-879a-fd936c509eb3"] }, WindowSize->{1579, 765}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, FrontEndVersion->"12.0 for Microsoft Windows (64-bit) (April 8, 2019)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[567, 22, 275, 5, 45, "Input",ExpressionUUID->"fae206e0-ca00-4585-af4c-37e991b438a0"], Cell[845, 29, 187, 2, 32, "Output",ExpressionUUID->"7edad036-cee7-4630-bc0b-c6130a8906df"] }, Open ]], Cell[CellGroupData[{ Cell[1069, 36, 2461, 53, 196, "Input",ExpressionUUID->"9f8fce77-c835-4962-bfc2-e0473d5744a0"], Cell[3533, 91, 229, 4, 22, "Print",ExpressionUUID->"4e626c86-5d27-45dc-b1a8-15931f78e024"] }, Open ]], Cell[CellGroupData[{ Cell[3799, 100, 444, 11, 56, "Input",ExpressionUUID->"039a5a8d-c2cc-4e35-bacb-81c467155304"], Cell[4246, 113, 191, 2, 32, "Output",ExpressionUUID->"6c051a94-7dfc-46f2-aef4-a7ed94123a97"] }, Open ]], Cell[CellGroupData[{ Cell[4474, 120, 442, 11, 56, "Input",ExpressionUUID->"b0e4b9d2-13c0-44bd-a36a-87fc9e90406e"], Cell[4919, 133, 190, 2, 32, "Output",ExpressionUUID->"59db3212-f6b9-4847-b576-7728d19d5c9d"] }, Open ]], Cell[CellGroupData[{ Cell[5146, 140, 512, 10, 28, "Input",ExpressionUUID->"01c0cfbc-6695-4e3f-8e69-2af2d1ed6773"], Cell[5661, 152, 192, 2, 32, "Output",ExpressionUUID->"4a677b21-3df4-4b73-b585-aa988c22dff6"] }, Open ]], Cell[5868, 157, 314, 7, 28, "Input",ExpressionUUID->"0fb718d0-e4dd-4c70-9a04-a913855204d7"], Cell[6185, 166, 428, 7, 28, "Input",ExpressionUUID->"8e63eadd-74f0-4a5e-b894-b1f71c6abdb7"], Cell[6616, 175, 261, 5, 28, "Input",ExpressionUUID->"309b542b-c911-4a9f-9887-1922a1802db9"], Cell[6880, 182, 794, 15, 28, "Input",ExpressionUUID->"5564c35a-2596-4403-a497-5bd35050f4a8"], Cell[7677, 199, 1822, 44, 72, "Input",ExpressionUUID->"56951962-a349-42e9-879a-fd936c509eb3"] } ] *)