Properties of Bernoulli random variables

  • Theorem: Let \(X \sim Bernoulli(p)\), then:
    • \(\mathbb{E}[X] = p\)
    • \(\mathbb{E}[X^2] = p\)
    • \(Var[X] = p\cdot (1-p)\)
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"
)