I am using a code in R for Binomial distribution. I will be giving you two graphs, one for the simulated sample and another for the original distribution.
Following is the code.
#######################################
par(mfrow=c(2,1))
x=rbinom(10000,30,0.6)
hist(x,freq=FALSE,xlim=c(0,30),main="Density Plot for Binominal
sample",ylim=c(0,0.17))
theo=0:30
den=dbinom(theo,30,0.6)
plot(den,x=theo,type="b",main="Theoretical Binomial
Plot",ylim=c(0,0.17),xlab="x",ylab="Density")
######################################
This is the graph.
If you do not get anything in this solution, please put a comment and I will help you out. Do not give a downvote instantly. It is a humble request. If you like my answer, please give an upvote.
Get Answers For Free
Most questions answered within 1 hours.