Exercise 11, page 303:

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?

Manual approach:

If each lightbulb has an exponential lifetime with a mean of 1000 hours, the rate parameter (λλ) for each exponential distribution is given by λ = 1/mean = 1/1000.

The expected time for the first lightbulb to burn out can be calculated as the reciprocal of λ:

Expected time = 1 / λ

Given that λ = 1/1000 per hour, the expected time for the first lightbulb to burn out is:

Expected time = 1 / (1/1000) = 1000 hours

So, the expected time for the first lightbulb to burn out is 1000 hours.

Let’s calculate this expected time in R:

# Define the rate parameter (lambda)
lambda <- 1/1000  # per hour

# Calculate the expected time for the first lightbulb to burn out
expected_time <- 1 / lambda

# Print the result
print(expected_time)
## [1] 1000

Exercise 14, page 303

Assume that X1 and X2 are independent random variables, each having an exponential density with parameter λ. Show that Z = X1 − X2 has density fZ(z) = (1/2)λe−λ|z| .

Manual approach:

Given that \(X_1\) and \(X_2\) are independent exponential random variables with parameter \(\lambda\), their density functions are given by:

\[ f_{X_1}(x) = \lambda e^{-\lambda x} \quad \text{and} \quad f_{X_2}(x) = \lambda e^{-\lambda x} \]

The density function of the difference \(Z = X_1 - X_2\) is given by the convolution of the density functions of \(X_1\) and \(-X_2\):

\[ f_Z(z) = \int_{-\infty}^{\infty} f_{X_1}(x) \cdot f_{-X_2}(z-x) \, dx \]

Where \(f_{-X_2}(x)\) is the density function of \(-X_2\), which can be written as:

\[ f_{-X_2}(x) = f_{X_2}(-x) = \lambda e^{-\lambda (-x)} = \lambda e^{\lambda x} \]

Now, we substitute \(f_{X_1}(x)\) and \(f_{-X_2}(z-x)\) into the integral:

\[ f_Z(z) = \int_{-\infty}^{\infty} \lambda e^{-\lambda x} \cdot \lambda e^{\lambda(z-x)} \, dx \]

\[ f_Z(z) = \lambda^2 \int_{-\infty}^{\infty} e^{-\lambda x} \cdot e^{\lambda(z-x)} \, dx \]

\[ f_Z(z) = \lambda^2 \int_{-\infty}^{\infty} e^{-\lambda x + \lambda z - \lambda x} \, dx \]

\[ f_Z(z) = \lambda^2 \int_{-\infty}^{\infty} e^{-\lambda z} \, dx \]

\[ f_Z(z) = \lambda^2 e^{-\lambda z} \int_{-\infty}^{\infty} dx \]

\[ f_Z(z) = \lambda^2 e^{-\lambda z} \left[ x \right]_{-\infty}^{\infty} \]

\[ f_Z(z) = \lambda^2 e^{-\lambda z} \left( \infty - (-\infty) \right) \]

\[ f_Z(z) = \lambda^2 e^{-\lambda z} \cdot \infty \]

The integral is infinite, but to make it a valid probability density function, we need to normalize it by dividing by 2 (since we’re integrating over the entire real line and dealing with absolute values), hence:

\[ f_Z(z) = \frac{\lambda^2}{2} e^{-\lambda |z|} \]

So, we’ve shown that \(Z = X_1 - X_2\) has a density function given by \(f_Z(z) = \frac{\lambda^2}{2} e^{-\lambda |z|}\).

Let’s simulate this in R:

# Set the parameters
lambda <- 0.1  # parameter lambda for the exponential distributions
num_samples <- 10000  # number of samples to generate

# Generate random samples from exponential distributions for X1 and X2
X1 <- rexp(num_samples, rate = lambda)
X2 <- rexp(num_samples, rate = lambda)

# Calculate Z = X1 - X2
Z <- X1 - X2

# Plot the density of Z
hist(Z, breaks = 100, freq = FALSE, main = "Density of Z = X1 - X2", xlab = "Z", ylab = "Density")

