The probability that Y assumes a value y is the probability that Y all \(X_i\) > y-1. Mathematically;
P(Y=y) = P(\(X_i\)>y-1)
P(\(X_i\)>y-1) = (k - (y-1))/k
P(\(X_i\)=y) = 1/k
Since the random variables are independent, the probability that all \(X_i\) are greater than y-1 and at least one \(X_i\) is equal to y is denoted as on below:
\[P(Y=y) = (\frac{k-(y-1)}{k})^{n} - (\frac{k-y}{k})^{n}\]
Problem 2:
p_failure = 1/10 # Probability of failure in a given year
# Probability of failure after 8 years (k = 8)
prob_failure_after_8_years = (1 - p_failure)^(8 - 1) * p_failure
cat("Probability of failure after 8 years:", prob_failure_after_8_years, "\n")
## Probability of failure after 8 years: 0.04782969
#Expected value and standard deviation
expected_value = 1 / p_failure
standard_deviation = sqrt((1 - p_failure) / p_failure^2)
cat("Expected value:", expected_value, "\n")
## Expected value: 10
cat("Standard deviation:", standard_deviation, "\n")
## Standard deviation: 9.486833
expected_lifetime = 10
lambda = 1 / expected_lifetime # Failure rate
#Probability of failure after 8 years
prob_failure_after_8_years = 1 - pexp(8, rate = lambda)
cat("Probability of failure after 8 years:", prob_failure_after_8_years, "\n")
## Probability of failure after 8 years: 0.449329
#Expected value and standard deviation
expected_value = 1 / lambda
standard_deviation = 1 / lambda
cat("Expected value:", expected_value, "\n")
## Expected value: 10
cat("Standard deviation:", standard_deviation, "\n")
## Standard deviation: 10
n_years = 8 # Number of years
k_failures = 0 # Number of failures
p_failure = 1/10 # Probability of failure in a given year
#Probability of 0 failures in 8 years using the binomial distribution
prob_0_failures = dbinom(k_failures, size = n_years, prob = p_failure)
cat("Probability of 0 failures in 8 years:", prob_0_failures, "\n")
## Probability of 0 failures in 8 years: 0.4304672
# Calculate the expected value and standard deviation
expected_value = n_years * p_failure
standard_deviation = sqrt(n_years * p_failure * (1 - p_failure))
cat("Expected value:", expected_value, "\n")
## Expected value: 0.8
cat("Standard deviation:", standard_deviation, "\n")
## Standard deviation: 0.8485281
lambda_failure = 8/10 # Average rate of failures in 8 years
#Probability of 0 failures in 8 years using the Poisson distribution
prob_0_failures = dpois(0, lambda = lambda_failure)
cat("Probability of 0 failures in 8 years:", prob_0_failures, "\n")
## Probability of 0 failures in 8 years: 0.449329
#Expected value and standard deviation
expected_value = lambda_failure
standard_deviation = sqrt(lambda_failure)
cat("Expected value:", expected_value, "\n")
## Expected value: 0.8
cat("Standard deviation:", standard_deviation, "\n")
## Standard deviation: 0.8944272