Skip to content
Prev 177489 / 398502 Next

Binomial simulation

This sounds like a potential homework problem. You don't quite need to
simulate anything if your question is all you have been asked to do.

dbinom(x = 1:10, size = 10, prob = 0.25)

Perhaps you have been asked to simulate 1000 realizations and compare
the relative frequencies with these probabilities: use 

rbinom(n = 1000, size = 10, prob = 0.25)

in that case and compare the relative frequencies.

Btw, there is a small chance of getting a 0. Are you sure the
instructor (or whoever has issued the orders) wants only from 1:10?

HTH!
Ranjan

On Fri, 17 Apr 2009 22:23:11 -0700 (PDT) beetle2
<samandbrendan at aapt.net.au> wrote: