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 .

Let’s demonstrate the distribution of Y through simulations.

min.uniform <- function(k, n) {
  all_rand_vars <- c()
  for (rand_x in c(1:n)) {
    rand_var <- c()
    for (rand_min in c(1:k)) {
      rand_var <- append(rand_var, sample(1:k, 1))
    }
    all_rand_vars <- append(all_rand_vars, min(rand_var))
  }
  return(all_rand_vars)
}

hist(min.uniform(10, 500), xlab="Minimum of Xi", main = "k = 10, n = 500")

hist(min.uniform(20, 1000), xlab="Minimum of Xi", main = "k = 20, n = 1000")

hist(min.uniform(30, 10000), xlab="Minimum of Xi", main = "k = 30, n = 10,000")

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

prob_fail <- 1/10

# What is the probability that the machine will fail after 8 years?
pgeom(q=8, prob_fail, lower.tail = FALSE)
## [1] 0.3874205
# Expected value
1 / prob_fail
## [1] 10
# Standard deviation
sqrt(1-prob_fail) / prob_fail
## [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.

# What is the probability that the machine will fail after 8 years?
pexp(8, rate=prob_fail, lower.tail = FALSE)
## [1] 0.449329
# Expected value
10
## [1] 10
# Standard deviation
10 # Equal to the mean
## [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)

# What is the probability that the machine will fail after 8 years?
pbinom(0, size=8, prob=(1/10)) 
## [1] 0.4304672
# Expected value
8 * prob_fail # n * P
## [1] 0.8
# Standard deviation
sqrt(prob_fail * (1-prob_fail) * 8) # sqrt(npq)
## [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.

# What is the probability that the machine will fail after 8 years?
ppois(0, lambda=(8 * prob_fail))
## [1] 0.449329
# Expected value
8 * prob_fail
## [1] 0.8
# Standard deviation
sqrt(8 * prob_fail) # Square-root of the mean
## [1] 0.8944272

References

Distribution of max, min and ranges for a sequence of uniform rv’s

Exponential Distribution

Mean and Standard Deviation of Binomial Distribution

Binomial Probability Distribution

Poisson distribution in R