Properties of Bernoulli random variables

  • Theorem: Let XBernoulli(p), then:
    • E[X]=p
    • E[X2]=p
    • Var[X]=p(1p)
states <- c(0, 1)
p <- 0.3

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