1. 1. Let X1, X2, . . . , Xn be n mutually independent random variables, each ofwhich is uniformly distributed on the integers from 1 to k. Let Y denote the minimum of the Xi’s. Find the distribution of Y .

This question was way over my head.
I thought about it a while and looked a lot online.
It is most likely incorrect

Find the distribution of Y?
In other words find the distribution of the minimum values of the variables(X1 thru Xn)

We know the following:
X1 to Xn are n independent random variables
X1 to Xn are uniformly distributed between integers 1 to k (probabilty of max values and min values are equal)
Y=the minimum values of each variable (Xi)
Xi=minimum value of each variable (Y)

We also know that at least one Xi is equal 1 because X1 thru Xn are distributed between 1 to k. 1 is stated in the problem as “the” minimum value.

The probability that Xi= 1 can be expressed P(Xi=1)= 1/k (k is the the upper most value of a variable)

Because each of these is uniformly distributed we can use the probability mass function.

\(P(Y=y) = \frac{k}{n} \times \left(1 - \frac{1}{k}\right)^{n-1}\)
where k is upper limit of variable value of variable distribution (1 to k)
where n = the number of variables (X1, X2, . . . , Xn)

I do not know if this is the answer which the question is looking for

It occurred me we could also find the distribution we could find all the ways(combinations) in which the variables X1 thru Xn have at least one minimum Xi=1 and then plot the distribution.

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

I solved this using years as opposed to months. I solved for 8 years then subtracted the probability by 1 to obtain the answer

Geometric distribution qualifiers:
1.) there are two outcomes, success and failure. In this case, success is a failure after 8 years.
2.) each failure is independent, and
3.) the machine lasts until it fails?

p= probability of failure in any year= 1/10 failures per year
k= number of years= 8 years

Probability
\(P(T=k)=(1-p)^{k-1}*P\)

Mean
\(\mu = \frac{1}{p}\)

Standard Deviation
\(\sigma = \sqrt{\frac{1-p}{p^2}}\)

By Hand
P(T>8)= 1 - P(T ≤ 8)
P(T≤8)= P(T=1)+P(T=2)+P(T=3)+P(T=4)+P(T=5)+P(T=6)+P(T=7)+P(T=8)
P(T≤8)= 0.0478 + 0.0531 + 0.0590 + 0.0656 + 0.0729 + 0.081 + 0.09+ 0.1
P(T≤8)= 0.5694 is the probability the machine will fail within 8 years
P(T>8)= 1- 0.5694
P(T>8)= 0.4306 is the probability the machine will fail after 8 years

library(stats)
p_failure=1/10
#probability
p_fail_after_8_years  <- 1- pgeom(7, prob = p_failure) # i don't understand why this is a seven and not an eight

#mean/expected value
expected_value_geo<-1/p_failure

#standard deviation
sd_geo <- sqrt((1-p_failure)/(p_failure^2))

print(paste("The probability that the machine will fail after 8 years is", p_fail_after_8_years))
## [1] "The probability that the machine will fail after 8 years is 0.43046721"
print(paste("The expected value is", expected_value_geo))
## [1] "The expected value is 10"
print(paste("The standard deviation is", sd_geo))
## [1] "The standard deviation is 9.48683298050514"

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

I solved this problem for months to see if the answers approximated each other for question b and a. It does.

Probability
\(P(T \leq 8) = 1 - e^{-\frac{k}{\mu}}\)

Rate
\(\lambda= 0.1\)

Expected Value/Mean
\(\mu = \frac{1}{\lambda}\)
\(\mu = \frac{1}{0.1}\)

Standard deviation (same as expected value)
\(\sigma = \frac{1}{\lambda}\)
\(\sigma = \frac{1}{0.1}\)

#rate
p_fails <- 1/120 # rate is 1 failure every 120 months
#probability
p_fails_8_years_geom <- pgeom(96,p_fails, lower.tail = FALSE)
#expected value
evalue <- 1 / p_fails
#sd
sd_machine_fails_geom <- 1 / p_fails

print(paste("The probability that the machine will fail after 8 years is", p_fails_8_years_geom))
## [1] "The probability that the machine will fail after 8 years is 0.444093471175778"
print(paste("The expected value is", evalue))
## [1] "The expected value is 120"
print(paste("The standard deviation is", sd_machine_fails_geom))
## [1] "The standard deviation is 120"

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)

I solved this problem for years instead of months because it was just less math.

Binomial Probability
P(X = k) = \(\binom{n}{k} \times p^k \times (1 - p)^{n - k}\)

Expected value
\(\mu = n*p\)

Standard deviation
\(\sigma = \sqrt{n \times p \times (1 - p)}\)
\(\sigma = \binom{8}{0} \times 0.1^0 \times (1 - 0.1)^{8 - 0}\)

#Proability
n <- 8    #Number of trial/ years
p <- 1/10 #Probability of failure is one in every ten years
k <- 0    #Zero successes in the first 8 years is equal to the prob that machine will fail after 8 years

#proability
pbinom<-pbinom(0,8,0.1,lower.tail=TRUE)

#Expected Value
ev<- n*p

#standard deviation
sd <- sqrt(n * p * (1 - p))

print(paste("The probability that the machine will fail after 8 years is", pbinom))
## [1] "The probability that the machine will fail after 8 years is 0.43046721"
print(paste("The expected value is", ev))
## [1] "The expected value is 0.8"
print(paste("The standard deviation is", sd))
## [1] "The standard deviation is 0.848528137423857"

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.

I again calculated this for years to cut down on the math/larger numbers.

Probability Distribution for Poisson
\(P(X = k) = \frac{{e^{-\lambda} \cdot \lambda^k}}{{k!}}\)

Rate
\(\lambda=events/time\)

Expected Value
\(\mu = \lambda\)

Standard Deviation
\(\sigma = \sqrt{\lambda}\)

#Rate
lambda <- 1/10

#time interval for no failures
t <- 8  
#events in time interval for no failures
k <- 0    

#probability
prob_pois <- dpois(0, lambda * t)

#expected value/mean
ev_pois <- lambda * t

#standard dev
sd_pois <- sqrt(lambda * t)


print(paste("The probability that the machine will fail after 8 years is", prob_pois))
## [1] "The probability that the machine will fail after 8 years is 0.449328964117222"
print(paste("The expected value is", ev_pois))
## [1] "The expected value is 0.8"
print(paste("The standard deviation is", sd_pois))
## [1] "The standard deviation is 0.894427190999916"