When Can We Approximate the Binomial Distribution with a Normal Distribution?
First, we enter the data and create a graph that also includes a normal distribution curve with the calculated mean and standard deviation of the binomial distribution.
n=200
p=0.5
q=0.5
mu=n*p
s=sqrt(n*p*q)
mu
## [1] 100
s
## [1] 7.071
x=0:200
y=dbinom(x,n,p)
plot(x,y,type="h",lwd=2,col="red")
xx=seq(0,200,length=200)
yy=dnorm(xx,mu,s)
lines(xx,yy,lwd=2,col="blue")
pbinom(98,n,p)
## [1] 0.416
pnorm(98,mu,s)
## [1] 0.3886
The answers from lines 44 and 45 are fairly close. Probably because there was a large sample size.