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

To begin, let’s assume n=100, so X1, X2,…X100.

Second, let,s assume uniform distribution is 1 to k where k = 5.

Let’s simulate 10000 times and display the distribution of rv Y=min(X1, X2,….,X100)

library(ggplot2)
# Suppose n =100 Xn
# Suppose k = 5 so unif 1<x<5
#Generate Xn
xr<-runif(100,1,5)
hist(runif(100,1,5))

hist(xr)

class(xr)
## [1] "numeric"
xdf<-as.data.frame(xr)
class(xdf)
## [1] "data.frame"
head(xdf)
##         xr
## 1 3.768435
## 2 1.578844
## 3 1.736286
## 4 1.551793
## 5 4.768493
## 6 4.421947
Y1<-vector()

for (i in 1:10000)
     {xr<-runif(100,1,5)
        Y=min(xr)
        Y1=rbind(Y1,Y)}
hist(Y1)

Here, you can see the minimum approaches 1.


  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..)
#Geometric distribution model
#p=.1
p=.1
#prob(X>8)

1-pgeom(8,.1)
## [1] 0.3874205
#E(X)

1/p
## [1] 10
#Var(x)
(1-p)/(p^2)
## [1] 90
  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.
B<-10

1-pexp(.1,10)
## [1] 0.3678794
#E(X)
B
## [1] 10
#Var(x)
B^2
## [1] 100
  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)
dbinom(0,8,.1)
## [1] 0.4304672
n<-10
p<-.1
#E(X)
n*p
## [1] 1
#Var(X)
n*p*(1-p)
## [1] 0.9
  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.
lambda<-10*.1

ppois(.8,1)
## [1] 0.3678794
#E(x)
lambda
## [1] 1
#Var(x)
lambda
## [1] 1