Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- y <- rnorm( n = 1000, m = 100, sd = 2.551 )
- hist(y)
- # select all of the bags weight 95 or less
- bags95 <- y[ y <= 95 ]
- # count how many of them there are
- length(bags95)
- # let's make a function that does our experiment,
- # get some bags and return their mean.***
- getBags <- function(n){
- x <- rnorm(n = n, m = 100, sd = 2.551)
- mean(x)}
- # now let's get the bags
- y <- replicate( 1000, getBags(50) )
- sd(y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement