11: A company buys 100 lightbulbs, each of which has an exponential lifetime of

1000 hours. What is the expected time for the first of these bulbs to burn out? (See Exercise 10.)

bulb <- 100
lifetime <- 1000

lifetime <- rexp(bulb, rate = 1/lifetime)

expected_time <- mean(lifetime)

expected_time
## [1] 1134.738

14: Assume that X1 and X2 are independent random variables, each having an

exponential density with parameter λ. Show that Z = X1 − X2 has density \[ f_Z(z) = \frac{1}{2}\lambda e^{-\lambda|z|} \]

Derivation of Density Function \(f_Z(z)\) for \(Z = X_1 - X_2\)

Exponential Distributions

Exponential distributions describe the time between events in a Poisson process, with PDF: \(f(x) = \lambda e^{-\lambda x}\). The CDF of an exponential distribution is: \(F(x) = 1 - e^{-\lambda x}\).

Density Function of \(Z\)

Let \(Z = X_1 - X_2\), with \(X_1\) and \(X_2\) being independent exponential random variables. Using convolution, the PDF of \(Z\) is derived as: \[ f_Z(z) = \frac{\lambda}{2} e^{-\lambda |z|} \] This indicates that \(Z\) follows a Laplace distribution with mean 0 and scale parameter \(\frac{1}{\lambda}\).

Code example

lambda <- 0.5

f_Z <- function(z) {
  (1/2) * lambda * exp(-lambda * abs(z))
}

z_values <- seq(-10, 10, length.out = 1000)

density_values <- f_Z(z_values)

plot(z_values, density_values, type = "l", 
     xlab = "z", ylab = "Density", 
     main = expression(f[z](z) == frac(1,2)*lambda*exp(-lambda*abs(z))))

Page 320 question 1: Let X be a continuous random variable with mean µ = 10 and variance σ 2 = 100/3. Using Chebyshev’s Inequality, find an upper bound for the following probabilities.

mu <- 10  
variance <- 100/3  
sigma <- sqrt(variance) 
k_values <- c(1, 2, 3)  

chebyshev_upper_bound <- function(k, sigma) {
  1 / (k^2)
}

upper_bounds <- sapply(k_values, chebyshev_upper_bound, sigma=sigma)

for (i in seq_along(k_values)) {
  cat("Upper bound for P(|X - µ| ≥", k_values[i], "σ):", upper_bounds[i], "\n")
}
## Upper bound for P(|X - µ| ≥ 1 σ): 1 
## Upper bound for P(|X - µ| ≥ 2 σ): 0.25 
## Upper bound for P(|X - µ| ≥ 3 σ): 0.1111111