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 .

The probability that \(Y\) takes on any specific value \(y\) (where \(1 \leq y \leq k\)) can be found by considering the complement, that is, the probability that all \(X_i\)’s are greater than \(y\), and then subtracting this value from 1.

The probability that a single \(X_i\) is greater than \(y\) is \(\frac{k-y}{k}\), given that \(X_i\) is uniformly distributed from 1 to \(k\).

So the probability that all \(X_i\)’s are greater than \(y\) (since they are independent) is \(\left(\frac{k-y}{k}\right)^n\). Then we can say that the probability that the minimum \(Y \geq y\) is \(1 - \left(\frac{k-y}{k}\right)^n\).

The probability mass function (PMF) for \(Y = y\) is the difference in probabilities \(P(Y \geq y) - P(Y \geq y + 1)\), which simplifies to:

\[P(Y = y) = \left(\frac{k-y}{k}\right)^n - \left(\frac{k-y-1}{k}\right)^n\]

calculate_pmf_Y <- function(k, n, y) {
  p_y = (k-y)^n/k^n - (k-y-1)^n/k^n
  return(p_y)
}
# example
k <- 6 
n <- 3 
y <- 1 
pmf_Y <- calculate_pmf_Y(k, n, y)
pmf_Y
## [1] 0.2824074

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.).

The geometric distribution models the number of trials until the first success. In this context, “success” is the failure of the machine, and the probability of success in any given year is \(p = \frac{1}{10}\).

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..)

  • Probability after 8 years: The probability that the first failure happens after 8 years is the same as the probability of 8 failures (no success in the first 8 years), so we use the probability mass function (PMF) of the geometric distribution.
p <- 1/10

prob_after_8 <- (1 - p)^8

expected_value_geom <- 1 / p
std_dev_geom <- sqrt((1 - p) / p^2)

prob_after_8
## [1] 0.4304672
expected_value_geom
## [1] 10
std_dev_geom
## [1] 9.486833

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.

The exponential distribution models the time until an event occurs and is a continuous distribution. The rate \(\lambda\) is the inverse of the expected lifetime, \(\lambda = \frac{1}{10}\).

  • Probability after 8 years: The probability of failure after 8 years can be found using the survival function, which is \(1 - F(x)\), where \(F(x)\) is the cumulative distribution function (CDF).
lambda <- 1/10

prob_after_8_exp <- exp(-lambda * 8)

expected_value_exp <- 1 / lambda
std_dev_exp <- 1 / lambda

prob_after_8_exp
## [1] 0.449329
expected_value_exp
## [1] 10
std_dev_exp
## [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)

Modeling as a binomial distribution involves discrete trials with a success/failure outcome in each trial. If we consider a “trial” to be a year and “success” to be the failure of the machine, we’re essentially looking for the probability of 0 successes in 8 trials, with each trial having a success probability of \(p = \frac{1}{10}\).

  • Probability after 8 years: This is the probability of 0 successes in 8 years.
size <- 8 # years
p <- 1/10 # p failure/year

# P of no failure
prob_no_failure_8_years <- dbinom(0, size, p)

expected_value_bin <- size * p
std_dev_bin <- sqrt(size * p * (1 - p))

prob_no_failure_8_years
## [1] 0.4304672
expected_value_bin
## [1] 0.8
std_dev_bin
## [1] 0.8485281

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.

The Poisson distribution can model the number of events in a fixed interval of time, given a constant rate of occurrence. With an expected lifetime of 10 years, the rate \(\lambda\) for 8 years is \(0.8\), assuming a linear scale.

  • Probability after 8 years: This would involve calculating the probability of 0 events in 8 years.
lambda <- 0.8 # expected failures in 8 years

# P of no failure
prob_no_failure_8_poisson <- dpois(0, lambda)

expected_value_pois <- lambda
std_dev_pois <- sqrt(lambda)

prob_no_failure_8_poisson
## [1] 0.449329
expected_value_pois
## [1] 0.8
std_dev_pois
## [1] 0.8944272

It does indeed seem that the results across the different approaches are approximate to each other.