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 solution should be: For

\[ 1 ≤ j ≤ k, m(j) = {{(k-j+1)^{n} - (k-j)^{n}} \over k^{n}} \] Since Y is the minimum value of Xi over all of the Xi’s, then in order to find the distribution function m(j) = P(Y = j), we will need to count the number of ways that we can assign X1, X2, …, Xn to values between j and k with at least one Xi being assigned to j and divide by the total number of possible ways to assign X1, X2, …, Xn to values between 1 and k.

Suppose that each Xi has k possibilities: 1, 2, …, k. Then, the total possible number of assignments for the entire collection of random variables X1, X2, …, Xn is kn. This will form the denominator for our probability distribution function.

The number of ways of getting Y = 1 is kn − (k − 1)n, since kn represents the total number of options and (k −1)n represents all of the options where none of the Xi’s are equal to 1.

If Y = 2, then there are kn − (k − 2)n − [kn − (k − 1)n] different options for the collectionof Xi’s, where the kn represents the total number of options (with no restrictions), (k − 2)n represents the number of ways that we could assign X1, …, Xn with all of their values being greater than 2, and, as we showed above, [kn − (k − 1)n] represents the number of ways that we could assign X1, …, Xn and have at least one of them equal 1 (i.e. Y = 1). We can simplify kn − (k − 2)n − [kn − (k − 1)n] to get (k − 1)n − (k − 2)n.

We see that, in general, if Y = j then there are (k −j + 1)n − (k − j)n ways to assign X1, …, Xn so that the minimum value is j. Therefore, we should define m(j) to be

\[ {{(k-j+1)^{n} - (k-j)^{n}} \over k^{n}} \] Ref: https://math.dartmouth.edu/archive/m20f10/public_html/HW5Solutions.pdf

  1. 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.)
  1. 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.)
p_fail <- 1/10 
n= 8
p_notfail <- 1-p_fail

prob_geom  <- 1-pgeom(n-1, p_fail) 
paste("Probability that the machine will fail after 8 years using geometric model: ",prob_geom)
## [1] "Probability that the machine will fail after 8 years using geometric model:  0.43046721"
expec_val <- 1/p_fail
paste("The expected value using geometric model: ",expec_val)
## [1] "The expected value using geometric model:  10"
sd = sqrt((.9)/(.1^2))
paste("The standard deviation using geometric model: ", sd)
## [1] "The standard deviation using geometric model:  9.48683298050514"
  1. What is the probability that the machine will fail after 8 years?. Provide also the expected value and standard deviation. Model as an exponential.
n <- 8 
lambda <- 1/10

p_expo <- pexp(n, lambda, lower.tail=FALSE)
paste("Probability that the machine will fail after 8 years using exponential model: ",round(p_expo,2))
## [1] "Probability that the machine will fail after 8 years using exponential model:  0.45"
expec_val <- 1/lambda
paste("The expected value using exponential model: ",expec_val)
## [1] "The expected value using exponential model:  10"
SD <- sqrt(1/lambda^2)
paste("The standard deviation using exponential model: ",SD)
## [1] "The standard deviation using exponential model:  10"
  1. 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)
n <- 8
p <- 1/10
q <- (1-p)
k <- 0


p_binomial <- dbinom(k, n, p)
paste("Probability that the machine will fail after 8 years using binomial model: ",p_binomial)
## [1] "Probability that the machine will fail after 8 years using binomial model:  0.43046721"
exp_val <- n * p
paste("The expected value using binomial model: ",exp_val)
## [1] "The expected value using binomial model:  0.8"
sd_bino <- sqrt(n*p*q) 
paste("The standard deviation using binomial model: ",sd_bino)
## [1] "The standard deviation using binomial model:  0.848528137423857"
  1. What is the probability that the machine will fail after 8 years?. Provide also the expected value and standard deviation. Model as a Poisson.
#Since average number of failures in every 10 years is 1 so average number of failures in 8 years will be:

lambda <- 8/10
k <- 0

paste("Probability that the machine will fail after 8 years using poison model: ",ppois(0,lambda = .8 ))
## [1] "Probability that the machine will fail after 8 years using poison model:  0.449328964117222"
exp_val <- 8/10
paste("The expected value using poison model: ",exp_val)
## [1] "The expected value using poison model:  0.8"
SD <- sqrt(8/10)
paste("The standard deviation using poison model: ",SD)
## [1] "The standard deviation using poison model:  0.894427190999916"