Home About us Mathematical Epidemiology Rweb EPITools Statistics Notes Web Design Contact us Links |
dgeom(x,prob=p)
gives you the probability that
there will be x failures before the first success; the
success probability is p. Having x failures before
the first success means that the first success would happen on
the x+1st trial.
> dgeom(0,prob=0.5)
What is the chance that the success happens on the third trial,
when the success probability is 1/6?
> dgeom(2,prob=1/6)
You can use rgeom
to do a random experiment.
Suppose the success probability is 0.1. Simulate 1000 experiments:
> z <- rgeom(1000,prob=0.1)
> mean(z)