An internet tester sends \(n\) e-mails simultaneously at time \(t=0\). Their arrival times at their destinations are independent random variables each having probability density function \(\lambda \e^{-\lambda t}\) (\(0\le t<\infty\), \( \lambda >0\)).
- The random variable \(T\) is the time of arrival of the e-mail that arrives first at its destination. Show that the probability density function of \(T\) is
\[ n \lambda \e^{-n\lambda t}\,,\]
and find the expected value of \(T\).
- Write down the probability that the second e-mail to arrive at its destination arrives later than time \(t\) and hence derive the density function for the time of arrival of the second e-mail. Show that the expected time of arrival of the second e-mail is
\[ \frac{1}{\lambda} \left( \frac1{n-1} + \frac 1 n \right) \]
Show Solution
- \(\,\) \begin{align*}
&& \mathbb{P}(T > t) &= \mathbb{P}(\text{all emails slower than }t) \\
&&&= \left ( \int_t^{\infty} \lambda e^{-\lambda x} \d x \right)^n \\
&&&= \left ( [- e^{-\lambda x}]_t^\infty\right)^n\\
&&&= e^{-n\lambda t} \\
\Rightarrow && f_T(t) &= n \lambda e^{-n\lambda t} \\
\end{align*}
Therefore \(T \sim \text{Exp}(n \lambda)\) and \(\E[T] = \frac{1}{n \lambda}\)
- Let \(T_2\) be the time until the second email arrives, then.
\begin{align*}
&& \P(T_2 > t) &= \P(\text{all emails} > t) + \P(\text{all but 1 emails} > t) \\
&&&= e^{-n\lambda t} + n \cdot e^{-(n-1)\lambda t}(1-e^{-\lambda t}) \\
&&&= (1-n)e^{-n\lambda t} + n \cdot e^{-(n-1)\lambda t} \\
\Rightarrow && f_{T_2}(t) &= - \left ( (1-n) n \lambda e^{-n \lambda t} -n(n-1)\lambda e^{-(n-1)\lambda t} \right) \\
&&&= n(n-1) \lambda \left (e^{-(n-1)\lambda t} - e^{-n\lambda t} \right) \\
\Rightarrow && \E[T_2] &= \int_0^{\infty} t \cdot n(n-1) \lambda \left (e^{-(n-1)\lambda t} - e^{-n\lambda t} \right) \d t \\
&&&= \int_0^{\infty} \left (n \cdot t (n-1) \lambda e^{-(n-1)\lambda t} -(n-1)\cdot tn \lambda e^{-n\lambda t} \right) \d t \\
&&&= \frac{n}{\lambda(n-1)} - \frac{n-1}{\lambda n} \\
&&&= \frac{1}{\lambda} \left (1+\frac{1}{n-1}- \left (1 - \frac{1}{n} \right) \right) \\
&&&= \frac{1}{\lambda} \left ( \frac{1}{n-1} + \frac{1}{n} \right)
\end{align*}
(We can also view this second expectation as expected time for first email + expected time (of the remaining \(n-1\) emails) for the first email, and we can see that will have that form by the memorilessness property of exponentials)
The maximum height \(X\) of flood water each year on a certain river is a random variable with probability density function \(\f\) given by
\[
\f(x) = \begin{cases}
\lambda \e^{-\lambda x} & \text{for \(x\ge0\)}\,, \\
0 & \text{otherwise,}
\end{cases}
\]
where \(\lambda\) is a positive constant.
It costs \(ky\) pounds each year to prepare for flood water of height \(y\) or less, where \(k\) is a positive constant and \(y\ge0\). If \(X \le y\) no further costs are incurred but if \(X> y\) the additional cost of flood damage is \(a(X - y )\) pounds where \(a\) is a positive constant.
- Let \(C\) be the total cost of dealing with the floods in the year. Show that the expectation of \(C\) is given by
\[\mathrm{E}(C)=ky+\frac{a}{\lambda}\mathrm{e}^{-\lambda y} \, .
\]
How should \(y\) be chosen in order to minimise \(\mathrm{E}(C)\), in the different cases that arise according to the value of \(a/k\)?
- Find the variance of \(C\), and show that the more that is spent on preparing for flood water in advance the smaller this variance.
Show Solution
- \(\,\) \begin{align*}
&& \mathbb{E}(C) &= \int_0^\infty \text{cost}(x) f(x) \d x \\
&&&= ky + \int_y^{\infty} a(x-y) \lambda e^{-\lambda x} \d x\\
&&&= ky + \int_0^{\infty} a u \lambda e^{-\lambda u -\lambda y} \d x \\
&&&= ky + ae^{-\lambda y} \left( \left [ -ue^{-\lambda u} \right]_0^\infty -\int_0^\infty e^{-\lambda u} \d u\right) \\
&&&= ky + \frac{a}{\lambda}e^{-\lambda y} \\
\\
&& \frac{\d \mathbb{E}(C)}{\d y} &= k - ae^{-\lambda y} \\
\Rightarrow && y &= \frac{1}{\lambda}\ln \left ( \frac{a}{k} \right)
\end{align*}
Since \(\mathbb{E}(C)\) is clearly increasing when \(y\) is very large, the optimal value will be \(\frac{1}{\lambda}\ln \left ( \frac{a}{k} \right)\), if \(\frac{a}{k} > 1\), otherwise you should spend nothing on flood defenses.
- \begin{align*}
&& \mathbb{E}(C^2) &= \int_0^{\infty} \text{cost}(x)^2 f(x) \d x \\
&&&= \int_0^{\infty}(ky + a(x-y)\mathbb{1}_{x > y})^2 f(x) \d x \\
&&&= k^2y^2 + \int_y^{\infty}2kya(x-y)f(x)\d x + \int_y^{\infty}a^2 (x-y)^2 f(x) \d x \\
&&&= k^2y^2 + \frac{2kya}{\lambda}e^{- \lambda y}+a^2e^{-\lambda y}\int_{u=0}^\infty u^2 \lambda e^{-\lambda u} \d u \\
&&&= k^2y^2 + \frac{2kya}{\lambda}e^{-\lambda y}+a^2e^{-\lambda y}(\textrm{Var}(Exp(\lambda)) + \mathbb{E}(Exp(\lambda))^2\\
&&&= k^2y^2 + \frac{2kya}{\lambda}e^{-\lambda y} + a^2e^{-\lambda y} \frac{2}{\lambda^2} \\
&& \textrm{Var}(C) &= k^2y^2 + \frac{2kya}{\lambda}e^{-\lambda y} + a^2e^{-\lambda y} \frac{2}{\lambda^2} - \left ( ky + \frac{a}{\lambda} e^{-\lambda y}\right)^2 \\
&&&= a^2e^{-\lambda y} \frac{2}{\lambda^2} - a^2 e^{-2\lambda y}\frac{1}{\lambda^2} \\
&&&= \frac{a^2}{\lambda^2} e^{-\lambda y}\left (2 - e^{-\lambda y} \right) \\
\\
&& \frac{\d \textrm{Var}(C)}{\d y} &= \frac{a^2}{\lambda^2} \left (-2\lambda e^{-\lambda y} +2\lambda e^{-2\lambda y} \right) \\
&&&= \frac{2a^2}{\lambda} e^{-\lambda y}\left (e^{-\lambda y}-1 \right) \leq 0
\end{align*}
so \(\textrm{Var}(C)\) is decreasing in \(y\).
In order to get money from a cash dispenser
I have to punch in an
identification number. I have forgotten my identification number,
but I do know that it is equally likely to be any one of the
integers \(1\), \(2\), \ldots , \(n\).
I plan to punch in integers in order until I get the right
one. I can do this at the rate of \(r\) integers per minute.
As soon as I punch in the first wrong number, the police will be alerted.
The probability that they will arrive within a time \(t\) minutes
is \(1-\e^{-\lambda t}\), where \(\lambda\) is a positive constant.
If I follow my plan, show that the probability of the police arriving
before I get my money is
\[
\sum_{k=1}^n \frac{1-\e^{-\lambda(k-1)/r}}n\;.
\]
Simplify the sum.
On past experience, I know that I will be so flustered that I will
just punch in possible integers at random, without noticing which I have
already tried. Show that the probability of the police arriving before
I get my money is
\[
1-\frac1{n-(n-1)\e^{-\lambda/r}} \;.
\]
A continuous random variable is said to have an exponential distribution
with parameter \(\lambda\) if its density function is
\(\f(t) = \lambda \e ^{- \lambda t} \; \l 0 \le t < \infty \r\,\).
If \(X_1\) and \(X_2\), which are independent random variables,
have exponential distributions with parameters \(\lambda_1\) and \(\lambda_2\) respectively,
find an expression for the probability that either \(X_1\) or \(X_2\) (or both)
is less than \(x\). Prove that if \(X\) is the random variable
whose value is the lesser of the values of \(X_1\) and \(X_2\),
then \(X\) also has an exponential distribution.
Route A and Route B buses run from my house to my college.
The time between buses on each route has an
exponential distribution and the mean time between buses is
15 minutes for Route A and 30 minutes for Route B.
The timings of the buses on the two routes are independent.
If I emerge from my house one day to see a Route A bus
and a Route B bus just leaving the stop,
show that the median wait for the next bus to my college will be approximately 7 minutes.
A random variable \(X\) has the probability density function
\[
\mathrm{f}(x)=\begin{cases}
\lambda\mathrm{e}^{-\lambda x} & x\geqslant0,\\
0 & x<0.
\end{cases}
\]
Show that
$${\rm P}(X>s+t\,\vert X>t) = {\rm P}(X>s).$$
The time it takes an assistant to serve a customer in a certain shop is a random variable with the above distribution and the times for different customers are independent. If, when I enter the shop, the only two assistants are serving one customer each, what is the probability that these customers are both still being served at time \(t\) after I arrive?
One of the assistants finishes serving his customer and immediately starts serving me. What is the probability that I am still being served when the other customer has finished being served?
Show Solution
\begin{align*}
&& \mathbb{P}(X > t) &= \int_t^{\infty} \lambda e^{-\lambda x} \d x\\
&&&= \left[ -e^{-\lambda x} \right]_t^\infty \\
&&&= e^{-\lambda t}\\ \\
&& \mathbb{P}(X > s + t | X > t) &= \frac{\mathbb{P}(X > s + t)}{\mathbb{P}(X > t)} \\
&&&= \frac{e^{-(s+t)\lambda}}{e^{-t\lambda}} \\
&&&= e^{-s\lambda} = \mathbb{P}(X > s)
\end{align*}
The probability both are still being served (independently) is \(\mathbb{P}(X > t)^2 = e^{-2\lambda t}\).
The probability is exactly \(\frac12\). The property we proved in the first part of the questions shows the distribution is memoryless, ie we are both experiencing samples from the same distribution. Therefore we are equally likely to finish first.
The maximum height \(X\) of flood water
each year on a certain
river is a random variable with density function
\begin{equation*}
{\mathrm f}(x)=
\begin{cases}
\exp(-x)&\text{if \(x\geqslant 0\),}\\
0&\text{otherwise}.
\end{cases}
\end{equation*}
It costs \(y\) megadollars each year
to prepare for flood water
of height \(y\) or less. If \(X\leqslant y\)
no further costs are incurred
but if \(X\geqslant y\) the cost of flood damage
is \(r+s(X-y)\) megadollars where \(r,s>0\).
The total cost \(T\) megadollars is thus
given by
\begin{equation*}
T=
\begin{cases}
y&\text{if \(X\leqslant y\)},\\
y+r+s(X-y)&\text{if \(X>y\)}.
\end{cases}
\end{equation*}
Show that we can minimise the expected total cost
by taking
\[y=\ln(r+s).\]
During his performance a trapeze artist is supported by two identical ropes, either of which can bear his weight. Each rope is such that the time, in hours of performance, before it fails is exponentially distributed, independently of the other, with probability density function \(\lambda\exp(-\lambda t)\) for \(t\geqslant0\) (and 0 for \(t < 0\)), for some \(\lambda > 0.\) A particular rope has already been in use for \(t_{0}\) hours of performance. Find the distribution for the length of time the artist can continue to use it before it fails.
Interpret and comment upon your result.
Before going on tour the artist insists that the management purchase two new ropes of the above type. Show that the probability density function of the time until both ropes fail is
\[
\mathrm{f}(t)=\begin{cases}
2\lambda\mathrm{e}^{-\lambda t}(1-\mathrm{e}^{-\lambda t}) & \text{ if }t\geqslant0,\\
0 & \text{ otherwise.}
\end{cases}
\]
If each performance lasts for \(h\) hours, find the probability that both ropes fail during the \(n\)th performance. Show that the probability that both ropes fail during the same performance is \(\tanh(\lambda h/2)\).
Show Solution
This is the memoryless property of the exponential distribution so it has the same distribution as when \(t = 0\). Let \(T\) be the time the rope fails, then
\begin{align*}
&& \mathbb{P}(T > t | T > t_0) &= \frac{\mathbb{P}(T > t)}{\mathbb{P}(T > t_0)} \\
&&&= \frac{e^{-\lambda t}}{e^{-\lambda t_0}} \\
&&&= e^{-\lambda(t-t_0)}
\end{align*}
This means that each rope (as long as it hasn't broken) can be considered "as good as new".
Suppose \(T_1, T_2 \sim Exp(\lambda)\) are the time to failures for each rope, then
\begin{align*}
&& \mathbb{P}(\max(T_1, T_2) < t) &= \mathbb{P}(T_1 < t, T_2 < t) \\
&&&= (1-e^{-\lambda t})^2 \\
\Rightarrow && f(t) &= 2(1-e^{-\lambda t}) \cdot (\lambda e^{-\lambda t}) \\
&&&= 2\lambda e^{-\lambda t}(1-e^{-\lambda t})
\end{align*}
Therefore \(\max(T_1, T_2) \sim Exp(2\lambda)\) and the pdf is as described.
\begin{align*}
&& \mathbb{P}(\text{both fail during the }n\text{th}) &= \left ( \int_{(n-1)h}^{nh} \lambda e^{-\lambda t} \d t \right)^2 \\
&&&=\left (\left [ -e^{-\lambda t}\right]_{(n-1)h}^{nh} \right)^2 \\
&&&= \left ( e^{-\lambda (n-1)h}( 1-e^{-\lambda h}) \right)^2 \\
&&&= e^{-2(n-1)h\lambda}(e^{-\lambda h}-1)^2 \\
\\
&& \mathbb{P}(\text{both fail in same performance}) &= \sum_{n=1}^{\infty} \mathbb{P}(\text{both fail during the }n\text{th}) \\
&&&= \sum_{n=1}^{\infty}e^{-2(n-1)h\lambda}(e^{-\lambda h}-1)^2 \\
&&&= (e^{-\lambda h}-1)^2 \frac{1}{1-e^{-2h\lambda}} \\
&&&= \frac{e^{-\lambda h}-1}{1+e^{-h\lambda}} \\
&&&= \tanh(\lambda h/2)
\end{align*}