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.

Solution:

X could be from 1 to k. k is the least likely: \(Pr(k)=(1/k)^n\).

For 1, we have:

\(Pr(1)=1-((k-1)/k)^n\)

For 2, we have:

\(Pr(2)=1-Pr(1)-((k-2)/k)^n\)

For x not equal to 1 and k, we have:

\(Pr(x)=1-Pr(1)...-Pr(x-1)-((k-x)/k)^n\)

Let’s test our solution:

k<-10

n<-10

mydist<-data.frame(myval<-1,
                 myfreq<-1-((k-1)/k)^n)

temp<-1-((k-1)/k)^n

for (i in (2:k)){
  pr<-1-temp-((k-i)/k)^n
  x<-c(i,pr)
  mydist<-rbind(mydist,x)
  
  temp<-temp+pr
}

mydist
##    myval....1 myfreq....1.....k...1..k..n
## 1           1                0.6513215599
## 2           2                0.2413042577
## 3           3                0.0791266575
## 4           4                0.0222009073
## 5           5                0.0050700551
## 6           6                0.0008717049
## 7           7                0.0000989527
## 8           8                0.0000058025
## 9           9                0.0000001023
## 10         10                0.0000000001
plot(mydist)

myrandom<-c()

for (i in (1:100000)){
  temp<-min(sample(1:10,10,replace=T))
  myrandom<-c(myrandom,temp)
}


table(myrandom)
## myrandom
##     1     2     3     4     5     6     7 
## 65128 24156  7915  2183   528    77    13
hist(myrandom, breaks=seq(0,10,by=1))

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

2.1 Geometrical

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

Solution:

\(Pr(x>8)=1-(1-p)^8=0.5695\) ,where \(\mu=10=1/p\), or \(p=0.1\)

\(\mu =10\)

\(Var(x)=(1-p)/p^2=90\)

1-0.9^8
## [1] 0.5695328
(0.9)/0.01
## [1] 90

2.2 Exponential

What is the probability that the machine will fail after 8 years?. Provide also the expected value and standard deviation. Model as an exponential.

Solution:

\(Pr(x>8)=1-(1-e^{-\lambda 8})=e^{-\lambda 8}=0.4493\), where \(\lambda =1/\mu=0.1\)

\(\mu = 1/\lambda =10\)

\(Var(x)=1/\lambda ^2=100\)

exp(-0.8)
## [1] 0.449329

2.3 Binomial

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)

Solution:

\(Pr(x>8)=1-\binom{8}{0} p^0(1-p)^8=0.5695\), where \(p=\mu/n=1/10=0.1\)

\(\mu =np=10*0.1=1\)

\(Var(x)=np(1-p)=10*0.1*0.9=0.9\)

1-0.9^8
## [1] 0.5695328

2.4 Poisson

What is the probability that the machine will fail after 8 years?. Provide also the expected value and standard deviation. Model as a Poisson.

Solution:

I will reverse years and events.

Pr(9 years or more to fail)=1-Pr(8 or less years to fail)\(=1-\sum_{n=1}^{8} \lambda ^n e^{-\lambda} /n!=0.6672\), where \(\lambda =10\)

\(\mu =\lambda =10\)

\(Var(x)=\lambda =10\)

1-ppois(8,lambda=10)
## [1] 0.6671803
ppois(0,lambda=10)
## [1] 4.539993e-05