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

As the vale is uniformly distributed between 1 and K. Probability of that min value is 1 is P(Y=1) = 1 - P(Y>1) = 1 - ((k-1)/k)^n where n is list of mutually independent variables

P(Y=2) = 1 - P(Y>2) - P(Y=1) = 1 - ((k-2)/k)^n) - (1 - ((k-1)/k)^n) = ((k-1)/k)^n - ((k-2)/k)^n

P(Y=3) = 1 - P(Y>3) - P(Y=2) - P(Y=1) = 1 - ((k-3)/k)^n - (((k-1)/k)^n - ((k-2)/k)^n) - (1 - ((k-1)/k)^n)) = ((k-2)/k)^n) - ((k-3)/k)^n

Going by the pattern or trend, we can observe the below

P(Y=y) = ((k-(y-1))/k)^n) - ((k-y)/k)^n

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

n <- 10
x <- 8
success_prob <- 1/n
fail_prob <- 1 - success_prob

p <- pgeom(8, success_prob)
paste('Probability of machine failing after 8 years = ' , p)
## [1] "Probability of machine failing after 8 years =  0.612579511"
exp_value <- 1/success_prob

paste('Expected value = ', exp_value)
## [1] "Expected value =  10"
sd <- sqrt((1-success_prob)/success_prob^2)

paste('Standard deviation = ', sd)
## [1] "Standard deviation =  9.48683298050514"

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.

lambda <- 1/10
prob <- pexp(8, lambda, lower.tail = F)

paste('Probability to fail after 8 years using exponential model is ', prob)
## [1] "Probability to fail after 8 years using exponential model is  0.449328964117222"
expVal <- 1/lambda

paste('Expected value = ', expVal)
## [1] "Expected value =  10"
variance <- 1/lambda^2

sd <- sqrt(variance)

paste('SD = ', sd)
## [1] "SD =  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)

Expected value E[X] = np Variance = np(1-p)

p <- 1/10
n <- 8

prob <- dbinom(0, n, p)
paste('Probability of machine failing after 8 years using binomial model = ', prob)
## [1] "Probability of machine failing after 8 years using binomial model =  0.43046721"
exp_value <- n * p
paste('Expected value for fail in 8 years using binomial model = ', exp_value)
## [1] "Expected value for fail in 8 years using binomial model =  0.8"
variance <- n * p * (1-p)
sd <- sqrt(variance)

paste('Standard deviation value for fail in 8 years using binomial model = ', sd)
## [1] "Standard deviation value for fail in 8 years using binomial model =  0.848528137423857"

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.

p <- 1/10
n <- 8

lambda <- n*p
rpob <- ppois(0, lambda)
paste('Probability of machine failing after 8 years using Poisson model = ', prob)
## [1] "Probability of machine failing after 8 years using Poisson model =  0.43046721"
exp_value <- lambda
paste('Expected value for fail in 8 years using Poisson model = ', exp_value)
## [1] "Expected value for fail in 8 years using Poisson model =  0.8"
variance <- lambda
sd <- sqrt(variance)

paste('Standard deviation value for fail in 8 years using Poisson model = ', sd)
## [1] "Standard deviation value for fail in 8 years using Poisson model =  0.894427190999916"