3 ms·
Is that code answers your question? No offense but the main message of that talk is if you can do a for loop than you can do statistics simulation in any progra
by babo 10y ago
Is that code answers your question? No offense but the main message of that talk is if you can do a for loop than you can do statistics simulation in any programming environment. Like in R.
m <- 0
nexp <- 100000
for (i in 1:nexp) {
if (sum(rnorm(30, mean=0, sd=1) < 0) >= 22) {
m <- m + 1
}
}
print(m / nexp)
- kensai 10y agoNow you are finally useful, babo. Seriously. Either not respond or respond as you just* did. Your previous reply was simply uncalled for. :) (*and I will upvote you)