which is uniformly distributed on the integers from 1 to k. Let Y denote the minimum of the Xi’s. Find the distribution of Y .
## If K^n is the sum of variables then (k−1)^n would represent varaibles where Xi does not contain 1
##P(X=1)=\frac { { k }^{ n }-{ (k-1) }^{ n } }{ { k }^{ n } }
##P(X=2)=\frac { { (k-2+1) }^{ n }-{ (k-2) }^{ n } }{ { k }^{ n } }
##P(X=y)=\frac { { (k-y+1) }^{ n }-{ (k-y) }^{ n } }{ { k }^{ n } }
This machine has a manufacturer’s expected lifetime of 10 years. This means that we expect one failure every ten years. (Include the probability statements and R Code for each part.).
prob_fail <- 1/10
prob_fail
## [1] 0.1
## probability that the machine will fail after 8 years
prob <- ((1 - prob_fail)^ (8 - 1) * prob_fail)
prob
## [1] 0.04782969
expected_value <- 1/prob_fail
expected_value
## [1] 10
## standard deviation
sd <- sqrt((1-prob_fail)/(prob_fail^2))
sd
## [1] 9.486833
pr <- (1 / 10)
## probability that the machine will fail after 8 years
eprob <- exp(1) ^ (- pr * 8)
eprob
## [1] 0.449329
## expected value
eval <- 1 / pr
eval
## [1] 10
## standard deviation
sd <- 1 / (pr ^ 2)
sd
## [1] 100
expected value and standard deviation. Model as a binomial. (Hint: 0 success in 8 years)
p <- 1 / 10
yrs <- 8
suc <- 0
# Probability of failure
prob_fail <- choose(yrs, suc)*((p)^(suc))*(1-p)^yrs
prob_fail
## [1] 0.4304672
# Probability of non failure
prob_not_fail <- 1 - prob_fail
prob_not_fail
## [1] 0.5695328
# Expected Value
exp_val <- yrs *p
exp_val
## [1] 0.8
# Standard Deviation
sd <- sqrt(yrs*p*(1 - p))
sd
## [1] 0.8485281
##What is the probability that the machine will fail after 8 years?. Provide also the expected value and standard deviation. Model as a Poisson.
## \frac { { e }^{ -\lambda }{ \lambda }^{ n } }{ n! }
yrs <- 8
pl = yrs * (1 / 10)
e <- exp(1)
prob_poi <-(e ^ (- pl) * pl ^ 0) / factorial(0)
prob_poi
## [1] 0.449329
# Expected Value
pv_exp <- pl
pv_exp
## [1] 0.8
# Standard Deviation
sd <- sqrt(pl)
sd
## [1] 0.8944272