Empirical CDF

p:=0.5;

bern:=If[Random[] ≤ p, 1,0]

X:=bern+bern+bern

NN=10000;

sample=Table[X,{NN}];

empCDF[x_]:=(1/NN) Total[Table[  If[sample[[i]]≤x,1,0]  ,{i,1,NN}]] //N

empCDFcurve=Table[{x,empCDF[x]},{x,-1,4,0.01}];

ListPlot[empCDFcurve]

ListPlot[sample,Joined->True]

sample mean :

((Total[sample])/NN) //N