### Elina Azrilyan

October 7th, 2019

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 define Success as getting a minimum of Xi’s and failure as getting something other than a minimum.

The p of getting a mimimum is 1/k.

This is a geometric distribution: P(T = n) = q^(n−1)*p

Y = (1-1/k)^(n-1) * (1/k)

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(T = n) = q^(n−1)*p

#Let's calculate the probability of failing in the 1st 8 years
n <- 9
p <- 1/10
q <- 1-p

Pfail <- 1 - (1-p)^n
P <- 1 - Pfail
P
## [1] 0.3874205
# Method 2: Using pgeom
P <- pgeom(8, p, lower.tail = F)
P
## [1] 0.3874205
#Calculating Expected Value
EV <- 1/p
EV
## [1] 10
#Calculating standard deviation
Var <- (1-p)/(p^2)
sqrt(Var)
## [1] 9.486833
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.

P(T<=x) = 1−e−λx.

p <- 1/10
P<-pexp(8, rate = p, lower.tail = FALSE)
P
## [1] 0.449329

EX=1/λ

EV<-1/p
EV
## [1] 10

Var(X)=1/(λ^2)

#standard deviation
Var <- 1/(p^2)
sqrt(Var)
## [1] 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
P<-pbinom(0, n, p)
P
## [1] 0.4304672
#Expected value
EV<-n*p
EV
## [1] 0.8
#standard deviation
Var <- n * p * ( 1 - p )
sqrt(Var)
## [1] 0.8485281
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.

λ = n*p/t

lam<-10

P<- ppois(8, 10)

P
## [1] 0.3328197

Expected value

#expected value of a Poisson distribution with parameter λ also has expectation equal to λ
EV<-lam
EV
## [1] 10

Variance

#standard deviation
#Given a Poisson distribution with parameter λ, we should guess that its variance is λ.
Var <- lam
sqrt(Var)
## [1] 3.162278