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 .

To find the probability density function of Y, we first define Y, k, and n: Y is the random variable that represents the minimum value of Xi’s. Xi’s can have an outcome between k-1 with equal probability since Xi’s are uniformly distrubuted. n is the number of X’s. min is some value between 1-k that is Y

First, we find the probability that Xi’s are greater than equal to the min. This includes the probability from one removed from the min to greater values.

\[\text{Probability of }Xi \text{ is greater than equal to the min.}\] \[\text{number of integers from min to k }: k-(min+1)\] \[\text{total number from 1 to k }: k\] \[ P({Xi}\ge{min}) = \frac{k-min+1}{k} \]

The probability that each of the X’s are greater than equal to the min is product of each probability of X’s: \[ P({X1}\ge{min},X2\ge{min},...,Xn\ge{min}) = \left(\frac{k-min+1}{k}\right)^n \]

Second, we find what the probability is for Xi’s to equal greater than the next lowest outcome, (min-1). This is the same calculation as the last section except the min value is removed from the probability calc. So the +1 is removed. \[\text{Probability of }Xi \text{ is greater than equal to the min-1.}\] \[ P({Xi}\ge{min+1}) = \frac{k-min}{k} \] \[ P({X1}\ge{min+1},X2\ge{min+1},...,Xn\ge{min+1}) = \left(\frac{k-min}{k}\right)^n \]

Finally, by subtracting this probability from the probability that all the Xi’s are greater than or equal to y, we obtain the probability that Y is exactly the min.

\[ P({X1}\ge{min+1},X2\ge{min+1},...,Xn\ge{min+1})-P({X1}\ge{min},X2\ge{min},...,Xn\ge{min}) = \left(\frac{k-min+1}{k}\right)^n-\left(\frac{k-min}{k}\right)^n \]

This is the distribution of Y based on a uniform distribution of Xi.

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

The probability that a machine will not fail the first 8 years can be modeled using geometric distribution.

\[ P({X=n}) = (1-p)^{n-1}\times p \] \[\text{The probability of not failing can be multiplied such as:}\] \[ P({X=8}) = (p)_1\times(p)_2\times...\times(p)_8 \]

#  mean rate of not failing per 10 years 
lambda = 1-(1/10) 

# 8 years
n = 8 

P = (lambda)^n

print(paste0('Probability that a machine will fail after 8 years is ',round(P*100,2),'%'))
## [1] "Probability that a machine will fail after 8 years is 43.05%"

The mean or the expected number of years until failure is:

E = 1/(1/10)
print(E)
## [1] 10

The standard deviation (how many years the actual lifetime is expected to vary from the mean years) is:

p = 1/10
sqrt(1-p)/p
## [1] 9.486833
  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.

The cumulative distribution function of the exponential distribution is shown: \[ f(x) = 1-e^{(-\lambda x)} \]

The cumulative function provides the probability of observing the failure by a certain time. So we calculate the probability of obvserving the failure greater than or equal to 8 years. \[ P(X\ge8) = 1-(1-e^{(-\lambda x)}) \]

lambda = 1/10
x = 8
P = exp(1)^(-lambda*x)
print(paste0('Probability that a machine will fail after 8 years is ',round(P*100,2),'%'))
## [1] "Probability that a machine will fail after 8 years is 44.93%"

The mean of an exponential distribution is: \[ mean = \frac{1}{\lambda} \]

lambda = 1/10
1/lambda
## [1] 10

\[ SD = \sqrt\frac{1}{\lambda^2} \]

1/lambda
## [1] 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=k) = (n choose k)p^k(1-p)^{n-k}\] \[\text{Since there's only one way to order the years, the c choose k is 1}\] \[ P(x=8) = 1\times 0.9^8(1-0.9)^{8-8}\]

p = 1-(1/10)
n = 8
k = 8
P = (p^8)*(1-p)^0
print(paste0('Probability that a machine will fail after 8 years is ',round(P*100,2),'%'))
## [1] "Probability that a machine will fail after 8 years is 43.05%"

The mean of the binomial distribution is:

\[mean = np\]

p = 1/10
n*p
## [1] 0.8

The standard deviation is: \[\sqrt{np(1-p)}\]

 sqrt(n*p*(1-p))
## [1] 0.8485281
  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.

note: The binomial distribution is used to model the number of successes in a fixed number of independent trials, whereas the Poisson distribution is used to model the number of events in a fixed interval of time or space.

For this problem, we use the equation: \[P(x=k)=\frac{e^{-\lambda}\lambda^k}{k!}\]

Since the Poisson distribution models the number of events in a fixed interval, the interval will be 8 years in this case. So lambda is the average failure rate and since we’re interested in the failure rate for the given interval of 8 years, lambda = 8*(1/10). We want a number of 0 successes of failure in this time interval so k = 0.

lambda = 8*(1/10)
P = exp(1)^(-lambda)
print(paste0('Probability that a machine will fail after 8 years is ',round(P*100,2),'%'))
## [1] "Probability that a machine will fail after 8 years is 44.93%"

The mean is simply lambda. The failure rate for the 8 year interval of time.

print(paste0('The mean of the Poisson distribution is ',round(lambda,2)))
## [1] "The mean of the Poisson distribution is 0.8"

The standard deviation of the Poisson Distribution can be calculated using:

\[\sigma=\sqrt \lambda\]

sqrt(lambda)
## [1] 0.8944272