(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\).
To find the distribution, start by evaluating the probability where the minimum value of the distributions is 1: \[P(Y=1) = 1 - P(Y>1) = 1-\left( \frac{k-1}{k} \right)^n\] Next, evaluate \(P(Y=2)\)
\[P(Y=2) = 1 - P(Y>2) -P(Y=1)\] substitute in the answer above: \[P(Y=2) = 1 - P(Y>2) - \left( 1-\left( \frac{k-1}{k} \right)^n \right)\] \(P( Y>2 ) = \left( \frac{k-2}{k} \right)^n\), substituting this in to the previous result gives: \[P(Y=2) = 1 - \left( \frac{k-2}{k} \right)^n - \left( 1-\left( \frac{k-1}{k} \right)^n \right)\] This can be simplified to \[P(Y=2) = \frac{(k-2)^n-(k-1)^n}{k^n}\] This can be generalized as: \[P(Y=y) = \frac{(k-y)^n-(k-y-1)^n}{k^n}\]
Now to functionalize this expression:
Evaluate an example where:
Pvals <- c()
for ( i in seq( 1,k,1 ) ){
val <- Pofy( k,i,n )
Pvals[i] <- val
}
library( ggplot2 )
Xvals <- seq( 1,k,1 )
data <- data.frame( Xvals, Pvals )
ggplot( data, aes( x=Xvals, y=Pvals ) ) +
geom_line() +
ggtitle( 'Distribution of Minimums' )(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..)
P_F <- 1/10 #probability of failing in a given year
P_NF <- 1 - P_F #probability of not failing in a given year
E_val <- 1 / P_F #expected value
STD <- sqrt( P_NF / P_F^2 ) #standard deviation
#probability that the machine will not fail for the first 8 years
# P( no failures for 8 years ) = 1 - P( not failing )^8
numY <- 8
P_8yearsNF_geometic <- 1-( 1-P_NF^numY )
#alternatively
P_8yearsNF_geometic <- 1 - pgeom( numY-1, P_F )
answer <- paste( 'Expected Value:', E_val,
'\nStandard Deviation:', round( STD, 4 ),
'\nProbability of no failures for 8 years:', round( P_8yearsNF_geometic, 4 ) )
cat( answer, sep='\n' )## Expected Value: 10
## Standard Deviation: 9.4868
## Probability of no failures for 8 years: 0.4305
(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;\lambda ) = \lambda e^{-\lambda x}\]
E_val <- 1 / P_F #expected value
STD <- sqrt( 1 / P_F^2 ) #standard deviation
P_8yearsNF_exp <- pexp( numY, P_F, lower.tail = FALSE )
answer <- paste( 'Expected Value:', E_val,
'\nStandard Deviation:', round( STD, 4 ),
'\nProbability of failure after 8 years (Exponential):',
round( P_8yearsNF_exp, 4 ) )
cat( answer, sep='\n' )## Expected Value: 10
## Standard Deviation: 10
## Probability of failure after 8 years (Exponential): 0.4493
(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 \[\left( \begin{array}{c} n \\ k \end{array} \right) = \frac{n!}{(n-k)!k!}\]
E_val <- numY*P_F #expected value
STD <- sqrt( numY *P_F*P_NF ) #standard deviation
k <- 0 #dbinom will use choose() to compute coefficients
P_8yearsNF_binomial <- dbinom( k, numY, P_F )
answer <- paste( 'Expected Value:', E_val,
'\nStandard Deviation:', round( STD, 4 ),
'\nProbability of failure after 8 years (Binomial):',
round( P_8yearsNF_binomial, 4 ) )
cat( answer, sep='\n' )## Expected Value: 0.8
## Standard Deviation: 0.8485
## Probability of failure after 8 years (Binomial): 0.4305
(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;\lambda)= \frac{e^{-\lambda } * \lambda ^x }{x!}\]
lam <- P_F * numY
E_val <- P_F * numY #expected value
STD <- sqrt( P_F * numY ) #standard deviation
P_8yearsNF_poisson <- ppois( 0, lam )
answer <- paste( 'Expected Value:', E_val,
'\nStandard Deviation:', round( STD, 4 ),
'\nProbability of failure after 8 years (Exponential):',
round( P_8yearsNF_poisson, 4 ) )
cat( answer, sep='\n' )## Expected Value: 0.8
## Standard Deviation: 0.8944
## Probability of failure after 8 years (Exponential): 0.4493