Geometric random variable

  • Definition: Let X be a geometric random variable, then:
    • pX(k)=(1p)k1p, where p is a fixed value in (0,1) called the geometric parameter and k is a positive integer.
    • Notation: XGeometric(p)
  • Theorem: Let XGeometric(p), then:
    • E[X]=1/p
    • E[X2]=2/p21/p
    • Var[X]=1pp2
n <- 20
states <- 1:n
p <- 0.4

plot(
  states, dgeom(states, p), type = 'h',
  ylim = c(0, 1), main = "Geom(p)",
  xlab = "States", ylab = "Probabilities"
)