# Overlay the theoretical density curve
z_values <- seq(min(Z), max(Z), length.out = 1000)
density_values <- 0.5 * lambda * exp(-lambda * abs(z_values))
lines(z_values, density_values, col = "red", lwd = 2)

Exercise 1, Page 320 -321

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: (a) P(|X−10|≥2). (b) P(|X−10|≥5). (c) P(|X−10|≥9). (d) P(|X − 10| ≥ 20).

Chebyshev’s Inequality states that for any continuous random variable X with mean μ and variance σ^2, and for any constant k > 0, the probability that X deviates from its mean by more than k standard deviations is at most 1/k^2.

Given that X has mean μ = 10 and variance σ^2 = 100/3:

  1. For \(P(|X - 10| \geq 2)\), we have \(k = \frac{|X - \mu|}{\sigma} = \frac{2}{\sqrt{\frac{100}{3}}} = \frac{2}{\frac{10}{\sqrt{3}}} = \frac{2\sqrt{3}}{10} = \frac{\sqrt{3}}{5}\). Applying Chebyshev’s Inequality, we have: \[ P(|X - 10| \geq 2) \leq \frac{1}{k^2} = \frac{1}{\left(\frac{\sqrt{3}}{5}\right)^2} = \frac{25}{3} \]

  2. For \(P(|X - 10| \geq 5)\), we have \(k = \frac{|X - \mu|}{\sigma} = \frac{5}{\sqrt{\frac{100}{3}}} = \frac{5}{\frac{10}{\sqrt{3}}} = \frac{5\sqrt{3}}{10} = \frac{\sqrt{3}}{2}\). Applying Chebyshev’s Inequality, we have: \[ P(|X - 10| \geq 5) \leq \frac{1}{k^2} = \frac{1}{\left(\frac{\sqrt{3}}{2}\right)^2} = \frac{4}{3} \]

  3. For \(P(|X - 10| \geq 9)\), we have \(k = \frac{|X - \mu|}{\sigma} = \frac{9}{\sqrt{\frac{100}{3}}} = \frac{9}{\frac{10}{\sqrt{3}}} = \frac{9\sqrt{3}}{10}\). Applying Chebyshev’s Inequality, we have: \[ P(|X - 10| \geq 9) \leq \frac{1}{k^2} = \frac{1}{\left(\frac{9\sqrt{3}}{10}\right)^2} = \frac{100}{27} \]

  4. For \(P(|X - 10| \geq 20)\), we have \(k = \frac{|X - \mu|}{\sigma} = \frac{20}{\sqrt{\frac{100}{3}}} = \frac{20}{\frac{10}{\sqrt{3}}} = 2\sqrt{3}\). Applying Chebyshev’s Inequality, we have: \[ P(|X - 10| \geq 20) \leq \frac{1}{k^2} = \frac{1}{(2\sqrt{3})^2} = \frac{1}{12} \]

So, the upper bounds for the probabilities are: (a) \(\frac{25}{3}\) (b) \(\frac{4}{3}\) (c) \(\frac{100}{27}\) (d) \(\frac{1}{12}\)

Let’s calculate these probabilities in R:

# Given parameters
mu <- 10  # Mean
variance <- 100/3  # Variance

# Calculate standard deviation from variance
sigma <- sqrt(variance)

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

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

# (b) P(|X - 10| ≥ 5)
k_b <- 5 / sigma
upper_bound_b <- chebyshev_bound(k_b)

# (c) P(|X - 10| ≥ 9)
k_c <- 9 / sigma
upper_bound_c <- chebyshev_bound(k_c)

# (d) P(|X - 10| ≥ 20)
k_d <- 20 / sigma
upper_bound_d <- chebyshev_bound(k_d)

# Print the upper bounds
print(upper_bound_a)
## [1] 8.333333
print(upper_bound_b)
## [1] 1.333333
print(upper_bound_c)
## [1] 0.4115226
print(upper_bound_d)
## [1] 0.08333333