Probability of an event: proportion of times the event occurs when we repeat the experiment over and over, independently and under the same conditions.

\(Pr(A)\) is probability of an event A happeneing.

Event:things that can happens when something happens by chance.

Monte Carlo Simulations

beads <- rep(c("red", "blue"), times = c(2,3))

sample(beads, 1)
## [1] "blue"
B <- 10000
events <- replicate(B, sample(beads, 1))

table(events)
## events
## blue  red 
## 5999 4001
prop.table(table(events))
## events
##   blue    red 
## 0.5999 0.4001

It’s important to note that the sample() function above is choosing samples without replacement, meaning if you ask for 6 beads such as sample(beads,6), R will throw out wrror because beads() only have 5 beads.