Let \(X_1, X_2, . . . , 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 \(X_i\)’s. Find the distribution of Y.
Each variable \(X_i\) in a (discrete) uniform distribution will have the same probability \(P(x) = \frac{1}{k}\) for \(x = (1,2, ..., k)\)
We want to construct a formula to obtain the cumulative probabilities for all \(X_y\) through \(X_k\) where \(1 \le y \le k\):
\[ P(Y=y) = \frac{k-y+1}{k} \]
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.).
2a. 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..)
Setting up the Geometric probability mass function (PMF),
\[(1-p)^{n-1}p\]
geom_fn <- function(n,p){
return((1-p)^(n-1) * p)
}
If we consider each year a trial and expect a “success” (in this case, equipment failure) every 10 years, then our \(p = 0.1\) or 10%.
To find the probability of equipment failure in Year 8 and beyond, we take the complement of the cumulative probabilities for Years 1-7.
cp=0
for(i in seq(1,7)){
cp = cp + geom_fn(i,.1)
}
The cumulative probability of equipment failure in Years 1-7 is approx 52.17%, and our answer is the complement, approx 47.83%.
The Expected Value is \(\mu = \frac{1}{p} = \frac{1}{.1} = 10\) (interpreted as, ten years until the first equipment failure,) and the Standard Deviation is \[\sigma = \sqrt{\frac{1-p}{p^2}} = \sqrt{\frac{.9}{.1^2}} \approx 9.49\]
2b. What is the probability that the machine will fail after 8 years?. Provide also the expected value and standard deviation. Model as an exponential.
Setting up the Exponential probability density function (PDF),
\[\lambda e^{-\lambda x} \text{ for } x \ge 0\]
exp_fn <- function(x,l){
return(l * (exp(1) ^ (-l * x)))
}
If we consider each year an interval and expect an equipment failure every 10 years, then our rate lambda \(\lambda = 0.1\) or 10%.
To find the probability of equipment failure in Year 8 and beyond, we take the complement of the cumulative probabilities for Years 1-7.
cp=0
for(i in seq(1,7)){
cp = cp + exp_fn(i,.1)
}
The cumulative probability of equipment failure in Years 1-7 is approx 47.87%, and our answer is the complement, approx 52.13%.
The Expected Value is \(\mu = \frac{1}{\lambda} = \frac{1}{.1} = 10\) (interpreted as, ten years until the first equipment failure,) and the Standard Deviation is \[\sigma = \sqrt{\frac{1}{\lambda^2}} = \sqrt{\frac{1}{.01}} = 10\]
2c. 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)
Setting up our Binomial PMF:
\[(^n_k)p^k(1-p)^{n-k}\]
binomial_fn <- function(p,n,k){
return((factorial(n) / (factorial(k) * factorial(n-k))) * (p^k) * ((1-p) ^ (n-k)))
}
If we consider each year an trial and expect an equipment failure every 10 years, then our probability of success on a single trial \(p = 0.1\) or 10%.
To find the probability of equipment failure beyond year 8, we take the complement of no successes \((k=0)\) in eight trials \((n=8)\).
r = binomial_fn(.1,8,0)
The probability of no failures in Years 1-8 is approx 43.05%, and our answer is the complement, approx 56.95%.
The Expected Value for 8 years is \(\mu = np = 8 \times .1 = 0.8\) and the Standard Deviation is: \[\sigma = \sqrt{np(1-p)} = \sqrt{.72} \approx .85\]
2d. What is the probability that the machine will fail after 8 years?. Provide also the expected value and standard deviation. Model as a Poisson.
Setting up our Poisson PMF:
\[\frac{\lambda^k e^{-\lambda}}{k!}\]
poisson_fn <- function(l,k){
return(((l ^ k) * (exp(1) ^ -l)) / factorial(k))
}
If we consider each year an interval and expect an equipment failure every 10 years, then our rate lambda \(\lambda = 0.1\) or 10%.
To find the probability of equipment failure beyond year 8, we take the complement of the product of no successes \((k=0)\) over 8 years:
cp = (poisson_fn(.1,0)) ^ 8
The probability of no failures in Years 1-8 is approx 44.93%, and our answer is the complement, approx 55.07%.
The Expected Value for 8 years is \(\lambda = 0.1\) and the Standard Deviation is: \[\sqrt{\lambda} \approx 0.316\]