library(tigerstats) set.seed(12345) r<-10000 binom1<-rbinom(r, 25, 0.1) binom2<-rbinom(r, 25, 0.2) binom5<-rbinom(r, 25, 0.5) binom7<-rbinom(r, 25, 0.7) par(mfrow=c(2,2)) hist(binom1, breaks=100, xlab="n=25 p=0.1") hist(binom2, breaks=100, xlab="n=25 p=0.2") hist(binom5, breaks=100, xlab="n=25 p=0.5") hist(binom7, breaks=100, xlab="n=25 p=0.7") #This gives P(X <= 6) for binom X with 10 trials, chance of success 0.70 on each trial: pbinomGC(6,region="below",size=10,prob=0.70, graph=T) #This gives P(X >= 7) = P(X > 6), for binom X with 10 trials, #70% chance of success on each trial pbinomGC(6,region="above",size=10,prob=0.7, graph=T) #This gives P(45 <= X <= 55), where X is binom with 100 trials, #chance of success on each trial p = 0.50: pbinomGC(c(45,55),region="between",size=100,prob=0.50, graph=T)