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.

We are looking to find the probability that Y is less than or equal to some value s, which translates to the event that one of the draws from the n uniform random variables is less than or equal to s (since Y is the minimum of the n draws of X from X1, X2, … Xn).

This is equivalent to finding (1 - probability that none of the n uniform random variables are less than s).

Prob(Y<=s)= 1-Prob(Y>=s)=1-Prob([x1>s],[x2>s],…[xn>s])

Prob(X1>s)=(1-s/k), since the integers are uniformly distributed from 1 to k

For n such independent uniform random variables, we get (1-s/k)^n

Therefore Prob(Y<=s)=1-((1-s/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..)

Let’s define p (probability of success) as the probability of the machine failing. This has been given as 0.1 or 1/10 The expected value of number of years before the first success = 1/p The std deviation of this distribution = sqrt((1-p)/p^2)

p<-0.1
q<-1-p

(ExpVal=1/p)
## [1] 10
(StdDev=sqrt((1-p)/p^2))
## [1] 9.486833

The probability of the machine failing after 8 years is equal to the probability of it not failing in each of the first 8 years. So we calculate the probability of it failing in years 1,2,3,4,5,6,7,8 and sum up those probabilities. That sum is the probability of it failing in years 1 to 8. We subtract that sum from 1 to get the probability of it failing after 8 years.

sum.prob=0
for (n in 0:7)
{
   sum.prob = sum.prob + ((1-p)^n)*p
}
1 - sum.prob
## [1] 0.4304672

b) Model as an exponential.

Mean time between successes = 10

lambda = Arrival Rate = 0.1

lambda<-1/10
(ExpVal=1/lambda)
## [1] 10
(StdDev=1/lambda)
## [1] 10

The cdf of the exponential distribution is defined as:

\[\begin{equation} F(x, \lambda) = \begin{cases} 1 - e^{-\lambda x } & x \geq 0 \\ 0 & x < 0 \\ \end{cases} \end{equation}\]

P(Y>8)=1-P(Y<=8)=1-cdf

lambda<-1/10

(1-(1-(exp(-lambda*8))))
## [1] 0.449329

c) Model as a binomial

p<-0.10
q<-1-p
n<-8

(ExpVal<-n*p)
## [1] 0.8
(StdDev<-sqrt(n*p*q))
## [1] 0.8485281
n<-8
k<-0
(choose(n,k)*p^k*q^(n-k))
## [1] 0.4304672

d) Model as a poisson

Average number of failures in a period = lambda = 1/10

lambda<-0.1
(ExpVal<-lambda)
## [1] 0.1
(StdDev<-sqrt(lambda))
## [1] 0.3162278

Probability of no failures in a year = ((lambda^0)/0!)xexp(-lambda) We assume that failure in each year is independent of previous years.

k<-0
lambda<-0.1
prob=((lambda^0)/factorial(0))*exp(-lambda)
# Since lambda^0=0 and factorial(0)=1, we get prob = exp(-lambda)
(prob=exp(-lambda))
## [1] 0.9048374
# So for 0 failures in each of years 1,2,3...8, we have:
(prob.zero.fails.8y<-exp(-lambda)^8)
## [1] 0.449329