Quiet@Remove["Global`*"];
SetDirectory[NotebookDirectory[]];
$HistoryLength=3;

data={{0,0.9},{1,0.05},{2,0.02},{3,0.015},{4,0.015}};
Ex=Total[data/.{a_,b_}:>a*b];
Print["stredni hodnota= ",Ex];
ExKvadrat=Total[data/.{a_,b_}:>(a^2)*b];
Dx=ExKvadrat-(Ex^2);
Print["(σ^2)= ",Dx];
Print["(Ex^2)=",ExKvadrat]

n=20;
hranice=((0.3*n-n*Ex)/(Sqrt[n*Dx]))

normRozdeleni=PDF[NormalDistribution[0,1],x]
Integrate[normRozdeleni,{x,-∞,hranice}]

hranice0=((-0.1*n-n*Ex)/(Sqrt[n*Dx]))
Integrate[normRozdeleni,{x,-∞,hranice0}]

PDF[NormalDistribution[μ,σ],x]

Quiet@Remove["Global`*"];
SeedRandom[1];
rnd:=RandomReal[NormalDistribution[0,1]];
nBodu=80;
origFce:=1+5*(((((#-0.4nBodu)/nBodu)))^2)&;
body1=origFce/@Range[nBodu];
funkceZavislosti:=(((((#-0.1nBodu)/nBodu)))^2)+0.2#+0.1rnd&;
body2=funkceZavislosti/@body1;
korr=Correlation[body1,body2];
Show[ListPlot[body1,PlotLabel->"ρ= "<>ToString[TraditionalForm@korr]],ListPlot[body2,PlotStyle->Red]]