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" )