a problem from durret's essentials of stochastic processes A submarine has three navigational devices but can remain at sea if at least
two are working. Suppose that the failure times are exponential with means $1,1.5$
and $3$ years. What is the average length of time the boat can remain at sea.
i think if $T$ is "length of time the boat can remain at sea",and we call the devices $A,B$ and $C$ respectively,and $D_i$ is the i'th device that has failure we have:
$$\begin{align*}E(T) = &E(T|D_1=A,D_2=B)P(D_1=A,D_2=B) \\&+
E(T|D_1=A,D_2=C)P(D_1=A,D_2=C) \\ &+E(T|D_1=B,D_2=A)P(D_1=B,D_2=A) \\ &+E(T|D_1=B,D_2=C)P(D_1=B,D_2=C) \\ &+E(T|D_1=C,D_2=B)P(D_1=C,D_2=B) \\ &+E(T|D_1=C,D_2=A)P(D_1=C,D_2=A) \end{align*}$$
all the $P's$ can be calculated easily,but how to compute conditional expectations?
is there any hint?
thanks
 A: Let T be the expected value of the time the boat can remain at sea.  Let A, B, and C denote the events that A, B, C do not fail before some time t respectively.
$$E(T) = \int_0^{\infty}P(T > t)dt$$
$$= \int_0^{\infty}[P(A \cap B) + P(A \cap C) + P(B \cap C) - 2P(A \cap B \cap C)] dt$$
by the inclusion-exclusion principle.  Note that $P(A \cap B \cap C)$ is added by each of the first 3 terms for a total of 3 times, so we subtract twice its value so it is counted only once.  These probabilities are easily evaluated.  For example
$$P(A \cap B) = e^{-t}e^{-t/1.5}$$
The expectation comes to 27/20 = 1.35.  This was verified by the R simulation below which can do this problem for any number of devices with specified mean lifetimes and any minimum number needed to work.

# Simulates average time that at least k of n devices continue to function.
# Device lives are exponentially distributed with given means.
# Sim runs until user breaks.

means = c(1, 1.5, 3)   # input vector of mean lifetimes
k = 2                  # input minumum number of devices needed to function
n = length(means)

T.sum = 0
sims = 0
while(1) {
  T.sum = T.sum + sort(rexp(n,1/means))[n-k+1]
  sims = sims + 1
}
ev = T.sum/sims
ev
sims

Output:

> ev
[1] 1.35006
> sims
[1] 1457653


