data={18,12,18,13,13,16,11,17,20,14,15,14,16,15,15,17,13,14,16,13}

n=20;
aritpriem=Mean[data];
sigma=1;

(* 90%ny *)

MeanCI[data,KnownVariance->1,ConfidenceLevel->1-2*0.1]

kvantil=Quantile[NormalDistribution[0,1],0.95];
(* 95% ny lavy a pravy *)

lstrana=aritpriem-(kvantil*sigma)/(Sqrt[n])

pstrana=aritpriem+(kvantil*sigma)/(Sqrt[n])

(* uloha 2 *)

data={18,18.4,19,20.2,19.6,18.6,19.4,17,18.5,19}

sigma=1.5

n=10;

kvantil=Quantile[NormalDistribution[0,1],0.9];
aritpriem=Mean[data]

(*99% IS*)
MeanCI[data,KnownVariance->sigma,ConfidenceLevel->1-2*0.01]

(*90% ny lavostranny a pravostranny*)
lstrana=aritpriem-(kvantil*sigma)/(Sqrt[n])

pstrana=aritpriem+(kvantil*sigma)/(Sqrt[n])

(* 3. uloha *)
data={40,45,75,80,90,90,85,79,110,105,125,120,120,130,135,140,150,180,180,200};

(*4. uloha*)

data4={32.5,45.2,32.8,39,41.2,38.3,31.9}

MeanCI[data4,KnownVariance->10.72,ConfidenceLevel->0.95]

MeanCI[data4,KnownVariance->10.72,ConfidenceLevel->0.8]

MeanCI[data4,KnownVariance->10.72,ConfidenceLevel->0.8]

MeanCI[data4,ConfidenceLevel->0.95]

MeanCI[data4,ConfidenceLevel->0.8]

VarianceCI[data4,ConfidenceLevel->0.90]

(*5. uloha*)
data5={28,29,30,30,27,31,29,25,30,32}

MeanCI[data5,KnownVariance->2.98,ConfidenceLevel->0.99]

MeanCI[data5,KnownVariance->2.98,ConfidenceLevel->0.9]

MeanCI[data5,ConfidenceLevel->0.9]

MeanCI[data5,ConfidenceLevel->0.98]

VarianceCI[data5,ConfidenceLevel->0.95]

VarianceCI[data5,ConfidenceLevel->0.8]

(*6. uloha *)

data6={2345,2875,2638,2743,2738,2438,2094,2845,2875,2986}

MeanCI[data6,ConfidenceLevel->0.95]

MeanCI[data6,ConfidenceLevel->0.8]

VarianceCI[data6,ConfidenceLevel->0.9]

VarianceCI[data6,ConfidenceLevel->0.9]