2) Your organization owns a copier (future lawyers, etc.) or MRI (future doctors). This machine has a manufacturer’s expected lifetime of 10 years. This means that we expect one failure every ten years. (Include the v probability statements and R Code for each part).
a. What is the probability that the machine will fail after 8 years?. Provide also the expected value and standard deviation. Model as a geometric. (Hint: the probability is equivalent to not failing during the first 8 years..)
Ans) P(X=k)=(1−p)^k−1.p
E[X]=1/p
Var[X]=1−p/p2
# Probability of machine failure each year
(P_fail=1/10)
## [1] 0.1
# Probability of machine not failing every year
(P_not_fail<-1-P_fail)
## [1] 0.9
# Expected value
(GEO_E<-1/P_fail)
## [1] 10
# Standard Deviation
(GEO_STD <- sqrt(P_not_fail/(P_fail^2)))
## [1] 9.486833
# The probability the machine will fail after 8 years
(P<- ((1-P_fail)^(8-1))*P_fail)
## [1] 0.04782969
b. What is the probability that the machine will fail after 8 years?. Provide also the expected value and standard deviation. Model as an exponential.
Ans) X≤k:P(X≤k)=e^−λx
E[X]=1/λ
Var[x]=sqrt(1/λ2)
# probability that the machine will fail after 8 years
lambda <- 1/10
k = 8
(P <- exp(-lambda*k))
## [1] 0.449329
# Expected value
(EXP_E<- 1/lambda)
## [1] 10
# Standard Deviation
(EXP_STD <-sqrt(1/lambda^2))
## [1] 10
c. What is the probability that the machine will fail after 8 years?. Provide also the expected value and standard deviation. Model as a binomial. (Hint: 0 success in 8 years)
Ans) P(success)=(nCk).Pn.qn−k
E[X]=np
Var[X]= sqrt(npq)
n <- 8
p <- 1/10
q <- 1-p
k <- 0
# Probability of machine failure
(P <- dbinom(k, n, p))
## [1] 0.4304672
# Expected value
(BIO_E <- n*p)
## [1] 0.8
# Standard Deviation
(BIO_STD <- sqrt(n*p*q))
## [1] 0.8485281
d. What is the probability that the machine will fail after 8 years?. Provide also the expected value and standard deviation. Model as a Poisson.
Ans) P(X=x)=λxe−λx!
E[X]=λ
Var[X]= sqrt(λ)
# probability that the machine will fail after 8 years
lambda <- 8/10
ppois(0, lambda = 0.8)
## [1] 0.449329
# Expected value
(POI_E <- lambda)
## [1] 0.8
# Standard Deviation
(POI_STD <- sqrt(lambda))
## [1] 0.8944272