In: Statistics and Probability
25) a) In 10 samples drawn from a main mass, on average of which 8% of the substances produced are not known to comply with the standards; calculate the probability of finding no defective products, at least one defective product. Calculate the mean and standard deviation of this distribution according to the Binomial distribution. b) On average, 2 people migrate abroad every 50,000 people every year. In a particular year in a city of 100,000 people; Calculate the probability according to the Poisson distribution, if no one is migrating, 1 person is migrating, 2 or more people are migrating
R-commands and outputs:
a)
# X ~ Binomial (n=10, p=8%=0.08)
n=10
p=8/100
q=1-p
q
[1] 0.92
The probability at any point 'x' in Binomial distribution is
obtained by following PMF:
# Finding no defective products
# P(X=0)
dbinom(0,n,p)
[1] 0.4343885
# Finding atleast one defective product
# P(X>=1)=1-P(X<1)=1-P(X=0)
1-dbinom(0,n,p)
[1] 0.5656115
# mean=n*p
n*p
[1] 0.8
# variance=n*p*q
# standard deviation=stdev=sqrt(n*p*q)
sqrt(n*p*q)
[1] 0.8579044
b)
# average=2 people every 50000 people
# Thus, rate=4 people every 100000 people
# Y ~ Poisson(lambda=4)
lambda=4
The probability at any point 'y' in Poisson distribution is
obtained by following PMF:
# No one is migrating
# P(Y=0)
exp(-lambda)
[1] 0.01831564
dpois(0,lambda)
[1] 0.01831564
# one person is migrating
# P(Y=1)
exp(-lambda)*lambda^(1)/factorial(1)
[1] 0.07326256
dpois(1,lambda)
[1] 0.07326256
# Two or more people are migrating
# P(Y>=2)=1-P(Y<2)=1-[P(Y=0)+P(Y=1)]
1-ppois(1,lambda)
[1] 0.9084218
1-(dpois(0,lambda)+dpois(1,lambda))
[1] 0.9084218
1-(0.01831564+0.07326256)
[1] 0.9084218