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

In order to find the distribution function m(j) = P(Y = j), we will need to count the number of ways that we can assign X1, X2, …, Xn to values between j and k with at least one Xi being assigned to j and divide by the total number of possible ways to assign X1, X2, …, Xn to values between 1 and k.

k^n - the total possible number of assignments for the entire collection of random variables

(k −1)^n represents all of the options where none of the Xi’s are equal to 1.

k^n − (k − 1)^n is the number of ways of getting Y = 1

if Y = j then there are (k −j + 1)^n − (k − j)^n ways to assign X1, …, Xn so that the minimum value is j. Therefore, we should define m(j) to be (k − j + 1)^n − (k − j)^n

Source:

https://math.dartmouth.edu/archive/m20f10/public_html/HW5Solutions.pdf

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

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

p = 0.1 (1 every 10)

Geometric distribution:

success = failure

P(x<=n) = (1-p)^(x)*p, n - expected number of failures before the first success

P(x>n) = 1 - P(x<=n)

n = 8
p = 0.1
q = 1-p

pgeom(n-1, p, lower.tail = F)
## [1] 0.4304672
# expected value
q = 1 - p
ex <-q/p
ex
## [1] 9
#  standard deviation
std<-sqrt(q/p^2)
std
## [1] 9.486833

Excersise 2.b.

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

Exponential distribution:

P(x<=n) = 1 - e−λx

P(x>n) = 1 - P(x<=n)

n = 8
1 - (1- exp(-0.1*n))
## [1] 0.449329
#  checking with R
pexp(8, 0.1, lower.tail = F)
## [1] 0.449329
#  expected value
ex <- 1/0.1
ex
## [1] 10
#  standard deviation
std<-sqrt(1/0.1^2)
std
## [1] 10

Excersise 2.c.

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)

Binomial distribution:

P(X=0) = p^k * q^(n-k)

n = 8
k = 0

p^k * q^(n-k)
## [1] 0.4304672
# checking with R
pbinom(0,8,0.1, lower.tail = T)
## [1] 0.4304672
#  expected value E(X) = n*p
ex<-n*p
ex
## [1] 0.8
std<-sqrt(n*p*q)
std
## [1] 0.8485281

Excersise 2.d.

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

Poisson distribution:

P(X=k)^8 = ((e^-lambda*(lambda^k)/k!

average number of failures in 8 years will be: lambda = 8/10 = 0.8

ppois(0, 0.8, lower.tail = T)
## [1] 0.449329
lambda = 0.8

# expected value
ex<- lambda
ex
## [1] 0.8
std<-sqrt(lambda)
std
## [1] 0.8944272