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.)
Solution:
PDF for this distribution will be \(PDF(X1)*(1-CDF(X2))*(1-CDF(X3))*...(1-CDF(XN))+PDF(X2)*(1-CDF(X2))*...=N\lambda e^{-\lambda x}*e^{-\lambda x(N-1)}=N\lambda e^{-\lambda xN}\), or exponential with new \(\lambda\) \(\lambda N\). Our new mean is X mean divided by N, or 1000 divided by 100, or 10.
Let’s test it:
tval<-0
for (i in (1:10000)){
rval<-rexp(100, rate = 0.001)
tval<-tval+min(rval)
}
tval/10000
## [1] 10.00168
Very close
Assume that X1 and X2 are independent random variables, each having an exponential density with parameter \(\lambda\). Show that \(Z = X1-X2\) has density \(f_Z(z) = (1/2)\lambda e^{-\lambda|z|}\)
Solution:
\(Z=X1-X2\), or \(X2=X1-Z\), where \(X1>0\) and \(X2>0\)
\(f_Z(z)=\int_{-\infty}^{+\infty}f_{X1}(X1)f_{X2}(X1-Z)dX1=\int_Z^{+\infty}f_{X1}(X1)f_{X2}(X1-Z)dX1=\)
\(\int_Z^{+\infty}\lambda e^{-\lambda X1} \lambda e^{-\lambda (X1-Z)}dX1=\int_Z^{+\infty}\lambda^2 e^{-2\lambda X1+\lambda Z}dX1=\)
\(\int_{-Z/{2\lambda}}^{+\infty}-\lambda/2 e^{-2\lambda X1+\lambda Z}d(-2\lambda X1)=(\lambda/2)e^{-\lambda |z|}\)
Let’s test it for \(\lambda=1\)
library(ggplot2)
library(dplyr)
## Warning: package 'dplyr' was built under R version 3.5.2
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
Z1<-c()
Z2<-data.frame(myval<-numeric(),myfreq<-numeric())
for (i in (1:10000)){
X1<-rexp(n=1, rate = 1)
X2<-rexp(n=1, rate = 1)
Z1<-c(Z1,X1-X2)
Z2<-rbind(Z2,c(-10+i/500,0.5*exp((-1)*abs(-10+i/500))))
}
colnames(Z2)<-c('myval','myfreq')
plot(density(Z1))
plot(Z2$myval, Z2$myfreq)
Both functions look simular
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.
\(P(|X-10|\geq 2)\)
Solution:
Chebyshev’s Inequality:
\(P(|X-µ| \geq \epsilon) \leq \sigma ^2/\epsilon^2\)
\(P(|X-10| \geq 2)\leq 100/3/4=1\)
100/12
## [1] 8.333333
\(P(|X-10|\geq 5)\)
Solution:
\(P(|X-10| \geq 5)\leq 100/3/25=1\)
\(P(|X-10| \geq 9)\)
Solution:
\(P(|X-10| \geq 9)\leq 100/3/81=0.4115\)
100/243
## [1] 0.4115226
\(P(|X-10| \geq 20)\)
Solution:
\(P(|X-10| \geq 9)\leq100/3/400=0.0833\)
100/1200
## [1] 0.08333333