Geometric Distribution and Base R Course X counts trials until first success: 1,2,... Base R counts failures before first success: 0,1,... P(course X=x): dgeom(x-1,prob=p) P(course X<=x): pgeom(x-1,prob=p) Simulation: rgeom(size,prob=p)+1 Course mean: 1/p; variance: (1-p)/p^2. Original educational material created for STATLAB Academy. Textbooks may be used only as curriculum references.