Let \(X_1, X_2, . . . , X_n\) 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\).
We first consider how many ways we can assign \(Y\) to one of the \(x_i\) variables.
Since there are \(n\) variables, with \(k\) values, there are \(k^n\) total possibilities.
The number of ways we can get \(Y = 1\) is the total number of possibilities less the number of possibilities that \(Y\) is \(1\). So, this can be done in \(k^{n} - (k-1)^n\) ways.
Similarly, the number of ways to get \(Y = 2\) would be \(k^{n} - (k-2)^{n} - [k^{n} - (k-1)^{n}] = (k-1)^{n} - (k-2)^{n}\).
The pattern we get is the recurrence relation \(P(Y = m) = \frac{(k-m+1)^{n} - (k-m)^{n}}{k^{n}}\).
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.)
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.)
Let \(p\) be the probability that the machine fails, and \(q = 1 - p\) the probability that it doesn’t.
We’re looking for the first failure (success) after 8 years, so this is a geometric distribution. Since we’re only expecting one failure in 10 years, \(p = 0.1, \ q = 0.9\).
\(P(X > 8) = 1 - P(X \leq 8)\)
\(1 - (1 - q^{i+1}) = q^{i+1} = 0.9^{9} =\) 0.3874.
\(E[X] = \frac{1}{p} = \frac{1}{0.1} =\) 10.
\(Var(X) = \frac{1-p}{p^2} = \frac{0.9}{(0.1)^2} =\) 90.
Standard deviation = \(\sqrt{Var(X)} = \sqrt{90} \approx\) 9.486833.
pdf <- pgeom(8, 0.1, lower.tail = F)
p <- 0.1
q <- 1 - p
ex <- p^-1
var <- q/p^2
sd <- sqrt(var)
cat(sprintf("\n %s = %f \n",
c("Probability", "Expected Value", "Variance", "Standard Deviation"),
c(pdf, ex, var, sd))
)
##
## Probability = 0.387420
##
## Expected Value = 10.000000
##
## Variance = 90.000000
##
## Standard Deviation = 9.486833What is the probability that the machine will fail after 8 years?. Provide also the expected value and standard deviation. Model as an exponential.
\(P(X > 8) = e^{-\lambda i}\), with \(\lambda = 0.1\).
\(P(X > 8) = e^{-0.8} =\) 0.449329.
\(E[X] = \frac{1}{\lambda} =\) 10.
\(Var(X) = \frac{1}{\lambda^2} = \frac{1}{0.1^2} =\) 100.
Standard Deviation \(= \sqrt{Var(X)} = \sqrt{100} = 10\).
pdf <- pexp(8, 0.1, lower.tail = F)
l <- 0.1
ex <- 1/l
var <- 1/l^2
sd <- sqrt(var)
cat(sprintf("\n %s = %f \n",
c("Probability", "Expected Value", "Variance", "Standard Deviation"),
c(pdf, ex, var, sd))
)
##
## Probability = 0.449329
##
## Expected Value = 10.000000
##
## Variance = 100.000000
##
## Standard Deviation = 10.000000What 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)
We’re looking for 0 successes in 8 years. So, \(P(0)\) with \(n = 8\).
\(P(0) = \binom{8}{0}(0.1)^0 \times 0.9{8-0} = (0.9)^8 =\) 0.4304672.
\(E[X] = np = 8\cdot 0.1 = 0.8\).
\(Var(X) = npq = 0.8\cdot 0.9 =\) 0.72.
Standard Deviation \(= \sqrt{Var(X)} = \sqrt{0.72} =\) 0.8485281.
pdf <- pbinom(0, 8, 0.1)
n <- 8
i <- 0
p <- 0.1
q <- 0.9
ex <- n*p
var <- n*p*q
sd <- sqrt(var)
cat(sprintf("\n %s = %f \n",
c("Probability", "Expected Value", "Variance", "Standard Deviation"),
c(pdf, ex, var, sd))
)
##
## Probability = 0.430467
##
## Expected Value = 0.800000
##
## Variance = 0.720000
##
## Standard Deviation = 0.848528What is the probability that the machine will fail after 8 years?. Provide also the expected value and standard deviation. Model as a Poisson.
Since Poisson uses averages, and we expect one failure every 10 years, we can say the average yearly failure rate is 0.1. We’re looking for 0 failures in the first 8 years.
\(P_{i}(t) = \frac{(\lambda t)^{i}e^{-\lambda t}}{i!}\)
\(P_{0}(8) = \frac{(0.1\cdot 8)^{0}e^{-0.1\cdot 8}}{0!} = e^{-0.8} =\) 0.449329.
\(E[X] = Var(X) = \lambda\cdot t = 0.1 \cdot 8 = 0.8\).
Standard Deviation \(= \sqrt{Var(X)} = \sqrt{0.8} =\) 0.8944272.
lambda <- 0.1
t <- 8
i <- 0
ex <- lambda*t
var <- lambda*t
sd <- sqrt(var)
pdf <- ppois(i, t*lambda)
cat(sprintf("\n %s = %f \n",
c("Probability", "Expected Value", "Variance", "Standard Deviation"),
c(pdf, ex, var, sd))
)
##
## Probability = 0.449329
##
## Expected Value = 0.800000
##
## Variance = 0.800000
##
## Standard Deviation = 0.894427