In: Statistics and Probability
In a certain country, 15% of the female adult population smoke regularly. In a random sample of 1,000 adults, what is the probability that:
a) Less than 125 are smokers? Use the normal approximation to the binomial.
b) 150 or more are smokers? Use the normal approximation to the binomial.
c) Find answers to (a) and (b) using the binomial distribution and R. Copy and paste the code and the answer into your document.
Mean number of smokers among slected females=0.15*1000=150, which is also the mean of approximate normal distribution.
Variance=1000*0.15*0.85=127.5
now number of smokers approximatey follows normal distrinution with mean =150, variance =127.5
R code For calculating part (a) and (b):::
#for part (a)
p1=pnorm(125,150,sqrt(127.5))
p1
#for part (b)
print("above is answer for part (a)")
p2=1-pnorm(150,150,sqrt(127.5))
p2
print("above is answer for part (b)")
#for part (c)
#now for the binomial model:::::::::
#for part (a)
P1=pbinom(125,1000,0.15)
P1
#for part (b)
print("above is answer for part (a)")
P2=1-pbinom(149,1000,0.15)
P2
print("above is answer for part (b)")
OUTPUT:::::::::
#for part (a)
> p1=pnorm(125,150,sqrt(127.5))
> p1
[1] 0.01341311
> #for part (b)
> print("above is answer for part (a)")
[1] "above is answer for part (a)"
> p2=1-pnorm(150,150,sqrt(127.5))
> p2
[1] 0.5
> print("above is answer for part (b)")
[1] "above is answer for part (b)"
> #for part (c)
> #now for the binomial model:::::::::
> #for part (a)
> P1=pbinom(125,1000,0.15)
> P1
[1] 0.01349891
> #for part (b)
> print("above is answer for part (a)")
[1] "above is answer for part (a)"
> P2=1-pbinom(149,1000,0.15)
> P2
[1] 0.5135419
> print("above is answer for part (b)")
[1] "above is answer for part (b)"