Probability

\(~\)

1. Let X1, X2, . . . , Xn be n mutually independent random variables, each of 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.

\(~\)

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}\)

\(~\)

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 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)
# Fail each year
P_Fail <- 1 / 10

# Not Fail each year
P_NFail <- 1 - P_Fail

# Expected Value
ev <- 1 / P_Fail
ev
## [1] 10
# Standard Deviation
sd <- sqrt(P_NFail / (P_Fail ^ 2))
round(sd, 2)
## [1] 9.49
# Modeling as geometric
P <- 1 - pgeom(8 - 1, P_Fail) 
round(P, 2)
## [1] 0.43
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.
# Probability of Failing
P_eFailing <- exp(-1 * (8/10))
round(P_eFailing, 2)
## [1] 0.45
# Expected Value using lambda
ev <-  10
ev
## [1] 10
# Standard Deviation
sd_expected <- sqrt(1 / (.10 ^ 2))
sd_expected
## [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)
n <- 8
p <- 1 /10
q <- 1 - p
k <- 0

# Probability of Machine Failing
p_Bin <- dbinom(k, n, p)
round(p_Bin, 2)
## [1] 0.43
# Expected Value
ev <- n * p
ev
## [1] 0.8
# Standard Deviation
sd <- sqrt(n * p * q)
round(sd, 2)
## [1] 0.85
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.
lambda <- 8 / 10

# Probability of machine Failing
p_Poisson <- ppois(0, lambda = 0.8)
p_Poisson
## [1] 0.449329
# Expected Value
ev_Poisson <- lambda
ev_Poisson
## [1] 0.8
# Standard Deviation
sd_Poisson <- sqrt(lambda)
round(sd_Poisson, 2)
## [1] 0.89

References:

https://www.geeksforgeeks.org/poisson-functions-in-r-programming/#:~:text=ppois(),or%20less%20than%20a%20number.