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.)
mu <- 1000
n <- 100
(expected_value <- mu/n)
## [1] 10
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|} \]
fz <- function(z, lambda) {
(1/2) * lambda * exp(-lambda * abs(z))
}
Here, lambda is the parameter of the exponential distribution of X1 and X2. We can plot this density function for different values of lambda as follows:
z <- seq(-5, 5, length.out = 1000)
lambda <- 1
plot(z, fz(z, lambda), type = "l", xlab = "z", ylab = "f(z)", main = "Density of Z = X1 - X2")
lines(z, fz(z, lambda = 2), col = "red")
lines(z, fz(z, lambda = 0.5), col = "blue")
legend("topright", legend = c("lambda = 1", "lambda = 2", "lambda = 0.5"),
col = c("black", "red", "blue"), lty = 1)
This will produce a plot of the density function fz(z) over the range -5 to 5 with lambda = 1, 2 & 0.5. We can adjust the range and lambda values as needed to visualize the function over different ranges and parameter values.
#1 on page 320-321
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.
a. P(|X−10|≥ 2).
b. P(|X−10|≥ 5).
c. P(|X−10|≥ 9).
d. P(|X−10|≥20).
We know that, Chebyshev inequality = \(P(x-\mu| \geq k\sigma) \leq \frac {\sigma^2} {k^2 - \sigma^2} = \frac {1}{k^2}\)
mu_1 <- 10
variance_1 <- 100/3
sigma_1 <- sqrt(variance_1)
upper_bound <- function(x) {
k <- x/sigma_1
ub <- 1/k^2
if (ub > 1) {
paste0("Since probability cannot be > 1, so the upper bound is: ", 1)
}
else {
paste0("The upper bound is: ", ub)
}
}
(a) P(|X - 10| >= 2)
upper_bound(2)
## [1] "Since probability cannot be > 1, so the upper bound is: 1"
b) P(|X - 10| >= 5)
upper_bound(5)
## [1] "Since probability cannot be > 1, so the upper bound is: 1"
(c) P(|X - 10| >= 9)
upper_bound(9)
## [1] "The upper bound is: 0.411522633744856"
(d) P(|X - 10| >= 20)
upper_bound(20)
## [1] "The upper bound is: 0.0833333333333333"