In: Statistics and Probability
With R coding Obs: it supposed to use probability density function like X ~ Binomial( n ,p ) dbinom(X=?, n, prob) pbinom(X=?, n, prob) rbinmo(幾個符合二項分配的X, n, prob) X~Poisson (lamda) dpois(X=?, lamda) ppois (X=?, lamda) rpois (X, lamda)
Exercises 1) A food company produces canned food, and the weight of each can on the production line is in accordance with normal distribution. N (175, 102) (Unit: gram) (a) Specifications indicate that each can weight lless than 155, what is the possibility of randomly choosing a can and it being returned? (b) b) randomly pick a can, What is the probability of qualified? (c) If the company wants the possibility of the product being returned to be <2%, they should set the return policy to allow returns when the van weighs less than how much? (d) (Randomly pick a can, What is the probability of picking a can with a weight between 160 and 190?
2. X~B(n=100,p=0.1) (a) P(125 and n(1-p)>5, X will be approximated by a normal distribution, E(X)=np、Var(X)=np(1-p) calculate P(12100 and np<5, X will be approximated by a poisson distribution, E(X)=np calculate P(12
#1)
Let x be the weight of can, x follows normal distribution with mean µ = 175 and standard deviation σ = 10
Specifications : Weigh of can is must be greater than 155 , otherwise it would be returned.
To find area less than x we use the following function in R:
pnorm(x, mean , sd , lower.tail = TRUE)
To find area greater than x we use the following function in R:
pnorm(x, mean , sd , lower.tail = FALSE)
a) P( can being returned ) = P( x < 155 )
So we use function: pnorm(155, 175 , 10, lower.tail = TRUE)
Answer : 0.0228
b) P( Can being qualified ) = P ( x > 155 )
pnorm(155, 175, 10 , lower.tail = FALSE )
Answer : 0.9772
c) We are asked to find x such that P( X < x ) =0.02
So we can use the function : qnorm(0.02, 175, 10 ,lower.tail = TRUE)
Answer : 154.4625
d) P( 160 < x < 190 ) = P( x < 190 ) - P( x < 160 )
pnorm(190,175,10,lower.tail = TRUE) - pnorm(160,175,10,lower.tail = TRUE)
Answer : 0.8664