Manipulate[
moy=5;
dist=NormalDistribution[moy,2];
taille=10;
z=Quantile[NormalDistribution[0,1],1-alpha/2];
Do[
sample[i]=RandomReal[dist,taille],
{i,n}];
occurrence=Table[IntervalMemberQ[Interval[{Mean[sample[i]]-z*StandardDeviation[sample[i]]/Sqrt[taille],Mean[sample[i]]+z*StandardDeviation[sample[i]]/Sqrt[taille]}],moy],{i,n}];
Nb=Count[occurrence,True];
Column[{
Style["nombre d'occurrences : "<>ToString@Nb,{"Times",18}],
Style["% d'occurrences : "<>ToString[Round[Nb/n*100]],{"Times",16}],
Style["Intervalle de confiance : "<>ToString[(1-alpha)*100],{"Times",16}],
Show[
Graphics@{White,Line[{{2,0},{8,0},{8,n+1},{2,n+1}}]},
Table[Graphics@{PointSize[0.015],Point[{Mean[sample[i]],i}]},{i,n}],
Table[
Graphics[Line[{{Mean[sample[i]]-z*StandardDeviation[sample[i]]/Sqrt[taille],i},{Mean[sample[i]]+z*StandardDeviation[sample[i]]/Sqrt[taille],i}}]]
,{i,n}],Frame->True,ImageSize->{900,600},Epilog->{Red,Thick,Line[{{moy,0},{moy,n+1}}]}
]
}]
,{{n,10,"nombre d'échantillons"},1,100,1}
,{{alpha,0.32,"1-α intervalle de confiance, α ="},0,1},
ContinuousAction->None]