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

# X <- 1 to k

# rectangle base: k - 1

# probability distribution
> Y(X=x) 1/k-1 for x <= 1 >= k,
> 0 otherwise

\[\mathrm{P}(x) = \frac{1}{k-1} \ x \in 1 \le x \ge k\]

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

Geometric

  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 <- 1/10 # probability the machine fail in 10years
x = 8 # first number of years the machinge will not fail

#P(X>x) = ((1-p)^x) * p

# probability
((1-p)^x) * p
## [1] 0.04304672
#Expected value
1/p
## [1] 10
#std deviation : sqrt(variance)
sqrt((1-p)/p^2)
## [1] 9.486833

Exponential

  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.
lambda <- 1/10
x <- 8

# probability
exp(-lambda*x)
## [1] 0.449329
# expected value
1/lambda
## [1] 10
#standard deviation
sqrt(1/lambda^2)
## [1] 10

Binomial

  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)
p<-1/10
n<-8
x<-0

# probability
((factorial(n)/
(factorial(n-x)*factorial(x)))
*
((p^x)*((1-p)^(n-x))))
## [1] 0.4304672
# same as these 2
choose(n,x)*((p)^x)*((1-p)^(n-x))
## [1] 0.4304672
pbinom(x,n,p)
## [1] 0.4304672
# expected value
n*p
## [1] 0.8
# standard deviation
sqrt(n*p * (1-p))
## [1] 0.8485281

Poisson

  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
x <- 8

# probability
((lambda^x)*exp(-lambda))/factorial(x)
## [1] 0.112599
# expected value
lambda
## [1] 10
# standard deviation
sqrt(lambda)
## [1] 3.162278