-# We write a function that we are going to replicate
-simulation <- function(rate = .1, n = 62){
- # Draw n random numbers from a uniform distribution from 0 to 1
- draws = runif(n)
- # If rate = .4, on average, .4 of the draws will be less than .4
- # So, we consider those draws where the value is less than `rate` as complications
- complication_count = sum(draws < rate)
- # Then, we return the total count
- return(complication_count)
-}