diff --git a/montecarlo/plots.m b/montecarlo/plots.m new file mode 100644 index 0000000000000000000000000000000000000000..5fa7f225fa86604d061957f8b1d5a0e61818d19a --- /dev/null +++ b/montecarlo/plots.m @@ -0,0 +1,30 @@ +(* ::Package:: *) + +(* ::Section:: *) +(*P(Z^n | start 011..11) on the chain {1,...,n}*) + + +rawdata=Import[NotebookDirectory[]<>"data/data_reach_chain_end.m"]; +data=GatherBy[rawdata,{#[[2]]}&]; +(* data[[n index, prob index, p / n / prob / runs within timelimit / total runs]] *) +nlabels=Map["n = "<>ToString[#[[1,2]]]&,data]; + + +plotZoomed=ListPlot[data[[All,All,{1,3}]], +Joined->True, +PlotMarkers->Automatic, +PlotRange->{{0.6,0.7},{0,0.5}}, +Frame->True, +ImageSize->250, +Epilog->{Dashed,Line[{{1-1/E,0},{1-1/E,1}}]} +]; + +plotBoth=ListPlot[data[[All,All,{1,3}]], +Joined->True, +FrameLabel->{"p (probability of BAD)","P(\!\(\*SuperscriptBox[\(Z\), \(n\)]\) | start 011..11)"}, +PlotMarkers->Automatic, +PlotLegends->nlabels, +PlotRange->{{0,1},{0,1}}, +Frame->True, +ImageSize->500, +Epilog->Inset[plotZoomed,Scaled[{0.32,0.6}]]]