R Probability Distribution – How to Graph and Explore Different Solutions

distributionsmathematical-statisticsprobabilityrself-study

I am trying to solve questions in my statistics book. There is a question a want you check me and help for the part iv :

Consider a population of 100 computer, 45 of whom are broken, and the rest are nonbroken.

i) If you select 10 computer at random but with replacement, find the probability that 4 are
broken.

ii) Now assume you select ten people without replacement, find the same probability.

iii) What is the probability distribution that gives probabilities in
i) and what is it in ii)

iv) Using cumulative probability distribution(s) and graph(s) try to show that probabilities >converge between the cases with replacement and without the replacement as the population size
increases relative to size of selection, i.e. sample size.

My answers:

iv-) I cannot do this part

I stuck in part iv , i am beginner in R language so i could not write codes for part iv.Can you help me for it , i need to show it using cumulative probability distribution(s) and graph(s) in R.Moreover , are i ,ii,iii correct ? Thanks in advance

Best Answer

Graphical comment:

For whatever help it may provide, the CDFs of the binomial distribution in (i) and the hypergeometric distribution in (ii) are almost the same, because only 10 of 100 people have been sampled.

A plot of the two CDFs from R is shown below. (The vertical resolution of such a graph is about two decimal places.)

enter image description here

R code for the figure (using base R graphics).

x = 0:10
Bino.CDF = pbinom(x, 10, .45)
Hypr.CDF = phyper(x, 45,55, 10)
hdr = "Binomial (solid blue) and Hypergeometric (dotted) CDFs"
plot(x, Bino.CDF, type="s", col="blue", ylab="CDF", main=hdr)
 points(x, Bino.CDF, pch=20, col="blue")
lines(x, Hypr.CDF, type="s", lwd=3, lty="dotted", col="brown")
 points(x, Hypr.CDF, col="brown")
Related Question