library(glue)
  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 .

P(X1 > y, X2 > y, …, Xn > y) = (k-y)n/kn

Therefore the probability that Y = y is given by the difference

P(Y = y) = P(X1 > y, X2 > y, …, Xn > y) - P(X1 > y+1, X2 > y+1, …, Xn > y+1)

= (k-y)n/kn - (k-y-1)n/kn

= [(k-y)^n - (k-y-1)^n]/k^n

So the distribution of Y is given by:

P(Y = y) = [(k-y)^n - (k-y-1)^n]/k^n, where y = 1, 2, …, k.

  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.). 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(X=x)=p(1−p)^n−1

p <- 1/10
x <- (1-p)**(8-1)*p**0

glue('The probability that the machine fails using the geometric model is {x}.')
## The probability that the machine fails using the geometric model is 0.4782969.

Expected Value:

E[X]=1/p

q <- 1/p
glue('There is an expected value of {q} years for the machine.')
## There is an expected value of 10 years for the machine.

Standard Deviation = sqrt(1-p/p^2)

standdev <- sqrt((1-p)/(p^2))
glue('The standard deviation is {standdev}.')
## The standard deviation is 9.48683298050514.
  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.

Exponential Distribution P(X>=8)=e^−k/u

expdev <- exp(-8/10)
glue('P(X>=8) = {expdev}.')
## P(X>=8) = 0.449328964117222.

Expected Value:

E[X]=u=1/u!=10

u!=1/10

expval <- 1/.1
glue('E(X) = {expval}')
## E(X) = 10

Standard Deviation:

sd= sqrt(1/(u!)^2)

sd = sqrt((1)/(.1^2))
glue('Standard Deviation = {sd}')
## Standard Deviation = 10
  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(X>8)=1∗px(1−p)n−x

probb = (.1)^(0)*(.9)^(8)
glue('P(X>=8) = {probb}')
## P(X>=8) = 0.43046721

Expected Value:

E[X]=np

evalu = 8*p
glue('E(X) = {evalu} failures')
## E(X) = 0.8 failures

Standard Deviation = sqrt(npq)

stdev = sqrt(8*(.1)*(.9))
glue('Standard Deviation is {stdev}')
## Standard Deviation is 0.848528137423857
  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.

P(X=8)=u!xe−u!/x!

u!=np/t=8∗.1/1=.8 x=8

prob = .8^(8)*exp(-.8/8)
glue('P(X>=8) = {prob}')
## P(X>=8) = 0.151806528072716

Expected Value

E[X]=u!=.8

Standard Deviation:

sd=sqrt(u!)

sd = sqrt(.8)
glue('Standard Deviation is {sd}')
## Standard Deviation is 0.894427190999916