Estimating the PMF of a Geometric Random Variable by Simulation

p:=0.3;

rel=Table[
If[Random[]≤ p, 1, 0]
,{100}]

geometricRV := First[First[Position[Table[
If[Random[]≤ p, 1, 0]
,{100}],1]]]

hist=Tally[Table[geometricRV,{100}] ]

empPMF=Sort[Map[N[{#[[1]],((#[[2]])/100)}]&,hist]]

PMF = Table[ {x,p (((1-p))^(x-1))},{x,1,18}]

ListPlot[{PMF,empPMF},Filling->Axis]