\(Y = min({X_1...X_n})\) If \(X_n\) possible values maxes at k then our denominator is \(k^n\)
\(k^n - (k-j)^n\) can be used to express all \(X_i\) with a min of j.
\((k-j+1)^n\) can be used to express all values greater than the min of j
From there we can get \(((k-j+1)^n -(k-j)^n) / k^n\)
#some general variables
years = c(1,2,3,4,5,6,7,8,9,10)
mu = 10
p = .1
trials = 8
#Geometric distribution
#Success is when the machine fails
#Probability of success .1
#P(X<8)
geometric_func = function(x,p){
(1-p)^(x-1)*p
}
distributions = sapply(years,geometric_func,p)
#Accumulate probabilites of failing (years machine doesn't fail), take complement of that probability.
prob = 1-sum(distributions[1:8])
eV = 1/p
sd = sqrt(.9/p^2)
print(c(prob,eV,sd))
## [1] 0.4304672 10.0000000 9.4868330
#P(X<8)
#1-e^(-8/10) would be the function we need
exponential_func = function(x,mu){
1-exp(1)^(-x/mu)
}
distributions = sapply(years,exponential_func,mu)
#We don't need to accumulate probabilities here; just take the complement of 8 years
prob = 1-distributions[8]
eV = mu
sd = mu
print(c(prob,eV,sd))
## [1] 0.449329 10.000000 10.000000
binomial_func = function(trials,successes,p){
factorial(trials) / (factorial(successes)*factorial((trials-successes)) )* (p^successes)*(1-p)^(trials-successes)
}
distributions = sapply(years,binomial_func,0,p)
prob = distributions[8]
eV = 8 * p
sd = sqrt(8*p*.9)
print(c(prob,eV,sd))
## [1] 0.4304672 0.8000000 0.8485281
mu = 8 * p
lambda = mu
variance = mu
sd = sqrt(mu)
poisson_func = function(years,occurences,mu,p){
mu = years * p
(mu^occurences)*((exp(-mu))/factorial(occurences))
}
distributions = sapply(years,poisson_func,0,mu,p)
prob = distributions[8]
print(c(prob,mu,sd))
## [1] 0.4493290 0.8000000 0.8944272