DATA 605 Homework 7

1) Let \(X_{1}\), \(X_{2}\), . . . , \(X_{n}\) 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 \(X_{i}s\). Find the distribution of Y .

Let’s say k is the number of options and n is the number of values. Number of combinations for \(X_{i}s\) is \(k^{n}\).

Probability of number of combinations with at least one 1, which would be total number of combinations minus all combinations greater than 1.

P(Y=1) = (\((k^{n})\) - \((k-1)^{n}\)) / \(k^{n}\)

Probability of number of combinations that have atleast one 2, but do not have 1. i.e. subtracting the previous numerator
P(Y=2) = ( (\((k^{n})\) - \((k-2)^{n}\)) - [\((k^{n})\) - \((k-1)^{n}\)] ) / \(k^{n}\)
= ( - \((k-2)^{n}\)) + \((k-1)^{n}\) ) / \(k^{n}\)
= ( \((k-1)^{n}\) - \((k-2)^{n}\)) ) / \(k^{n}\)

Based on the pattern,
P(Y=i) = ( \((k- (i-1))^{n}\) - \((k-i)^{n}\)) ) / \(k^{n}\)
where i is the minimum value.

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

Probability of machine failure is p = 1/10 and q = 1 - 1/10 = 9/10

Based on Geometric distribution modelling,
P(T=n) = \(q^(n-1)p\)

Probability that the machine not failing in first 8 years is
P(X>8) = 1- P(X<=8) P(X<=8) = 1 - (1 - P(X>8))
P(X<=k) = \(q^(k+1)\)
= \(0.9^(8+1)\)
= 0.3874

Standard deviation= \(\sqrt{(0.9/0.1) ^2}\) ~ 9 (approx.)

Using R

p <- 0.1
q <- 0.9

pgeom(8, p, lower.tail = FALSE)
## [1] 0.3874205

The probability that the machine will fail after 8 years is approx ).3874 with a standard deviation around 9.

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.

For exponential model, \(\lambda\) = 0.1 Based on exponential function:
P(X<=k) = \(1 - e^(-k/\mu)\) where \(\mu = 1/\lambda\) = \(1 - e^(-k\lambda)\)

P(X>8) = 1 - P(X<=8) = 1 - \((1 - e^(-8*0.1))\)

1 - (1 - exp(-0.8))
## [1] 0.449329

Expected value = \(1/\lambda\) = 1/0.1 = 10 Standard deviation = \(\sqrt{(1/0.1) ^2}\) = 10

Calculating using R

pexp(8, 0.1, lower.tail = FALSE)
## [1] 0.449329

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)

Expected value = number of years(8) * failure probability (0.1) = 0.8.

Using binomial distribution, the chance of any number of outcomes is:

\(P(Fail)^(nFails)\) * \(P(noFail)^(nNotFails)\)

Probability of No failure within 8 years:

0.1^0 * (1-0.1)^8 = 0.43

Calculating using R:

year = 8
pbinom(0, 8, 0.1)
## [1] 0.4304672

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.

Using poisson distribution, lambda is number of years (8 years) * 0.1 = 0.8

Standard deviation is the sqrt of the variance

variance <- 0.8
(stdev <- sqrt(variance))
## [1] 0.8944272

failure_rate = 0.1 num_years = 8 \(\lambda = 0.1 * 8 = 0.8\)

ppois(0, 0.1)^8
## [1] 0.449329

Alternate approach:

Probability of not failing before 8 years: \((\lambda^k * e^-\lambda)/k!\)

lambda <- 0.8
k <- 0
((lambda**k) * exp(-lambda)) / factorial(k)
## [1] 0.449329