Statistics, Data Science, R Programming, Programming, Machine Learning.
probability mass function plot(0:x, dbern(0:x, prob), type = ‘h’) to plot the probability mass function, specifying the plot to be a histogram (type=’h’) For a fair coin tossed once, the probability mass function for a Bernoulli distribution is: success<-0:1 plot(success,dbern(success, prob = 0.5)