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?

For this problem, we want to find the expected time for the first of the 100 lightbulbs to burn out, given that each has an exponential lifetime of 1000 hours.

We will approach this problem by first understanding that the rate parameter \(\lambda\) of an exponential distribution with mean \(\mu\) is \(\lambda = \frac{1}{\mu}\). For a single lightbulb with a mean lifetime of 1000 hours, \(\lambda = \frac{1}{1000}\).

When considering 100 lightbulbs, the rate parameter for the first one to fail is \(100 \times \lambda\), because the rate parameters add up for independent exponential random variables. The expected time for the first failure is then the reciprocal of this combined rate parameter.

Here’s how:

# Define the mean lifetime of one lightbulb
mean_lifetime <- 1000  # in hours

# Calculate the rate parameter for one lightbulb
lambda <- 1 / mean_lifetime

# For 100 lightbulbs, the combined rate parameter is 100 times the individual rate parameter
combined_lambda <- 100 * lambda

# The expected time for the first lightbulb to burn out is the reciprocal of the combined rate parameter
expected_time_first_burnout <- 1 / combined_lambda

# Expected time for the first lightbulb to burn out in hours is:
expected_time_first_burnout
## [1] 10

14. Assume that \(X_1\) and \(X_2\) are independent random variables, each having an exponential density with parameter \(\lambda\). Show that \(Z = X_1 - X_2\) has density \(f_Z(z) = \frac{1}{2}\lambda e^{-\lambda|z|}\).

We will simulate two sets of exponential random variables \(X_1\) and \(X_2\), compute their difference \(Z = X_1 - X_2\), and then plot the empirical density of \(Z\) to compare it with the theoretical density \(f_Z(z) = \frac{1}{2}\lambda e^{-\lambda|z|}\).

set.seed(123)

lambda <- 1  # Exponential parameter
n <- 10000   # Number of simulations

# Generate random samples
X1 <- rexp(n, rate = lambda)
X2 <- rexp(n, rate = lambda)

# Compute Z = X1 - X2
Z <- X1 - X2

# Plot empirical density of Z
plot(density(Z), main="Density of Z = X1 - X2", xlab="Z", ylab="Density")

# Add theoretical density f_Z(z)
z_values <- seq(min(Z), max(Z), length.out = 300)
f_Z <- (1/2) * lambda * exp(-lambda * abs(z_values))
lines(z_values, f_Z, col = "red")

legend("topright", legend=c("Empirical Density", "Theoretical Density"), col=c("black", "red"), lty=1)

The plot shows the empirical density of \(Z = X_1 - X_2\) and overlays it with the theoretical density \(f_Z(z)\). We see that the empirical density closely matches the theoretical density, providing a visual confirmation of the density function of \(Z\).

1. Let \(X\) be a continuous random variable with mean \(\mu = 10\) and variance \(\sigma^2 = \frac{100}{3}\). Using Chebyshev’s Inequality, find an upper bound for the following probabilities.

  1. \(P(|X-10| \geq 2)\).
  2. \(P(|X-10| \geq 5)\).
  3. \(P(|X-10| \geq 9)\).
  4. \(P(|X - 10| \geq 20)\).

We’ll use Chebyshev’s Inequality in R to find an upper bound for the probabilities. Chebyshev’s Inequality states that for any real number \(k > 0\), \[ P(|X - \mu| \geq k\sigma) \leq \frac{1}{k^2} \] where \(\mu\) is the mean and \(\sigma\) is the standard deviation of the random variable \(X\). Given \(\mu = 10\) and \(\sigma^2 = \frac{100}{3}\), we first calculate \(\sigma\): \[ \sigma = \sqrt{\sigma^2} = \sqrt{\frac{100}{3}} \]

Now, let’s calculate the upper bounds for the probabilities in R:

# Mean and variance
mu <- 10
variance <- 100/3

# Standard deviation
sigma <- sqrt(variance)

# Function to calculate the upper bound using Chebyshev's Inequality
chebyshev_upper_bound <- function(k) {
  upper_bound <- 1 / k^2
  return(upper_bound)
}

# (a) P(|X-10|≥2)
k_a <- 2 / sigma
upper_bound_a <- chebyshev_upper_bound(k_a)

# Upper bound for P(|X-10|≥2):
upper_bound_a
## [1] 8.333333
# (b) P(|X-10|≥5)
k_b <- 5 / sigma
upper_bound_b <- chebyshev_upper_bound(k_b)

# Upper bound for P(|X-10|≥5):
upper_bound_b
## [1] 1.333333
# (c) P(|X-10|≥9)
k_c <- 9 / sigma
upper_bound_c <- chebyshev_upper_bound(k_c)

# Upper bound for P(|X-10|≥9):
upper_bound_c
## [1] 0.4115226
# (d) P(|X-10|≥20)
k_d <- 20 / sigma
upper_bound_d <- chebyshev_upper_bound(k_d)

# Upper bound for P(|X-10|≥20):
upper_bound_d
## [1] 0.08333333