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

n=60;
horniMez=((0.2n-n*Ex)/((Sqrt[n])*(Sqrt[Dx])))

pravdepodobnost=Integrate[PDF[NormalDistribution[0,1],x],{x,-∞,horniMez}];
Print["pravdepodobnost je ",pravdepodobnost]

PDF[NormalDistribution[μ,σ],x]

dats:=RandomReal[NormalDistribution[Ex,(Sqrt[Dx])],20]

Quiet@Remove["Global`*"];
SeedRandom[1];
rnd:=RandomReal[NormalDistribution[0,1]];
nBodu=400;
body[k_]:={#,2+0.1#+0.Sin[0.00001(((#+0.5nBodu))^2)]+k*rnd}&/@Range[nBodu];
ListPlot/@{body[0.1],body[1]};

dejKorelaci[k_]:=Module[{mb,xka,yka,korr},
mb=body[k];
xka=mb/.{a_,b_}:>a;
yka=mb/.{a_,b_}:>b;
korr=Correlation[xka,yka];
ListPlot[mb,PlotLabel->"ρ= "<>ToString[korr]<>", corDist= "<>ToString[TraditionalForm@CorrelationDistance[xka,yka]]]
];
dejKorelaci[5]