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 .
Y is the minimum of the Xi’s
So, P(Y > y) = P(X1 > y and X2 > y ……..Xn > y)
Using multiplication rule we can write below for independent Xi’s
P(Y > y) = P(X1 > y) × P(X2 > y) × … × P(Xn > y)
We know that Xi’s are uniformly distributed on {1, 2, …, k} so we can write:
P(Xi > y) = (k - y) / k
Therefore, we can write:
P(Y > y) = [(k - y) / k]^n
y = 1, 2, …, k.
The probability that Y takes on the value y is then:
P(Y = y) = P(Y > y-1) - P(Y > y) = [(k - (y-1)) / k]^n - [(k - y) / k]^n
y = 1, 2, …, k.
So Y is a discrete random variable that takes on values in {1, 2, …, 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.).
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..)
Formula for geometric distribution: \[PP(X=k) = (1-p)^{k-1} \cdot p\]
where:
Expected value:
E(X) = 1/p
Var(X) = (1-p)/p^2.
The probability that the machine will fail after 8 years is equivalent to the probability of not failing during the first 8 years. So, we need to find P(X > 8).
P(X > 8) = P(X = 9) + P(X = 10)
The probability of the machine failing in the 9th year is:
P(X = 9) = (1-p)^8 * p
The probability of the machine failing in the 10th year is:
P(X = 10) = (1-p)^9 * p
Therefore,
P(X > 8) = P(X = 9) + P(X = 10) = (1-p)^8 * p + (1-p)^9 * p = (9/10)^8 * (1/10) + (9/10)^9 * (1/10) = 0.4305
So, the probability that the machine will fail after 8 years is 0.4305.
Expected Value:
E(X) = 1/p = 1/(1/10) = 10
Variance:
Var(X) = (1-p)/p^2 Standard deviation:
SD(X) = sqrt(Var(X)) = sqrt((1-p)/p^2) = 3.1623
R code:
p <- 1/10
prob_not_failing_8_years <- dgeom(8, p, log = FALSE)
prob_not_failing_8_years
## [1] 0.04304672
# Expected value
expected_value <- mean(rgeom(1000000, p))
expected_value
## [1] 9.000645
# Standard deviation
standard_deviation <- sd(rgeom(1000000, p))
standard_deviation
## [1] 9.497055
What is the probability that the machine will fail after 8 years?. Provide also the expected value and standard deviation. Model as an exponential.
cumulative distribution function of the exponential distribution:
Lamda = 1/10
P(X > 8) = 1 - F(8) = 1 - (1 - e^(-lambda * 8)) = e^(-lambda * 8) = e^(-8/10) = 0.4493
where X is the time until failure and F(x) is the cumulative distribution function (CDF) of the exponential distribution.
Expected value:
E(X) = 1 / lambda
In this case, the expected value is:
E(X) = 1 / (1/10) = 10
The standard deviation of an exponential distribution is also given by:
SD(X) = 1 / lambda
In this case, the standard deviation is:
SD(X) = 1 / (1/10) = 10
R code:
# Probability of not failing during the first 8 years
p <- 1/10
prob_not_failing_8_years <- pexp(8, rate = 1/p, lower.tail = FALSE)
prob_not_failing_8_years
## [1] 1.804851e-35
# Expected value
expected_value <- 1/p
expected_value
## [1] 10
# Standard deviation
standard_deviation <- 1/p
standard_deviation
## [1] 10
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)
Binomial formula; \[P(X = k) = \binom{n}{k} p^k (1-p)^{n-k}\]
where
\[\binom{n}{k} = \frac{n!}{k!(n-k)!}\]
\[p^k (1-p)^{n-k}\]
is the probability of having exactly k successes and (n - k) failures in n trials.
Expected value:
E(X) = n * p
Standard deviation:
SD(X) = sqrt(n * p * (1 - p))
The probability of having 0 failures in 8 years is:
P(X = 0) = (8 choose 0) * (1/10)^0 * (9/10)^8 = 1 * 1 * 0.4304672 = 0.4304672
where:
(8 choose 0) = 1 is the number of ways to choose 0 failures out of 8 years
(1/10)^0 = 1 is the probability of a failure in one year
(9/10)^8 = 0.4304672 is the probability of not having a failure in 8 years.
Expected value:
E(X) = n * p = 8 * (1/10) = 0.8
Standard deviation:
SD(X) = sqrt(n * p * (1 - p)) = sqrt(8 * (1/10) * (9/10)) = 0.7483315
Therefore, the probability that the machine will fail after 8 years is 0.4305, the expected value is 0.8 failures in 8 years, and the standard deviation is 0.7483 failures in 8 years.
R code:
p <- 1/10
prob_not_failing_8_years <- dbinom(0, size = 8, prob = p)
prob_not_failing_8_years
## [1] 0.4304672
expected_value <- 8 * p
expected_value
## [1] 0.8
standard_deviation <- sqrt(8 * p * (1 - p))
standard_deviation
## [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.
The formula for the Poisson distribution:
\[P(x) = \frac{e^{-\lambda}\lambda^x}{x!}\]
Where:
R code:
lamda<-0.8
e<-2.71828
prob_fail_8years <- dpois(1, lambda = 0.8)
prob_fail_8years
## [1] 0.3594632
# Expected value of the number of failures in 8 years
expected_fail_8years <- 0.8
expected_fail_8years
## [1] 0.8
sd_fail_8years <- sqrt(0.8)
sd_fail_8years
## [1] 0.8944272