## simulation of the sum of 24 dice rolls ## ADM 10/1/2007 ## number of simulations G <- 1000 ## place to hold draws holder <- rep(NA, G) ## perform simulation for(g in 1:G) { holder[g] <- sum(sample(c(1,2,3,4,5,6), 24, replace=TRUE)) } ## create histogram hist(holder, freq=FALSE) ## summarize the draws summary(holder)